My personal adventures in the quest for virtual perfectness.
Yesterday I tweeted a picture showing off my Raspberry Pi with bi coloured LEDs (Red and Green). I've always wanted something to put on my desk, with LEDs, checking vCenters and/or ESX(i) hosts. After experimenting with the Arduino, I knew this system would be a stand alone application (requiring something like an external VM, doing the checks, sending the Arduino the status). I wanted a standalone device, as small like the Arduino, capable of checks against vCenter. As you all know, the Raspberry Pi is suitable for that task.
While having my thoughts run freely, I knew I wanted something:
- that would be small (small enough to fit inside a stock case);
- have like 16 Red/Green leds (so that makes 32 outputs);
- flexible programming;
- some buttons for input;
- easy to create while keeping costs low.
I've used a stock Raspberry Pi, a clear case from RS, 16 Red/Green common cathode LEDs, 4 74HC595 shift registers, 2 tumbler switches with jumpback (acting as a button), 32 220 ohms resistors, wire, 2 10k pull down resistors for the switches. That's just over 10 euro's of extra hardware, beside the Pi, case, SD card and power supply.
Programming was done in Python. There is an API for vSphere, called pyshere. I used wiringpi for python as it was an easy to 'translate' from Arduino to Raspberry Pi GPIO. I'm only using 3 pins controlling the 74HC595 shift registers. There is an *excellent* tutorial you can find here. You can find my script here. Please note I've just starting to learn Python for this project (never programmed Python before). Though syntax is quite easy, not everything is done in a 'Pythonic' way. I'll extend and improve the script in the future. So stay tuned (and tell me your improvements!).
Please check this video to see it in action.
I've got wild ideas extending the script checking servers using protocols like 'ping', 'ldap', 'mysql', 'mssql'. But also showing like the load of an host or VM (CPU load on top row, Memory load on bottom row).
Also, the current running through the shift registers is a bit too high. They seem to hold up pretty well until now (I've done a one week burn in test lighting all leds, both red and green at the same time). But if they burn out, they are easy to replace. I am looking into using RGB common anode LEDs, using the TI TLC5940 Led driver. However, this would drive the total price of the board much higher. I'm also developing a PCB, see if I can sell this thing as a shield for the Pi. Let me know if you are interested.
If you like this project, be sure to check out Richard Garsthagen his "Alarm Box". Using both Arduino and Raspberry Pi in a awesome case showing load, just brilliant!
may tutorial, so I can make it...thank you