Ras Pi supply voltage

I've just contributed to Best / most stable OS and Hardware for NodeRed? 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;

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

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

For the Pi3:

$ 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

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

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

3 Likes

This may help with that:

1 Like

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

I wish my Pi was running that cool!!

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?

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

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:

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

Not a bad idea if you have time.

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

Seems like this is a useful discussion.

1 Like

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

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. If so, please be my guest to describe what could be added to this node to fit the needs ...

Bart

1 Like

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

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

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 "VideoCore general command". Should we call it node-red-contrib-videocom?

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

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

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

Indeed ...

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.

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

3 Likes

Gets my vote.

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

+1 for that!

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?

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

1 Like

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.