This is an old revision of the document!

How to Control Blue Status LED

We can control the blue LED with editing the trigger mode in sysfs.

The red LED is hard-wired to the power input rail so that cannot be changed.

Simply you can turn on/off that with putting an option using echo command.

Do echo none to turn off.

root@odroid:~# echo none > /sys/class/leds/blue\:heartbeat/trigger

Do echo MODE to turn on with MODE.

# Turn on that solidly.
root@odroid:~# echo default-on > /sys/class/leds/blue\:heartbeat/trigger
# Heartbeat mode. This is the original state.
root@odroid:~# echo heartbeat > /sys/class/leds/blue\:heartbeat/trigger

There are many other modes you can select. But some of them may now work. This is an example for N2.

root@odroid:~# cat /sys/class/leds/blue\:heartbeat/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 timer oneshot [heartbeat] backlight gpio cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 default-on transient panic rc_feedback emmc sd

Because the RED LED on the HC4 is not hard-wired, you can turn off the RED LED to indicate the power status on the ODROID-HC4.

The GPIO number of the red LED on the HC4 is 503.

# Export GPIO
root@odroid:~# echo 503 > /sys/class/export
# To set as Output 
root@odroid:~# echo out > /sys/class/gpio/gpio503/direction
# Output as low.
root@odroid:~# echo 0 > /sys/class/gpio/gpio503/value

netdev trigger will blink the blue led if there's network traffic.

  • Requirement for N2: Ubuntu 18.04 kernel 4.9.230-76, Ubuntu 20.04 kernel 4.9.230-95
  • Requirement for C4: Ubuntu 20.04 kernel 4.9.230-29
  • Requirement for XU4: Kernel 5.4

Enable netdev trigger:

echo netdev > /sys/class/leds/blue\:heartbeat/trigger

Set the interface to be monitored:

echo eth0 > /sys/class/leds/blue\:heartbeat/device_name

Interval in mS for blinking, lower is faster blinking, higher is slower, minimum is around 40

echo 40 > /sys/class/leds/blue\:heartbeat/interval

Link: Should we monitor if the link is up or down? (Link = Physical cable).

1 we monitor link status, the led behaviour is: on when link is up, flashing when there's activity.
0 we don't monitor link status, the led behaviour is: always off, flashing when there's activity.

echo 0 > /sys/class/leds/blue\:heartbeat/link

RX/TX Blinking

Enable RX Blinking

echo 1 > /sys/class/leds/blue\:heartbeat/rx

Enable TX Blinking

echo 1 > /sys/class/leds/blue\:heartbeat/tx
  • If you want to turn the LED off automatically in boot process, add echo none > /sys/class/leds/blue\:heartbeat/trigger in /etc/rc.local file.