Closed jghaanstra closed 5 years ago
You always have to run as root to generate proper images ( https://github.com/hzeller/rpi-rgb-led-matrix#running-as-root )
That being said, since recently (a couple of days ago), it it also possible to run without root, but it will be degraded performance, so it is still not desired.
Thanx for the quick response @hzeller . I forgot to mention that I'm running as root already.
pi@raspberrypi3bplus:~/python-led-matrix $ sudo su
root@raspberrypi3bplus:/home/pi/python-led-matrix# sudo python python-led-matrix-api.py
* Serving Flask app "python-led-matrix-api" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://0.0.0.0:5050/ (Press CTRL+C to quit)
* Restarting with stat
Must run as root to be able to access /dev/mem
Prepend 'sudo' to the command
root@raspberrypi3bplus:/home/pi/python-led-matrix#
did you compile from a recent version if the library? Hardware detection of the Pi3+ was not working before unless you manually edited the code.
do you drop privileges anywhere in your flask app before initializing the rgb matrix? try starting it as early as possible, before starting flask, which might do privilege dropping.
I used the outdated script from Adafruit but adjusted it to the latest commit so it should be pretty up to date.
But I left for holidays this morning. So I will check in three weeks ago again and post back here.
Add this options when you are creating the list of options that have the matrix/panel/display:
options.drop_privileges = 0 options.daemon = 0
Add this options when you are creating the list of options that have the matrix/panel/display:
options.drop_privileges = 0 options.daemon = 0
Thanx, this did the trick!
I'm trying to built a simple WebAPI with Flask for controlling my LED matrix. Controlling the LED matrix with the Python API works just fine. But when I add the code for Flask to create the endpoints I get the following error.
I dont understand why using Flask together with rpi-rgb-led-matrix would generate this error. My code looks like this (beware, I'm a python newbie)