rpi-rgb-led-matrix icon indicating copy to clipboard operation
rpi-rgb-led-matrix copied to clipboard

File write/create issue (errno 13) after setting matrix option with python

Open devibo opened this issue 1 year ago • 1 comments

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

devibo avatar Nov 28 '23 15:11 devibo

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

hzeller avatar Nov 28 '23 16:11 hzeller