rpi-rgb-led-matrix
rpi-rgb-led-matrix copied to clipboard
File write/create issue (errno 13) after setting matrix option with python
Hi, after setting matrix options , it's not possible to create or write to a file. Here a sample program:
#!/usr/bin/env python
from rgbmatrix import RGBMatrix, RGBMatrixOptions
options = RGBMatrixOptions()
matrix = RGBMatrix(options = options)
#this does not work and exits with Errno 13
fobj = open("testfile.txt", "w")
fobj.write("some foo text")
fobj.close()
This example was tested on a Raspberry 6.1.0-rpi4-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linux, Python Version 3.11.2
by default, after starting the RGBMatrix, the privileges are dropped from root to daemon. That user possibly can not write the files.
See documentation at https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/bindings/python#user