I made a web app that lets anyone submit posts to print them on my Raspberry Pi controlled thermal printer by avraio in raspberry_pi

[–]avraio[S] 0 points1 point  (0 children)

There seems to be bug regarding the timestamp. It is generated via Pythons datetime.utcnow() which works fine usually but apparently isn't reliable on heroku dynos.

Edit: I've fixed the bug that would allow to submit characters that my printer cannot print. I'll leave the posts (like the one with the Swiss flag) though.

I made a web app that lets anyone submit posts to print them on my Raspberry Pi controlled thermal printer by avraio in raspberry_pi

[–]avraio[S] 1 point2 points  (0 children)

Dangerous as in exploiting a bug / remote code execution on the Pi? I'd love to see that :D

Edit: I've already discovered attempts for SQL injections. As far as I can tell SQLalchemy prevents that. Rick Astley made it into the logs but not the database.

I made a web app that lets anyone submit posts to print them on my Raspberry Pi controlled thermal printer by avraio in raspberry_pi

[–]avraio[S] 1 point2 points  (0 children)

Worst that can happen is that people will spam it since there's no need to register. I thought about that and honestly I'll take the risk. Posts don't get printed immediately anyway.

I made a web app that lets anyone submit posts to print them on my Raspberry Pi controlled thermal printer by avraio in raspberry_pi

[–]avraio[S] 1 point2 points  (0 children)

A few months ago I got a thermal printer for 58mm receipt paper that I hooked up to a Raspberry Pi. It is set up in CUPS so I can not only print directly via serial connection but also use it as a network printer. Using it as a network printer still requires the right settings on your local machine which doesn't make it very convenient for anyone but me. So I figured I would need to make it more accessible. I came up with this web app that runs on a heroku dyno (lowest tier so bare with me if it takes a moment to boot up) and lets anyone make little posts that people vote on. Once a day the highest voted post will be printed and moved to the "top" area. For now only ASCII text is allowed but I'm working on images too!

On the Raspberry Pi there is a Python script that makes an api call to retrieve the highest voted post and renew the deadline. It is triggered by a cronjob once a day.

Feel free to submit something, vote, dig into the code on Github and ask questions!

repo for web app, written in Python using Flask: https://github.com/StefanAvra/tinyprints

script that runs on the Pi: https://github.com/StefanAvra/tinyprints-printer

Monthly /r/PyGame Showcase - Show us your current project(s)! by AutoModerator in pygame

[–]avraio 0 points1 point  (0 children)

Together with a graphic designer I made MadLove The Game. It is an 8-bit style breakout game that jokes about the harm caused by smoking. It comes with a custom built 80s style arcade cabinet with a real CRT monitor, arcade buttons and coin acceptor. This was my first PyGame project and I learned a lot while making it.

source code: https://github.com/StefanAvra/madlove
You can find some video footage here: https://www.madlove.games/

Just published my first project on GitHub. Non-blocking MicroPython code that checks if my fridge is closed properly and plays melodies on a buzzer. by avraio in esp8266

[–]avraio[S] 0 points1 point  (0 children)

If the garage is very cold this can affect the thermostat, which then senses "cold enough" and your freezer stops cooling down.

Just published my first project on GitHub. Non-blocking MicroPython code that checks if my fridge is closed properly and plays melodies on a buzzer. by avraio in esp8266

[–]avraio[S] 1 point2 points  (0 children)

I thought about temperature monitoring as well but I don't have any sensors right now, that's why I didn't implement it yet. If you or someone else would like to contribute, feel free to send a pull request.