CPU load monitoring using GPIO and leds


9 posts
by chteuchteu » Fri Oct 26, 2012 7:32 am
Hello !
I wrote today an article on my blog about CPU load monitoring (using GPIO and leds) on Raspberry's. It is really simple (written in a little shell script), but I think it can be useful (for people who want to learn leds stuff on their R. Pi)

There are 5 leds turning on and off regarding the CPU load:
- CPU < 20%: 1 led
- CPU < 40%: 2 leds
- CPU < 60%: 3 leds
- CPU < 80%: 4 leds
- CPU < 90%: 5/5 leds
- CPU >= 90%: 5 leds flashing

Here is the article: it is written in French, but you can just watch the Youtube video and download the code at the bottom of the article.
http://www.chteuchteu.com/2012/10/26/raspberry-pi-monitoring-de-lutilisation-cpu-grace-au-gpio/

If you find any errors in the code, you can post a comment on the article. Thanks ! :)
Articles à propos du Raspberry Pi sur mon blog: http://www.chteuchteu.com/tag/raspberry-pi/
Posts: 22
Joined: Mon Oct 08, 2012 11:38 am
by chteuchteu » Mon Oct 29, 2012 11:54 am
Up :)
Any code enhancements ?
Articles à propos du Raspberry Pi sur mon blog: http://www.chteuchteu.com/tag/raspberry-pi/
Posts: 22
Joined: Mon Oct 08, 2012 11:38 am
by bgirardot » Fri Nov 02, 2012 2:20 pm
My only comment is: Thank you very much, I found the code to be educational. I like doing things from shell scripts and found your approach far superior to my current approach.
Posts: 517
Joined: Wed Oct 10, 2012 6:20 am
Location: Switzerland
by chteuchteu » Mon Nov 05, 2012 8:02 am
bgirardot wrote:My only comment is: Thank you very much, I found the code to be educational. I like doing things from shell scripts and found your approach far superior to my current approach.


Thank you ! :)

The article is now available in english ! (comments are also in english):
http://www.chteuchteu.com/2012/11/05/raspberry-pi-cpu-usage-monitoring-using-gpio/
Articles à propos du Raspberry Pi sur mon blog: http://www.chteuchteu.com/tag/raspberry-pi/
Posts: 22
Joined: Mon Oct 08, 2012 11:38 am
by jagoda » Mon Nov 05, 2012 8:43 am
Thank you for your article ...
I will try and incorporate it and expand on it in the various RaspberryPi workshops and courses I am
involved in developing
(http://ftt/co.uk)
(http://www.absolutebeginners.uk.com)
Posts: 40
Joined: Fri Nov 02, 2012 8:46 am
by chteuchteu » Wed Mar 06, 2013 7:05 pm
Thanks ! :D
Articles à propos du Raspberry Pi sur mon blog: http://www.chteuchteu.com/tag/raspberry-pi/
Posts: 22
Joined: Mon Oct 08, 2012 11:38 am
by gridrun » Fri Mar 08, 2013 9:22 pm
Yeah! Blinkenlights! :D Reminds me of the BeBox, pretty cool.
Find more info on Raspberry Pi, Virtualization and all things cloudy on my blog: http://niston.wordpress.com
Posts: 38
Joined: Mon Feb 18, 2013 12:26 pm
by MattHawkinsUK » Fri Mar 08, 2013 10:50 pm
The script is great. I'm modifying it to work with my BerryClip 6 LED board.

One thing I noticed is that the script does not flash the LEDs. The function is defined to flash the LEDs but it is not referred to in the script.
My Raspberry Pi blog and home of the BerryClip Add-on board : http://www.raspberrypi-spy.co.uk/
Follow me on Google+, Facebook and Twitter (@RPiSpy)
User avatar
Posts: 455
Joined: Tue Jan 10, 2012 8:48 pm
Location: UK
by chteuchteu » Sat Mar 09, 2013 10:36 am
Thanks for the reply ! :)
Yes indeed. It is a function I written but I'm not really using it in the main part of the script: I left it in the code in case of someone would use it :)
Articles à propos du Raspberry Pi sur mon blog: http://www.chteuchteu.com/tag/raspberry-pi/
Posts: 22
Joined: Mon Oct 08, 2012 11:38 am