RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Runcommand warning if voltage/temperature throttling

    Scheduled Pinned Locked Moved Ideas and Development
    feature requestidearuncommandvoltagetemperature
    3 Posts 3 Posters 5.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dankcushionsD
      dankcushions Global Moderator
      last edited by

      dumping an idea that has been sat on my list for ages that i'm not sure is worth implementing :)

      the coloured symbols that appear when your pi is throttling due to temperature or voltage issues are ambiguous at best, ignored at worst :) it's possible to get make system enquiries on any throttling happening:

      $ vcgencmd get_throttled
      throttled=0x50005
      

      the bits in this number represent:

      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
      

      for more details see: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=147781&start=50#p972790

      i thought: we could add a check in the runcommand to see if there's any throttling at run-time, and give a proper warning. this won't catch every occurrence, as sometimes the warnings only come when the system is under heavier load (ie, midway through running a game), but maybe it's useful in some situations? has anyone got any experience with undervoltage? is the symbol there more-or-less constantly?

      btw, this might become redundant if the squares get replaced with something more obvious. see https://github.com/raspberrypi/firmware/issues/367

      R 1 Reply Last reply Reply Quote 1
      • R
        RetroResolution @dankcushions
        last edited by

        @dankcushions sounds like it could be useful - always glad to learn a new vcgencmd option too

        If a post has helped you, please encourage the author by up-voting via the ^ icon located in the bottom-right corner.

        RetroResolution.com - Adventures in retro gaming on original hardware and via emulation with RetroPie on the Raspberry Pi.

        1 Reply Last reply Reply Quote 0
        • C
          Charlie_G
          last edited by

          I know this is an old thread, but I'm replying here because it's the first "open" result on a related Google search.
          I wrote a quick script that I'd like to share for quickly parsing the above into a user-readable format

          Sample output:

          Status: 0x50005
          Undervolted:
             Now: YES
             Run: YES
          Throttled:
             Now: YES
             Run: YES
          Frequency Capped:
             Now: NO
             Run: NO
          

          Script:

          #!/bin/bash
          
          #Flag Bits
          UNDERVOLTED=0x1
          CAPPED=0x2
          THROTTLED=0x4
          HAS_UNDERVOLTED=0x10000
          HAS_CAPPED=0x20000
          HAS_THROTTLED=0x40000
          
          #Text Colors
          GREEN=`tput setaf 2`
          RED=`tput setaf 1`
          NC=`tput sgr0`
          
          #Output Strings
          GOOD="${GREEN}NO${NC}"
          BAD="${RED}YES${NC}"
          
          #Get Status, extract hex
          STATUS=$(vcgencmd get_throttled)
          STATUS=${STATUS#*=}
          
          echo -n "Status: "
          (($STATUS!=0)) && echo "${RED}${STATUS}${NC}" || echo "${GREEN}${STATUS}${NC}"
          
          echo "Undervolted:"
          echo -n "   Now: "
          ((($STATUS&UNDERVOLTED)!=0)) && echo "${BAD}" || echo "${GOOD}"
          echo -n "   Run: "
          ((($STATUS&HAS_UNDERVOLTED)!=0)) && echo "${BAD}" || echo "${GOOD}"
          
          echo "Throttled:"
          echo -n "   Now: "
          ((($STATUS&THROTTLED)!=0)) && echo "${BAD}" || echo "${GOOD}"
          echo -n "   Run: "
          ((($STATUS&HAS_THROTTLED)!=0)) && echo "${BAD}" || echo "${GOOD}"
          
          echo "Frequency Capped:"
          echo -n "   Now: "
          ((($STATUS&CAPPED)!=0)) && echo "${BAD}" || echo "${GOOD}"
          echo -n "   Run: "
          ((($STATUS&HAS_CAPPED)!=0)) && echo "${BAD}" || echo "${GOOD}"
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.