OrangePi One: Change function of red status LED

Guides and tutorials for various stuff. Posted by DietPi users.

OrangePi One: Change function of red status LED

Postby k-plan » Sun Mar 12, 2017 1:37 pm

- Since DietPi v.143 blue LED is heartbeat for H3 now functional and applied during boot.

Hint:
- this will ONLY work with Legacy kernel images (3.4x) at the moment
- NOT with Mainline kernel images (4.9.x) ==>> green Power LED will start blinking, if device is ready for login or will shutdown.
Code: Select all
root@OrangePi-One:~# uname -r


3.4.113-sun8i


List available options:
Code: Select all
root@OrangePi-One:~# cat /sys/class/leds/red_led/trigger


none mmc0 mmc1 timer [heartbeat] backlight default-on



Example: Turn off
Code: Select all
echo -e "none" > /sys/class/leds/red_led/trigger



Example: link to sd-card usage (Note: Only after completely booting up device! )
Code: Select all
echo -e "mmc0" > /sys/class/leds/red_led/trigger


Example: link to Heartbeat usage
Code: Select all
echo -e "heartbeat" > /sys/class/leds/red_led/trigger



To get this red LED changes persistent on every boot, you have to edit /etc/rc.local

Make a backup:
Code: Select all
cp /etc/rc.local /etc/rc.local.bac


Edit:
Code: Select all
nano /etc/rc.local



Add following lines before "exit 0 ":
[Example - edit or uncomment line you needed.]
Code: Select all
#### switch on red LED for sd-card activity
echo -e "mmc0" > /sys/class/leds/red_led/trigger
echo -e " Status LEDs:\n RED = blink on sd-card activity\n Green = solid: Power on / blink: ready for login or shutdown device \n \n"

#### switch on red LED for heartbeat (default since DietPi v.143)
## echo -e "heartbeat" > /sys/class/leds/red_led/trigger
## echo -e " Status LEDs:\n RED = Heartbeat\n Green = solid: Power on / blink: ready for login or shutdown device \n \n"

#### switch off red LED (default until DietPi v.142)
## echo -e "none" > /sys/class/leds/red_led/trigger
## echo -e " Status LEDs:\n RED = always OFF\n Green = solid: Power on / blink: ready for login or shutdown device \n \n"

exit 0
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
k-plan
 
Posts: 395
Joined: Sun Feb 28, 2016 4:28 pm

Return to Community Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest