alwye / get_throttled Goto Github PK
View Code? Open in Web Editor NEWHuman-readable vcgencmd get_throttled
License: MIT License
Human-readable vcgencmd get_throttled
License: MIT License
When I run this program on my Pi (3B) with Raspberry Pi OS (Debian GNU/Linux 11 \n \l
) the output of './get_throttled.sh' is
Current issues:
~ Under-voltage detected
~ Arm frequency capped
~ Currently throttled
~ Soft temperature limit active
Previously detected issues:
No throttling issues detected.
But the output of 'vcgencmd get_throttled' is
throttled=0x0
I corrected this by changing line 41 from:
if [ "$CURRENT_HEX" == "0" ]; then
with
if [ "$CURRENT_HEX" == "0" ] || [ -z $CURRENT_HEX ]; then
bit_n=0
for (( i=${#CURRENT_BIN}-1; i>=0; i--)); do
if [ "${CURRENT_BIN:$i:1}" = "1" ]; then
echo "~ ${ISSUES_MAP[$bit_n]}"
bit_n=$((bit_n+1))
fi
bit_n only gets incremented on a bit being 1, so the first bit (no matter where it is) will always report ISSUES_MAP[0] "under-voltage", the second bit set will report ISSUES_MAP[1] "Arm frequency capped", etc.
bit_n should be incremented unconditionally to give the correct decode.
(From https://forums.raspberrypi.com/viewtopic.php?t=347970 where a user was complaining that his Pi was always reporting under-voltage)
I was testing this out and I think you might have the bit order backwards.
I have my RPi 4b on a 15w (5v*3A) charger and when it hits 80C, it returns 8, which is matching up as 'Undervoltage', and I'm pretty sure that should be 'Soft Limit'. Also, at 85C it returns 6 which is 0110, so 'Frequency' and 'Throttle'
I think it should be reading the other way. Probably easiest would be to just renumber them:
[0]="Soft temperature limit active"
[1]="Currently throttled"
[2]="Arm frequency capped"
[3]="Under-voltage detected"
and probably the same for the past_bits, but I haven't verified that yet. Probably, though, after using it for a while it's returning 'e', so 1110. If it's backwards that would be everything except 'Undervoltage'
could give you a PR if you like
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.