Monday, December 23, 2013

PogoPlug E02 - configure LEDs

Make the following modifications to turn the front LED green when the boot process is completed and turn the LED off when it's save to unplug the PogoPlug.

1. Install a kernel with LED support onto the PogoPlug. 
Instructions here: Linux Kernel 3.12.0 Kirkwood package ...
I installed Kernel 3.12.0, which is the latest at the moment.

2. edit /etc/rc.local
add these lines:
echo none > sys/class/leds/status\:orange\:fault/trigger
echo default-on > sys/class/leds/status\:green\:health/trigger
* this will turn off the orange LED and turn on the green LED

2a. to show network traffic by blinking the orange LED:
#Set up orange LED to blink on incoming TCP traffic iptables -A INPUT -p tcp -j LED --led-trigger-id tcpin --led-delay 100 echo netfilter-tcpin > /sys/class/leds/status\:orange\:fault/trigger
 
(Note: might have to install iptables with apt-get install iptables)

3. edit /etc/init.d/halt
add this line BEFORE "halt -d -f $netdown ...":
echo none > sys/class/leds/status\:green\:health/trigger

(Note: in the instructions here it says to add the line AFTER the "halt" line but that did not work for me. It seems execution stops at the "halt" line an dsubsequent code is not executed.)

(Note2: if you see an LED called "status:blue:health" in /sys/class/leds then your PogoPlug is not properly recognized and the machine is running as a SheevaPlug. You might need to set the environment:
fw_setenv machid dd6

details are here.


No comments: