-
Notifications
You must be signed in to change notification settings - Fork 17
Board leds treatment
Leds are treated with shell command:
/usr/sbin/led_app
and the cumulative rc command:
/usr/sbin/rc_app/rc_led_ctrl <start|stop|restart>
Here's the typical led_app command usage:
led_app on <led id>
led_app off <led id>
led_app blink <led id> <blink count> <on time> <off time>
led_app blink_always <led id> <blink count> <on time> <off time> <blink interval>
led_app blink_alt <led id> <led id2> <blink count> <on time> <off time>
led_app blink_tm <led id> <led id2> <blink count> <on time> <off time> <blink interval>
led_app reboot <secs>
led_app ctrl <blink_data|no_blink_data|off>
<led id> = led id number: each led corresponds to a number (some leds are white/amber and the colour has a different number)
<blink count> = stands for number of blinks
<on time>= duty cycle led on for blinking (in ms)
<off time> = duty cycle led off from blinking (in ms)
<blink interval> = interval between blinking (in ms)
<secs> = seconds
on = turn led on
off = turn led off
blink = one led blinking for a specified time
blink_always = one led blinking for unspecified time
blink_alt = blink two leds alternatively for unspecified time
blink_tm = blink two leds alternatively for a specified time
reboot = reboot led (and machine) in X seconds
e.g.
led_app blink_always 71 1 250 750 0
Many combinations may be done varying: commands, duty cycles, intervals and delays.
From left (power) to right (wps)
70 power white - 71 power amber
20 internet link white - 30 internet link amber
50 adsl link white
41 wifi 2.4ghz white
42 wifi 5ghz white
61 storage #1 left white
60 storage #2 right white
10 lan #1 amber - 11 lan #1 white
12 lan #2 amber - 13 lan #2 white
14 lan #3 amber - 15 lan #3 white
16 lan #4 amber - 17 lan #4 white
40 wifi radio button white
45 wps radio button white
All the leds, except the power one on the left, can be treated globally in 3 ways with the nvram setting led_ctrl_opt
followed by the shell command: rc led_ctrl restart
.
Values available for led_ctrl_opt
are:
' blink ': leds can be turned on following their specific setting logic (enabled/disabled, 10mb/100mb/1gb and so on) and blink when related traffic is detected;
' noblink ': leds can be turned on/off following their specific setting logic (enabled/disabled, 10mb/100mb/1gb, link up/down and so on) but without blinking when related traffic is detected: so they will have always a fixed light;
' off ': all leds are off even if their specific setting logic turn them on.
To turn on/off/white/amber the power led on the left, use the led_app
shell command:
led_app off 70
: white power led off
led_app off 71
: amber power led off
led_app on 70
: white power led on
led_app on 71
: amber power led on
./led.sh <kitt|halfkitt|kittwake|halfkittwake|bright|dark|reset|start|restart|stop|help>
This script contains some led treatment example methods.
Methods are:
kitt) "supercar" K.I.T.T. mode - leds run from left to right & back;
halfkitt) left and right led sides run from opposite and meet in the middle then back;
kittwake) same as kitt with wake effect - one led on, the next on before the previous off;
halfkittwake) halfkitt+kittwake together;
bright) all on white + amber;
dark) all off white + amber;
reset) return to leds normal working conditions;
start|restart) start leds in normal running mode;
stop) stop all leds, power led included;
help) brief led board guide;