I'm already using node-red on my RPi4 and setup flows to generate a dashboard showing the Pi's memory and cpu load as well as its temperatures. In the past I got problems getting the vcgencmd running in the node-red docker container, see here. That was solved and working fine until recently I tried to upgrade node-red :
Dockerfile.arm:
FROM ghcr.io/ct-open-source/ctnodered:latest
RUN apk add --no-cache raspberrypi
This installs the following versions: node-red 1.2.7
# node --version
v12.20.1
# npm --version
6.14.10
Package node-red-contrib-vcgencmd installed fine and is available at /opt/vc/bin. However, when executing a simply flow using the vcgencmd node the error log gives: Error executing /opt/vc/bin/vcgencmd : Error: Command failed: /opt/vc/bin/vcgencmd measure_temp
Entering a container shell the command runs fine as root:
# /opt/vc/bin/vcgencmd measure_temp
temp=51.1'C
but not as user node-red (part of the video group!):
Note, I kept the settings.js from previous container setup. Potentially there're some configurations missing allowing the new setup to run vcgencmd properly ?
I don't have any clue what's the reason for the error. I will appreciate any help.
Did your update change the node.js version? If so, any nodes with a build step need to be rebuilt.
Yes, it did. Before I had :
Node-RED version: v1.0.4
Node.js version: v10.19.0
Dashboard version 2.19.4
But I don't follow your "... any nodes with a build step need to be rebuilt" ? Before starting the docker container it is rebuild completely.
Also, does your docker version allow access to /proc ? Because you can access the CPU temperature directly I seem to remember.
Well, actually there're branches below /sys/class to access different measurements, but I think vcgencmd provides the GPU temperature, /sys/class the CPU temperature, or vice versa, don't know exactly.
Anyhow vcgencmd does it in a more convenient way. For the Pi4 there's also the pmic temperature somewhere ...
And yes /sys/class is available and accessible :
Well, I've never found Docker to be very convenient or easy so I don't bother with it generally. It has its place I know but the advantages don't outweigh the complexity for anything I need to do.
Hi @DannyBoyKN,
I don't use Docker myself, so unfortunately I have no idea how to help you with this issue. Since @mikeS7 was so kind to assist us the previous time, I'm going to mention him again...
Bart
Thank you for that hint.
I tried and it works, also with FROM nodered/node-red:latest-12 !
So, something in ghcr.io/ct-open-source/ctnodered:latest breaks the access to /dev/vchiq. I noticed, that granting further permissions $> chmod 766 /dev/vchiq works also ...