Comments (9)
Hey @owarek, are you deploying this project as it is, or are you combining it with other containers in a multicontainer setup?
from balena-node-red.
I have it as multicontainer setup. This is my compose file:
version: '2'
volumes:
node-red-data:
services:
wpe:
restart: always
build: ./wpe
privileged: true
scheduler:
restart: always
build: ./scheduler
privileged: true
mqtt:
image: panuwitp/mosquitto-arm
ports:
- "1883:1883"
node-red:
build: ./node-red
privileged: true
volumes:
- 'node-red-data:/data'
ports:
- "1880:1880"
depends_on:
- mqtt
restart: always
from balena-node-red.
Hi, probably you need to paste that in not a ">" style of "quoting" but the code block as triple-backticks (`), see more in the help https://help.github.com/en/articles/creating-and-highlighting-code-blocks
And since you are using a completely different way of deploying the project, it's harder to answer what might be the issue. If you just deploy this particular project as it is in the repo, do you have the same error?
My guess would have been the privileged: true
setting being required (that "read-only" warning being more a permission issue, than actual read only file system issue for /sys
, as much as I know). Since it seems in your code you already use that, we will need to check further what other source of that error might be.
from balena-node-red.
Also, how are you changing the backlight of a display, and what display are you using?
Do you have things shown on the display normally besides this issue? I'm guessing that the WPE service manages the display normally?
from balena-node-red.
I think you have the 7" Raspberry Pi display, right?
Just tried that with this particular project, and use echo
to write to that setting. The command returns an error, but the value is being set correctly. Here's the log from the node-red service's container (deployed as this project)
bash-4.4# echo 1 > /sys/class/backlight/rpi_backlight/bl_power
bash: echo: write error: Invalid argument
bash-4.4# cat /sys/class/backlight/rpi_backlight/bl_power
1
bash-4.4# echo 0 > /sys/class/backlight/rpi_backlight/bl_power
bash: echo: write error: Invalid argument
bash-4.4# cat /sys/class/backlight/rpi_backlight/bl_power
0
and looking at the screen, indeed it turns it off when 1
is sent, and turn it on when 0
is sent.
Thus it should work from the container, just have to find what setting is required. This does not seem to be the issue of this node-red
project, however, regardless of the outcome.
from balena-node-red.
Thank you for investigating this. Here is the compose file again:
volumes:
node-red-data:
services:
wpe:
restart: always
build: ./wpe
privileged: true
scheduler:
restart: always
build: ./scheduler
privileged: true
mqtt:
image: panuwitp/mosquitto-arm
ports:
- "1883:1883"
node-red:
build: ./node-red
privileged: true
volumes:
- 'node-red-data:/data'
ports:
- "1880:1880"
depends_on:
- mqtt
restart: always
and here is the dockerfile for node-red:
COPY ./settings.js /data/settings.js
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
And yes I have the 7" RPi touch display. This is the output from terminal of node-red container:
node-red@cc2011243739:~$ echo 1 > /sys/class/backlight/rpi_backlight/bl_power
bash: /sys/class/backlight/rpi_backlight/bl_power: Permission denied
node-red@cc2011243739:~$ cat /sys/class/backlight/rpi_backlight/bl_power
0
In wpe and scheduler it works. In mqtt and node-red it does not.
from balena-node-red.
@owarek I think the issue is that you are setting the user in node-red:
USER node-red
thus that user doesn't have the privileges to modify the file. So I think you will have to set up that user to have the right permissions, or keep using the root
user?
from balena-node-red.
Yes, that may be the reason but I do not know how to add permisions to write to that file to nodered user. I have tried to add sudo chmod 777
after ther USER root
in dockerfile and also tried to chown node-red
in host OS both with no success. Only thing that worked is chmod 777
in host OS. Do you have any idea how to set this differently or more safe?
from balena-node-red.
You are already running a privileged container, not sure what's the reason you are trying to switch the user. As you see in this project as well, that the user is not switched. I think the main way to solve this to use a root user as you already do in the other two containers anyways.
from balena-node-red.
Related Issues (20)
- Getting started HOT 3
- Best practices to distribute created flows HOT 1
- Multicontainer support HOT 17
- Error running on IOT2000 (beta) HOT 2
- Rpi.GPIO library HOT 5
- RPI GPIO HOT 1
- Siemens IoT2000/2040 - "Pull access denied for balenalib/iot2000-alpine-node, repository does not exist or may require 'docker login'" HOT 2
- 2 Warnings logged related to node-red-contrib-balena HOT 1
- Do not by default run the node-red service as "privileged" service and "root" user
- support node-red-node-pi-gpiod HOT 1
- Is there a specific need to set network_mode to host ? HOT 1
- Project fails to build / push: Unable to locate package rpi.gpio, python-rpi.gpio HOT 4
- Project no longer runs on latest Node Red install, missing dependencies HOT 1
- Push fails with balena.yml is not a valid contract HOT 2
- Raspberry PI 4 is not starting when using the image HOT 1
- Some nodes are no more working on alpine HOT 16
- any reason not to update nodejs?
- Unable to login on new alpine Node-red HOT 5
- node-red env variables in development mode HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from balena-node-red.