Giter Site home page Giter Site logo

get_throttled's People

Contributors

aiminickwong avatar alwye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

get_throttled's Issues

The program reports throttling issues on 0x0

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 is currently only incremented when a bit is set

  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)

possible backwards?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.