# Error executing vcgencmd after node-red upgrade

**URL:** <https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554>\
**Category:** General\
**Created:** [7 February 2021 14:34 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554 "2021-02-07T14:34:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DannyBoyKN](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dannyboykn/32/15341_2.png) [@DannyBoyKN](https://discourse.nodered.org/u/DannyBoyKN)\
**Post date:** [7 February 2021 14:34 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/1 "2021-02-07T14:34:19Z")

</div>

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](https://discourse.nodered.org/t/use-vcgencmd-within-a-docker-node-red-container/23050). That was solved and working fine until recently I tried to upgrade node-red :

Dockerfile.arm:

```auto
FROM ghcr.io/ct-open-source/ctnodered:latest
RUN apk add --no-cache raspberrypi

```

docker-compose.yml:

```auto
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

```auto
# 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:

```auto
# /opt/vc/bin/vcgencmd measure_temp
temp=51.1'C

```

but not as user node-red (part of the video group!):

```auto
$ /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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [7 February 2021 16:28 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/2 "2021-02-07T16:28:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DannyBoyKN](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dannyboykn/32/15341_2.png) [@DannyBoyKN](https://discourse.nodered.org/u/DannyBoyKN)\
**Post date:** [7 February 2021 17:14 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/3 "2021-02-07T17:14:39Z")

</div>

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

```auto
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 :

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

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [7 February 2021 21:03 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/4 "2021-02-07T21:03:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 February 2021 22:15 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/5 "2021-02-26T22:15:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikeS7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikes7/32/2026_2.png) [@mikeS7](https://discourse.nodered.org/u/mikeS7)\
**Post date:** [27 February 2021 05:40 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/6 "2021-02-27T05:40:50Z")

</div>

> [@DannyBoyKN](#):
>
> `FROM ghcr.io/ct-open-source/ctnodered:latest`

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

---

<div class="post-metadata">

**Author:** ![DannyBoyKN](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dannyboykn/32/15341_2.png) [@DannyBoyKN](https://discourse.nodered.org/u/DannyBoyKN)\
**Post date:** [27 February 2021 13:40 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/7 "2021-02-27T13:40:05Z")

</div>

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](http://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 ...

---

<div class="post-metadata">

**Author:** ![DannyBoyKN](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dannyboykn/32/15341_2.png) [@DannyBoyKN](https://discourse.nodered.org/u/DannyBoyKN)\
**Post date:** [25 March 2021 21:08 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/8 "2021-03-25T21:08:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 April 2021 21:09 UTC](https://discourse.nodered.org/t/error-executing-vcgencmd-after-node-red-upgrade/40554/9 "2021-04-08T21:09:13Z")

</div>

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