I have node-red docker container running on my Pi4B and configured several dashboards successfully. For showing the raspberry temperature usually the vcgencmd is used. Directly under the Pi that works out of the box, but in the container the vcgencmd cannot be found.
Following the description for node-red-contrib-vcgencmd under 'Usage via Docker' several setups need to be configured in order to use the vcgencmd.
I've done all that, but vcgencmd can still not be found !?
/dev/vchiq exist and I can retrieve information out of it:
>$ cat /dev/vchiq
...
If I attach a shell to the container and change into the /opt/vc/bin folder, it shows the vcgencmd. But executing it gives an error:
@DannyBoyKN,
I have added that feature at the time being, as it was requested in this issue. Perhaps if @mikeS7 is reading this discussion, he might be able to help you. I don't use this in Docker myself!
Checked right now, confirmed it doesn't work. It was in time when Node-RED image was based on debian linux. I solved it by using custom image with following in Dockerfile:
USER root
RUN apk add --no-cache raspberrypi
USER node-red
You don't need to use volume mapping in such case.
@DannyBoyKN
You have different Linux distributions in a host and in a container.
You should build your own image, in your case Dockerfile will looks like:
FROM ctmagazin/ctnodered:latest
RUN apk add --no-cache raspberrypi
you should remove - /opt/vc:/opt/vc:ro from compose file
Well, yes. The container is based on Alpine 3.11 and the Pi4B is running debian buster ...
However, I removed the volume mapping and rebuild the container from the Dockerfile by adding as you wroteapk add --no-cache raspberrypi and restarted the container with no luck
By attaching a bash into the container and did manually:
Well, acc. the tutorial it is rebuilding with docker-compose up --build -d, I just tested it.
I modified my Dockerfile acc. your suggestion and will retry ..
Many thanks