Error executing vcgencmd after node-red upgrade

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.

Did your update change the node.js version? If so, any nodes with a build step need to be rebuilt.

Also, does your docker version allow access to /proc? Because you can access the CPU temperature directly I seem to remember.

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 :

$> cat /sys/class/thermal/thermal_zone0/temp
51608

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

could you check with FROM nodered/node-red image?

1 Like

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 ...

ghcr.io/ct-open-source/ctnodered:latest is build upon node:12-alpine with further modifications...

Finally my only solution is to modify read/write access rights by adding the following to my Dockerfile.arm above:

RUN chmod 766 /dev/vchiq

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.