# Ras Pi supply voltage

**URL:** <https://discourse.nodered.org/t/ras-pi-supply-voltage/8791>\
**Category:** General\
**Created:** [9 March 2019 22:41 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791 "2019-03-09T22:41:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 March 2019 22:41 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/1 "2019-03-09T22:41:48Z")

</div>

I've just contributed to [Best / most stable OS and Hardware for NodeRed?](https://discourse.nodered.org/t/best-most-stable-os-and-hardware-for-nodered/8679/22) which got me thinking about how many users are using poor cable or power supplies for Raspberry Pi's, and their performance is throttled...

As I understand it....

`$ vcgencmd get_throttled` should return zero if the supply voltage is at least 4.63V.  
When below 4.63V my response is `throttled=0x50005` which I understand translates to;

```auto
0: under-voltage
1: arm frequency capped
2: currently throttled 
16: under-voltage has occurred
17: arm frequency capped has occurred
18: throttling has occurred

```

What are your readings??

Paul

---

<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:** [10 March 2019 03:12 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/2 "2019-03-10T03:12:51Z")

</div>

> [@Paul-Reed](#):
>
> vcgencmd get\_throttled

Pi2: `throttled=0x0`  
Pi3: `throttled=0x50000`

For the Pi3:

```auto
$ vcgencmd measure_temp
temp=37.6'C

```

So perhaps running a little hot. Possibly because InfluxDB is reaching 26% CPU every few seconds. Node-RED is also bursting to around 20-30% CPU every minute.

If I've calculated it right, 0x50000 =

Bit 17: Arm frequency capped has occurred

Bit 19: Soft temperature limit has occurred

[https://github.com/raspberrypi/documentation/blob/JamesH65-patch-vcgencmd-vcdbg-docs/raspbian/applications/vcgencmd.md](https://github.com/raspberrypi/documentation/blob/JamesH65-patch-vcgencmd-vcdbg-docs/raspbian/applications/vcgencmd.md)

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [10 March 2019 05:12 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/3 "2019-03-10T05:12:11Z")

</div>

I may be wrong, but I've been interpreting the `vcgencmd` results a bit differently. As I understand it, the least-significant digit (bits 0-3) represents the current state, and the most-significant digit (bits 16-19) represents past occurrences, presumably since the last boot up. So, the code `0x50005` has bits 0,2,16, and 18 set, meaning

> 0: under-voltage  
> 2: currently throttled  
> 16: under-voltage has occurred  
> 18: throttling has occurred

Similarly, 0x50000 means that there has been under-voltage and throttling in the past but not currently. The temperature seen by @TotallyInformation should not be a concern. [Temperature throttling](https://www.raspberrypi.org/documentation/hardware/raspberrypi/frequency-management.md) doesn't start until 80°C. The soft temperature limit (60°C by default and adjustable in software) was introduced in the Pi3B+ to give a more gradual approach to the hard limit.

I haven't had a chance to check all of my Pi's, but two 3B's that report `throttled=0x0` have temperatures of 50.5°C and 48.9°C. I can report on two or three more machines if there is interest.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 March 2019 09:35 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/4 "2019-03-10T09:35:21Z")

</div>

A node that would pick up the temperature, throttled state etc would be useful.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [10 March 2019 10:42 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/5 "2019-03-10T10:42:18Z")

</div>

> [@TotallyInformation](#):
>
> So perhaps running a little hot. Possibly because InfluxDB is reaching 26% CPU every few seconds.

This may help with that:

> [@InfluxDB on a Raspberry Pi](https://discourse.nodered.org/t/influxdb-on-a-raspberry-pi/742):
>
> This is not strictly Node-Red related but I know that several people here are using InfluxDB on a Raspberry Pi in conjunction with Grafana to store data created/extracted by Node-Red. I discovered accidentally that InfuxDB was using a very high amount of CPU time and after a bit of searching I found that this is due to InfluxDB's internal monitoring function. This is used for diagnosis of internal errors and can safely be turned off by changing an entry in: /etc/influxdb/influxdb.conf Simply…

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [10 March 2019 10:52 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/6 "2019-03-10T10:52:47Z")

</div>

> [@drmibell](#):
>
> I may be wrong, but I've been interpreting the `vcgencmd` results a bit differently. As I understand it, the least-significant digit (bits 0-3) represents the current state, and the most-significant digit (bits 16-19) represents past occurrences

Yes, having read into vcgencmd some more... I'm pretty sure you are correct.

> [@TotallyInformation](#):
>
> $ vcgencmd measure\_temp temp=37.6'C

I wish my Pi was running that cool!!

```auto
pi@raspberrypi:~ $ vcgencmd measure_temp
temp=50.5'C

```

As Colin commented above, it would be good to role this up into a node, to provide the status in a 'easy to digest' format. I just wonder how many users are running node-RED on a Pi which is continually throttled....

Should I move this thread from the Lounge to general discussion?

---

<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:** [10 March 2019 13:29 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/7 "2019-03-10T13:29:34Z")

</div>

> [@drmibell](#):
>
> interpreting the `vcgencmd` results a bit differently

Cool, nice spot - thanks. I thought it was a bit strange. \<40°C seems like nothing. My Pi2 is running at 35.8°C. Of course, they are both running in a loft space right now so not surprising they are a lot cooler than many people's. Also, the Pi3 doesn't even have a case on it and the Pi2 has a case with no top. 😄

> [@ghayne](#):
>
> This may help with that:

Ah, thanks Garry, I'd forgotten about that. Actually, on the Pi3, it really isn't a problem. On the Pi2 which also runs InfluxDB - and actually with a lot more data going to it as it is my old live system, I see an occasional spike to 100% but generally it goes to about 30% every few seconds and about 50% every minute or so.

Here is my 7day load stats for the Pi2:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/44dea1243ba52f3aaa07cb6ec73facb98f02b2be.png)

So not too bad despite running so much. Also, my InfluxDB instance on the Pi2 has quite a lot of historic data and that tends to increase the CPU spikes - presumably as it averages my detail data down to the hourly data I keep - that currently goes back to April 2016. How cool is that for such a tiny computer, 438MB of data. 🕶

> [@Paul-Reed](#):
>
> it would be good to role this up into a node, to provide the status in a 'easy to digest' format

Not a bad idea if you have time.

> [@Paul-Reed](#):
>
> I just wonder how many users are running node-RED on a Pi which is continually throttled....

Yes, it would be an interesting question. As would - how many people are running Node-RED on a Pi?

> [@Paul-Reed](#):
>
> Should I move this thread from the Lounge to general discussion?

Seems like this is a useful discussion.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [10 March 2019 16:17 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/8 "2019-03-10T16:17:51Z")

</div>

> [@TotallyInformation](#):
>
> Not a bad idea if you have time.

It's above my skill level, but perhaps it piques someone's interest.

---

<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:** [10 March 2019 18:40 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/9 "2019-03-10T18:40:52Z")

</div>

Hi Paul (@Paul-Reed),

Do you think this might fit into my **node-red-contrib-cpu** node, which can also be used currently to display the [CPU temperature](https://www.npmjs.com/package/node-red-contrib-cpu#single-output-message-with-core-temperatures). If so, please be my guest to describe what could be added to this node to fit the needs ...

Bart

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 March 2019 19:15 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/10 "2019-03-10T19:15:49Z")

</div>

depends... I think this voltage thing is fairly Pi specific. If your node is already Pi only then yes... If not then maybe not so obvious. There are a load of other Pi vcgencmd commands that could be investigated (but hopefully not all exposed - let's stick to the basics please !) - see  
[https://elinux.org/RPI\_vcgencmd\_usage](https://elinux.org/RPI_vcgencmd_usage)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [10 March 2019 19:38 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/11 "2019-03-10T19:38:25Z")

</div>

That would be great Bart.

`vcgencmd get_throttled` returns a bit pattern, which indicates whether throttled or not, and the reason why. The resulting bit pattern is;

| Bit | Meaning |
| --- | --- |
| 0 | Under-voltage detected |
| 1 | Arm frequency capped |
| 2 | Currently throttled |
| 3 | Soft temperature limit active |
| 16 | Under-voltage has occurred |
| 17 | Arm frequency capped has occurred |
| 18 | Throttling has occurred |
| 19 | Soft temperature limit has occurred |

`vcgencmd measure_clock arm` & `vcgencmd measure_clock core` would be handy, as would `vcgencmd get_mem arm` & `vcgencmd get_mem gpu` but it's easy to get carried away - as deecjay has pointed out.

Paul

---

<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:** [10 March 2019 20:01 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/12 "2019-03-10T20:01:58Z")

</div>

> [@dceejay](#):
>
> I think this voltage thing is fairly Pi specific

Seems indeed the **vcgencmd** is Raspberry specifc, and other devices with Broadcom VideoCore processors. So I agree we should put this stuff in a separate node. Read somewhere that **vcgencmd** stands for " **V** ideo **C** ore **gen** eral **c** om **m** an **d**". Should we call it **node-red-contrib-videocom**?

> [@Paul-Reed](#):
>
> The resulting bit pattern is

How should the output look like: an array of **booleans** in the payload? E.g.

```auto
{
    "payload": {
        "under_voltage_detected" : true,
        "arm_frequency_capped" : true,
        "currently_throttled" : true,
        "soft_temperature_limit_active" : true,
        "under_voltage_occurred" : true,
        "arm_frequency_capped_occurred" : true,
        "throttling_occurred" : true,
        "soft_temperature_limit_occurred" : true
    }
}

```

Or should it be separate messages with their own topic? E.g.

```auto
{
    "payload": true,
    "topic": "under_voltage_detected"
}

```

> [@Paul-Reed](#):
>
> but it's easy to get carried away - as deecjay has pointed out.

Indeed ...

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [10 March 2019 20:33 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/13 "2019-03-10T20:33:35Z")

</div>

> [@BartButenaers](#):
>
> Read somewhere that **vcgencmd** stands for " **V** ideo **C** ore **gen** eral **c** om **m** an **d**". Should we call it **node-red-contrib-videocom**?

No. I doubt most pi users know what the command stands for, so would have no reason to recognise videocom as something relevant to them.

What's wrong with `node-red-contrib-vcgencmd` if it really does have to be a separate module... no harm including a pi specific node in your existing cpu module and only enabling it when running on a suitable platform.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 March 2019 20:56 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/14 "2019-03-10T20:56:32Z")

</div>

Or `node-red-contrib-pi-vcgencmd` so it’s obvious it’s for a pi

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [10 March 2019 20:57 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/15 "2019-03-10T20:57:00Z")

</div>

> [@knolleary](#):
>
> What's wrong with `node-red-contrib-vcgencmd`

Gets my vote.

> [@BartButenaers](#):
>
> How should the output look like: an array of **booleans** in the payload.... or should it be separate messages with their own topic?

Both options seem equally usable, I've no preference. But maybe separate messages with their own topic would be easier for users to use.

Paul

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [10 March 2019 21:09 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/16 "2019-03-10T21:09:50Z")

</div>

> [@Paul-Reed](#):
>
> separate messages with their own topic would be easier for users to use.

+1 for that!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 March 2019 21:59 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/17 "2019-03-10T21:59:26Z")

</div>

> [@Paul-Reed](#):
>
> maybe separate messages with their own topic would be easier for users to use

Will it be necessary to feed in a message asking for whichever is required then?

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [10 March 2019 22:13 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/18 "2019-03-10T22:13:04Z")

</div>

> [@Colin](#):
>
> Will it be necessary to feed in a message asking for whichever is required then?

I wouldn't have thought so, users will select whichever topic they wish from the node output, and disregard the rest.  
But hey, not my suggestion, Bart asked the question.  
Do you have a preference?

---

<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:** [10 March 2019 22:21 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/19 "2019-03-10T22:21:25Z")

</div>

Sometimes I add a checkbox "_Separate output messages per topic_" or something like that. Then you can use it as you like ...

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [10 March 2019 22:30 UTC](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791/20 "2019-03-10T22:30:22Z")

</div>

> [@BartButenaers](#):
>
> checkbox " _Separate output messages per topic_ "

I agree, for those who want it. Personally, I think it's more natural for a bunch of dashboard or `debug` nodes to display properties like `msg.get_throttled.under_voltage_detected` or `msg.get_measure_temp`.

[Next page](https://discourse.nodered.org/t/ras-pi-supply-voltage/8791.md?page=2)
