How do I change the default LEDs that light up when my device boots? At the moment my router uses four LEDs, WLAN, Signal Strength, Power, and LAN, but I'd like to reduce that to just Power and LAN. I don't use WIFI on this device so the other two should be switched off by default. I think I could just write a little script and have it run after boot with crontab but it feels better to me to make the change at the source, to stop them coming on in the first place so to speak.
Later on (when I get WireGuard working--if that ever happens haha) I want to use the LEDs to show when the WireGuard connection is up and when its down. Where would I add the script to do that?
I just flashed my device to 19.07.4 and haven't made any changes yet so this is a 'stock' install.
You forgot to tell us, which device you are talking about...
The answer depends on that, as in some routers all LED config is found in /etc/config /system, while in some routers some LEDs are controller directly by some driver, like e.g. the ath10k wifi driver can control directly the wifi LEDs in some ipq806x routers and there is no wifi LED config provided in OpenWrt.
Usually the LED devices are defined in the DTS file of each router, and those provide the visible led devices for Linux. And those devices files can be manipulated by scripts for LED control. See the contents of /sys/class/leds.
That's some really good information, thanks for that! When I have more
time I'll look into this again, I think it would be a useful feature. If
I get it to work (when! Be positive!) I'll post the solution to the
forum - share and share alike!