Configuring LED Indicators on Orange Pi Zero 3
Configuring LED Indicators on Orange Pi Zero 3
There are two indicators on the Orange Pi Zero 3: a red and a green LED. They are quite bright. While the red indicator only blinks occasionally, the green one stays on constantly after Linux boots. This doesn’t suit me, so I decided to find a way how to configure them.
The first thing to do is check the available triggers and determine which one is active. This can be done using the following commands (shoulbe be executed as root):
# cat /sys/class/leds/red:status/trigger
none usb-gadget usb-host 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 disk-activity disk-read disk-write mtd nand-disk [heartbeat] cpu cpu0 cpu1 cpu2 cpu3 activity default-on panic mmc0 mmc1 rfkill-any rfkill-none rfkill0 stmmac-0:01:link stmmac-0:01:1Gbps stmmac-0:01:100Mbps stmmac-0:01:10Mbps rfkill1 bluetooth-power hci0-power rfkill2
# cat /sys/class/leds/green:power/trigger
none usb-gadget usb-host 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 disk-activity disk-read disk-write mtd nand-disk heartbeat cpu cpu0 cpu1 cpu2 cpu3 activity [default-on] panic mmc0 mmc1 rfkill-any rfkill-none rfkill0 stmmac-0:01:link stmmac-0:01:1Gbps stmmac-0:01:100Mbps stmmac-0:01:10Mbps rfkill1 bluetooth-power hci0-power rfkill2
The current trigger is enclosed in square brackets […]. For the green LED, the “default-on” condition is selected, meaning it will always stay on.
To change the condition, you need to write the desired trigger name into the same file. For example, if I want the green LED to blink only when accessing the MicroSD card:
# echo “mmc0” > /sys/class/leds/green:power/trigger
Depending on the distribution, there are different ways to set this command to run at system startup. I am using Armbian, and it seems to automatically remember the state and restore it after reboot. Therefore, there was no need to add this command manually.
Comments
Post a Comment