View: 9785|Reply: 6

Monitor Cpu Load and Temperature with the two built in LEDS

[Copy link]

2

threads

6

posts

36

credits

Novice

Rank: 1

credits
36
Published in 2015-11-12 17:20:32 | Show all floors |Read mode
Hi All,

I have written a little daemon to make the Orange Pi Pc onboard led's more useful.

Most likely it will run on the other H3 boards as well.

See my description from github.
leddaemon
Use the Orange Pi PC onboard LED's to monitor system load and cpu temperature.
The red one lights up when the load exceeds 1.
The green one will blink when the temperature exceeds 60 degrees.
Of course these defaults can be changed in the script.
Multi threaded and deamonizing python script.

Get it here

https://github.com/bkram/orangepipc/

or direct download

https://raw.githubusercontent.com/bkram/orangepipc/master/leddaemon/leddaemon.py

User feedback is appreciated.


11

threads

286

posts

1934

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
1934
Published in 2015-11-13 01:59:41 from mobile | Show all floors
Cool thing,thank you

2

threads

6

posts

36

credits

Novice

Rank: 1

credits
36
 Author| Published in 2015-11-18 16:26:30 | Show all floors
Hi All,

Small update available will now check if  it is run as root, which is required in order to manipulate the sysfs files.

User feedback or feature requests are welcomed.
Published in 2015-11-18 17:25:53 | Show all floors
retroman replied at 2015-11-18 16:26
User feedback or feature requests are welcomed.

Average load might not be related to 'Cpu Load' at all. You would've to periodically query /proc/stat instead to get an idea what's happening on the CPU cores, compare with post 16 here for example: http://forum.armbian.com/index.p ... rpi-monitor/?p=1127

On a SBC with both slow SD-card and inefficient storage settings (low commit interval, continually trying to write stuff to /var/log or /tmp) you will end up with an average load that's most of the time above 1 or even more while the CPUs doing nothing.
Published in 2015-11-18 20:50:07 | Show all floors
And can you please provide the output of
  1. ls /sys/class/gpio_sw/normal_led/
Copy code
Published in 2015-11-28 03:47:01 | Show all floors
bronco replied at 2015-11-18 20:50
And can you please provide the output of

Thx a bunch. Now that I've my own OPi PC I was able to have a look myself. Unfortunately the LED driver for H3 is rather limited or let's better say non-existent (which is understandable since Allwinner's driver normally uses the PMU's capabilities to provide informations through LEDs which is obviously not possible with H3 since this beast has no PMU).

I discovered that some of the tricks we found for A20 devices last year also work with the H3. In case you install the sysstat package then all you need to get USB disk activity on a LED is adding
  1. /usr/bin/iostat -z -d 1 sda | sed -u -e '1d' -e 's/Device.*/0/' -e 's/sd.*/1/' -e '/^$/d' >/sys/class/gpio_sw/normal_led/data &
Copy code
to /etc/rc.local, and/or for the green LED showing SD-card activity:
  1. /usr/bin/iostat -z -d 1 mmcblk0 | sed -u -e '1d' -e 's/Device.*/0/' -e 's/mmc.*/1/' -e '/^$/d' >/sys/class/gpio_sw/standby_led/data &
Copy code


0

threads

4

posts

56

credits

Registered member

Rank: 2

credits
56
Published in 2022-1-25 13:10:42 | Show all floors
Twitch is a popular broadcasting service to stream virtually all favorite shows or events online. Is your twitch activate not working? Activating Twitch TV on devices like Android TV, Roku, or Amazon Firestick requires a Twitch activation code. https://www.techrulz.com/fix-twitch-tv-activate-not-working/
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list