6 Replies Latest reply on Oct 7, 2019 5:16 AM by mudz

    Reading BeagleBone AI Temperatures

    gdstew

      I finally brought up my BeagleBone AI with a 25mm x 7mm fan firmly screwed into the heat sink using M2 or

      M3 (they were salvaged so I don't know for sure) machine screws. It was a lot quieter than I was expecting

      although I don't believe it is running at the advertised 10K RPM. Attempting to update the software with

      apt-get upgrade (after doing apt-get update) died with the message "FATAL -> failed to fork" which turned out

      to be a low memory problem. The Getting Started program from the desktop was running the cloud9 IDE in

      the Chromium browser so I shut that down and did the upgrade again and it worked. I had no problems with

      any of the other updates after that.

       

      The next thing I did was go look for where the SoC temperatures could be read and I think I found them several

      sub-directories deep in the /sys directory. I do wish that there was a standard directory to put these in as

      everybody puts them in very different places in the /sys directory. There are 5 different thermal zones and

      each one has a directory in the /sys/devices/virtual/thermal/ directory named thermal_zone0 -  thermal_zone4.

      To display the temperature for thermal zone 0 use this command:

       

      debian@beaglebone:~$ cat /sys/devices/virtual/thermal/thermal_zone0/temp

      47000

      debian@beaglebone:~$

       

      The response, 47000 (your mileages WILL vary) is 47.0 deg. C.

       

      At the time the AI was mostly idle with me on a terminal inside an LXDE window. The temperatures I was

      reading were within a couple of degrees C across all the zones. There are many thermal management

      configuration files in the thermal_zoneX directories and it would be great to get documentation on what/where

      the thermal zones are as well as the thermal management settings used for them.

       

      While the idle temperatures were OK for checking out and doing light work on the AI I'm going to have to

      come up with some serious thermal solutions. A 40mm fan is the biggest you can get between the GPIO

      headers and I don't know if that will be big enough when you start loading up several of the more interesting

      cores.

        • Re: Reading BeagleBone AI Temperatures
          14rhb

          Thanks gdstew

           

          This is just the information I'll need soon. In a few days I'm expecting my USB-C cable and then I'll be powering up my BB-AI for the first time - having followed the various threads I'm keen to watch the temperatures.

          • Re: Reading BeagleBone AI Temperatures
            clem57

            Attempting to update the software with

            apt-get upgrade (after doing apt-get update) died with the message "FATAL -> failed to fork" which turned out

            to be a low memory problem.

            I too have noticed this. I think they got over zealous using TEMP in RAM... I plan to dial it back some. Also add external storage. The 16 G eMMC is a bit small. I will blog the results of tuning this over the weekend.

            1 of 1 people found this helpful
            • Re: Reading BeagleBone AI Temperatures
              14rhb

              I would have imagined all these BB-AI were the same, however very cautiously I too ran the sudo apt update and upgrade from the Loud9 IDE and it did work. No errors!

               

              I'm connected via Ethernet from a router/switch and connecting in via the Cloud9 web server from Mozilla Firefox.

              2 of 2 people found this helpful
              • Re: Reading BeagleBone AI Temperatures
                gdstew

                I just attached a bash shell script I wrote to read one or all temperature zones on a BeagleBone AI. There is a bin directory in the debian users home

                directory directory and I copied the script from a micro sd card to /home/debian/bin. The home/bin directory is not in the environment PATH variable

                so either have to add it to PATH, include the path with the file name when you execute it, or copy it somewhere already in PATH. I chose to copy it to

                /usr/local/bin using the command:

                 

                  debian@beaglebone:~$ sudo cp bin/ai_temp.sh /usr/local/bin

                 

                In order for the debian user to execute the script the file permissions have to be changed to allow it with the command:

                 

                   debian@beaglebone:~$ sudo chmod o+x /usr/local/bin/ai_temp.sh

                 

                After that:

                 

                To see all temperature zones type ai_temp.sh from the command line,

                 

                To see a specific zone temperature type ai_temp.sh X where X is the zone number from 0 - 4. If you type in an invalid zone number you will get an

                error message.

                 

                This script does use bash specific commands, specifically the ones used to extract characters from the temperature returned by the cat command.

                It also makes a couple of assumptions about the number of digits in the temperature. The first is that there are no more that two digits to the left of

                the decimal point. This is probably a safe assumption since the script will probably not be running if the AI temperature is > 99 deg. C. The second is

                that there there are two digits to the left of the decimal point. This is a reasonable assumption because the AI is not going below 10 deg. C unless

                some type of extreme cooling is used.

                 

                From testing the script it looks like zone 2 is the dual core ARM Cortex-A15. It is always the highest temperature by around 2 degrees C.

                3 of 3 people found this helpful