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
docker-compose.yml:
version: '3.6'
services:
nodered:
container_name: ctnodered
build:
context: docker-image
dockerfile: ./Dockerfile.arm
ports:
- "1880:1880"
volumes:
- ./data/nodered:/data
- ./data/nodered:/usr/src/node-red/node-red-static
- /etc/localtime:/etc/localtime
devices:
- "/dev/vchiq:/dev/vchiq"
...
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!):
$ /opt/vc/bin/vcgencmd measure_temp
VCHI initialization failed
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.