First, one of these days I'm going to get around to writing a success story but in a nutshell my Sheevaplug has completely replaced a desktop computer that used to run Ubuntu and served as a multipurpose server, in the process saving us a lot of electricity, noise, and heat. My wife's happy that the old computer is gone and I'm happy that I still have a machine running all the time.
I'm running Debian Squeeze, installed as per the very excellent instructions on the
www.cyrius.com Web site. I've read up on controlling the SheevaPlug LED's in these forums, in the wiki, and everywhere I can find on the Internet, and it seems so straightforward. Everyone manages to control them using the "trigger" file in /sys/devices/platform/leds-gpio/leds/plug:green:health or the alternate symlinked location of /sys/class/leds/plug:green:health. This is what happens when I try:
john@shiva:~$ cd /sys/class/leds/plug\:green\:health
john@shiva:/sys/class/leds/plug:green:health$ ls -l
total 0
-rw-r--r-- 1 root root 4096 Dec 1 17:04 brightness
lrwxrwxrwx 1 root root 0 Dec 1 17:04 device -> ../../../leds-gpio
-r--r--r-- 1 root root 4096 Dec 1 17:01 max_brightness
drwxr-xr-x 2 root root 0 Dec 1 17:04 power
lrwxrwxrwx 1 root root 0 Dec 1 17:00 subsystem -> ../../../../../class/leds
-rw-r--r-- 1 root root 4096 Dec 1 17:04 trigger
-rw-r--r-- 1 root root 4096 Dec 1 17:00 uevent
john@shiva:/sys/class/leds/plug:green:health$ cat trigger
none nand-disk timer [default-on] mmc0
john@shiva:/sys/class/leds/plug:green:health$ sudo echo "none" > trigger
-bash: trigger: Permission denied
john@shiva:/sys/class/leds/plug:green:health$ sudo ls
[sudo] password for john:
brightness device max_brightness power subsystem trigger uevent
john@shiva:/sys/class/leds/plug:green:health$ sudo echo "none" > trigger
-bash: trigger: Permission denied
I should note that for security reasons I have the root account disabled, using root via sudo. There is a very interesting clue therein: I am not even prompted for my password before getting the "permission denied" message. That's why, in the code section above, I put in the "sudo ls": so you can see that I was prompted for my password by "sudo ls" but not by the sudo echo command.
I just did a full system update (apt-get update;apt-get upgrade) and reboot and the problem is still happening. uname -a reports:
john@shiva:~$ uname -a
Linux shiva 2.6.32-5-kirkwood #1 Fri Nov 26 07:01:06 UTC 2010 armv5tel GNU/Linux
Incidentally, the intended use here is to tell me when it's okay to unplug my mp3 player after updating the podcasts on it. I have a udev script that watches for the mp3 player to be plugged in, then launches a Python script to update the podcasts in the background. The heavy lifting is done by hpodder, which is called by the Python script; the Python script just deletes and copies files. Without the LED control, I have to either power up a laptop to check if the script completed, or wait 15 minutes so that I can be sure the script is done. I thought the LED control would have been the easiest part of this application but unfortunately not :-(
Thanks in advance for any help you may be able to provide.
John K.