How can I flash the LED on the openwrt routers from command line NOT Luci?
For example, I’d like to flash only the red LED at different speeds then turn it back off on the 300N device. Can the configurable LED be different colors? If so, I’d prefer to use that one.
Thanks for your help. I’ll keep looking in the meantime.
I also found this information in another post;
alzhao Apr '16
The LAN LED is fixed as POWER in hardware. So it is always on.
The WAN LED and WiFi leds can be controlled.
Therefore, tested using another LED (If I am understanding the three LEDs)
echo 255 >/sys/class/leds/rt2800soc-phy0::assoc/subsystem/rt2800soc-phy0::quality/brightness
alzhao, the firmware was updated yes.
I posted the version in the first msg. If I recall, the /etc/config/system file was changed a little from factory. In the original, there is only mention of one.
config led ‘led_wifi_led’
Do I just need to put the old one back in and rebuild?
What else could I provide to help?
kyson-lok, I thought one of the LEDs is red which is the one I wanted to use.
ok but I am using my own /files directory. What must I leave that is factory in order to have the LEDs working as they should be? Not sure what I’ve removed that would cause this.
For future reference since no one seemed to have the correct answer, all I needed to do was to install kmod-leds-gpio kmod-ledtrig-usbdev in my build. Not sure if I need both but one or both allow me to control the LED.
Also, yes, there is a RED led, it is the WLAN.
Now this works.
echo 1 > /sys/class/leds/gl-mt300n:wlan/brightness
echo 0 > /sys/class/leds/gl-mt300n:wlan/brightness
With the above, I can turn it on and off but how can i make it flash also for example? Any other controls?
I’m not sure about that. I’ve read that there is something else, using the kmod-ledtrig-timer if I understand correctly. However, I cannot find a way to send the LED a command to do anything but go on and off.
Morse and heartbeat are basically just turning the LED’s on and off and predefined intervals, which you can do using sleep in a bash script with the commands above for on and off so…
You can either write your own bash script to do what you want, or make a c++ program and compile it for more advanced things.
This basically what the GL UI is doing for the reset blinking and other blinking apart from the automatic from OpenWRT (which is probably also just calling the LED’s to be on or off).