27 de Janeiro, 2019

Armbian: Get Your LEDs Under Control!

ARM, Debian, Informática, Open-Source, Single Board Computer

Armbian: Get Your LEDs Under Control!

27 de Janeiro, 2019 | ARM, Debian, Informática, Open-Source, Single Board Computer

Contrary to popular belief flashing LEDs in your computer/SBC don’t make it faster – truth be told, every electronic component draws some power and dissipates heat witch might actually even make your system slower.

Now with Armbian is easy to turn on, off or change the behaviour of your SBC LEDs:

root@nanopineo2:~# ls /sys/class/leds
nanopi:blue:status nanopi:green:pwr

As you can see we’ve got two LEDs on the Nano Pi Neo 2, a blue and a green one. You can check its current status and available options with cat:

root@nanopineo2:~# cat /sys/class/leds/nanopi\:blue\:status/trigger
none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock usbport usb-gadget usb-host disk-activity disk-read disk-write ide-disk mtd nand-disk [heartbeat] cpu cpu0 cpu1 cpu2 cpu3 default-on panic mmc0 0.2:07:link 0.2:07:1Gbps 0.2:07:100Mbps 0.2:07:10Mbps

Just note brackets around [heartbeat], this means that the blue LED is set to blink on the system heartbeat. You may set it to any of the other options, for instance to have it always on:

echo "default-on" > /sys/class/leds/nanopi\:blue\:status/trigger

Or, to turn off the LED:

echo "none" > /sys/class/leds/nanopi\:blue\:status/trigger

Important Note: changes to this settings won’t survive a reboot unless you add them to your /etc/rc.local file (before exit 0).