I have created project with balena Dash and added a Node-RED containter. I would like to control backlight of the mounted display through Node-RED, but when I hit the backlight_on.sh or backlight_off.sh it says Error: EROFS: read-only file system, open '/sys/class/backlight/rpi_backlight/bl_power
Is there any way to change the read-only FS to writable?
Thank you very much.
PS: My Dockerfile for the Node-RED looks like this:
FROM nodered/node-red-docker:rpi-v8
USER root
RUN apt-get update && apt-get install nano
USER node-red
RUN npm install node-red-contrib-resinio
RUN npm install node-red-dashboard
RUN npm install node-red-contrib-credentials
RUN npm install node-red-admin
RUN npm install --save rpi-backlight
COPY ./settings.js /data/settings.js
Hi @owar. Can you share the relevant parts from your docker-compose.yml as well? It might be that the Node-RED container needs to be added as privileged: true, to be able to write to those locations?
Thank you very much. It was of course the missing priviliged mode. I now just have to figure out how to set permissions to /sys/class/backlight/rpi_backlight/bl_power so I can write to this file from NodeRed
Error: EACCES: permission denied, open '/sys/class/backlight/rpi_backlight/bl_power'
This discussion came up in the balena-node-red project:
The issue as seen there, based on more feedback from @owar and now understanding the questions much more, is that the user is switched:
USER node-red
That /sys/class/backlight/rpi_backlight/bl_power is indeed root-writable only, and changing the permissions inside the container doesn’t make a difference outside, still need effective root user to use that. Thus the solution to the above is not switching the user to node-red, but using the root user.
Also, I see that you are using nodered/node-red-docker:rpi-v8 which is not a Balena base image and please note that there are a lot of things there that might be set up differently than in our (IoT and Balena optimized) base images.