Open D9X6 opened 6 years ago
I'm wondering if I would somehow be able to pass a keyboard stroke (CTRL+C) to the terminal from the webpage... or would that be improper?
You should not use subprocesses to start the LED, but rather write a little network interface which allows you to interact with the program to show different things.
Running a webserver that is able to execute sudo
is very dangerous from the security perspective.
It is also not very nice to start and stop the LED matrix as you might create visible glitches on the output.
w.r.t. to the question: you can send a kill command to the process.
Hi @hzeller! Thank you very much for your response.
...but rather write a little network interface which allows you to interact with the program to show different things.
Since I am a novice, are there any resources you can point me in the direction towards? Maybe a general Google search on the matter might suffice - what keywords should I search to learn how to go about doing this? I had a look at some of the demo programs using the Python bindings. I'm very interested in the image-scroller functionality of your library. Eventually I'd like my webpage to have an option to choose a .ppm image and have it scrolled across the panels at the press of a button.
Running a webserver that is able to execute sudo is very dangerous from the security perspective. It is also not very nice to start and stop the LED matrix as you might create visible glitches on the output.
That makes sense to me. You're right about the glitches - at one point, I had multiple demos running simultaneously on my panels.
Thank you for your time and efforts :)
Disclaimer: I'm a novice programmer.
Currently, I've set up a webpage and flask web server on my Pi. For the moment, I've 2 buttons on that HTML webpage.
That looks like this
Currently, I can get the Pi to display a demo (Demo 7, Conways game of life) on my panels successful using an
@app.route()
command. I plan on tying these buttons to this route.This is my
start_led()
command, mentioned above.I would like to make a
stop_led()
function but I am not sure how to go about doing that. How will I be able to stop the demo using a script? Is it necessary to use a script for that?I know I can always use CTRL-C in the terminal but the point is to rely on the webpage and not a terminal to start and stop that demo.
Thank you to anyone who read this far, any help or suggestions are appreciated.