hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.59k stars 1.15k forks source link

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

Open devibo opened 7 months ago

devibo commented 7 months ago

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

hzeller commented 7 months ago

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