Please Note: If you have not updated your kernel version using Buildroot, then the following may not work.
The NGW100 uses the sysfs interface to control the on-board LEDs. The interface is located in the following directory:
/sys/class/leds
If you run ls for the above directory you should get the list of the following files and folders:
/sys/class/leds/sys # ls
brightness device power subsystem trigger uevent
We are mostly interested in the brightness and trigger files. The brightness enables you to either switch on an LED or switch it off (We know that in a computer that a binary 1 means on and a binary 0 means off), which can be done in the following manner:
echo 1 > /sys/class/leds/a/brightness
echo 0 > /sys/class/leds/a/brightness
Now onto more usefull applications for the LEDs. We can set the LEDs to be triggered upon system events. For this we are interested in the trigger file. Lets see what the trigger file contains:
/sys/class/leds/sys # cat trigger
none mmc0 timer [heartbeat] default-on
In the above output we know that the trigger is currently set to heartbeat since it is enclosed in square brackets. We can easily change this to the SD card slot, that way we have an SD activity LED, using the following code:
echo "mmc0" > /sys/class/leds/a/trigger
In the above example we changed the LED labeled A on the NGW100 to be triggered by activity on the SD card.
Hi, cool site, good writing
[Reply]