Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
common:application_note:led_control [2020/04/23 15:36]
luke.go ↷ Page moved from internal:common:application_note:led_control to common:application_note:led_control
common:application_note:led_control [2020/12/10 09:43] (current)
odroid [How to control the Red power LED (Applicable for the ODROID-HC4 only)]
Line 6: Line 6:
 Simply you can turn on/off that with putting an option using **echo** command. Simply you can turn on/off that with putting an option using **echo** command.
  
-===== Turn off ====+==== Turn off ====
 Do **echo none** to turn off. Do **echo none** to turn off.
 <code bash target> <code bash target>
Line 12: Line 12:
 </​code>​ </​code>​
  
-===== Turn on =====+==== Turn on ====
 Do **echo MODE** to turn on with MODE. Do **echo MODE** to turn on with MODE.
 <code bash target> <code bash target>
Line 27: Line 27:
 root@odroid:​~#​ cat /​sys/​class/​leds/​blue\:​heartbeat/​trigger 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 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
 +</​code>​
 +
 +
 +===== netdev trigger =====
 +**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:
 +**<code bash target>
 +echo netdev > /​sys/​class/​leds/​blue\:​heartbeat/​trigger
 +</​code>​
 +
 +**Set the interface to be monitored:
 +**<code bash target>
 +echo eth0 > /​sys/​class/​leds/​blue\:​heartbeat/​device_name
 +</​code>​
 +
 +**Interval in mS for blinking, lower is faster blinking, higher is slower, minimum is around 40
 +**<code bash target>
 +echo 40 > /​sys/​class/​leds/​blue\:​heartbeat/​interval
 +</​code>​
 +
 +**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.
 +
 +<code bash target>
 +echo 0 > /​sys/​class/​leds/​blue\:​heartbeat/​link
 +</​code>​
 +
 +** RX/TX Blinking **
 +
 +** Enable RX Blinking ** 
 +<code bash target>
 +echo 1 > /​sys/​class/​leds/​blue\:​heartbeat/​rx
 +</​code>​
 +
 +** Enable TX Blinking ** 
 +<code bash target>
 +echo 1 > /​sys/​class/​leds/​blue\:​heartbeat/​tx
 </​code>​ </​code>​
  
Line 32: Line 76:
   * 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.   * 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.
 </​WRAP>​ </​WRAP>​
 +
 +
 +===== How to control the Red power LED (Applicable for the ODROID-HC4 only) =====
 +The Red LED on the HC4 board is not hard-wired and you can turn it off by software.\\
 +The GPIO number of the red LED on the HC4 board is 503.\\
 +
 +<code bash target>
 +# Export GPIO
 +root@odroid:​~#​ echo 503 > /​sys/​class/​gpio/​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
 +</​code>​
 +