[Solved] How can I fix this small LED color problem?

Hello! so I just installed LEDE on a Ubiquiti Airgateway device and the LED after booting up its suppose to change to blue color but its always white. I played around with the LED settings on the Luci GUI and it never changes to blue. I know how to compile Lede firmware and would like to know what file should I edit to fix this problem before compiling. :smiley:

What do you see in /sys/devices/virtual/leds ?

1 Like

The behavior you describe is likely the behavior in the OEM firmware.

Have you been able to edit the LEDs under System > LED Configuration on the LuCI web GUI?

Yes I change all setings in LED config on Luci GUi and still the blue LED wont turn on, it is always white no matter what :frowning:

I will check and post results of /sys/devices/virtual/leds

@jeff which command should I run to check /sys/devices/virtual/leds ????

ls -l /sys/class/leds/ will, on checking again, give you more results:

jeff@office:~$ ls -l /sys/class/leds/
lrwxrwxrwx    1 root     root             0 May  1 15:14 ath9k-phy1 -> ../../devices/platform/qca955x_wmac/leds/ath9k-phy1
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:lan1 -> ../../devices/virtual/leds/tp-link:blue:lan1
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:lan2 -> ../../devices/virtual/leds/tp-link:blue:lan2
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:lan3 -> ../../devices/virtual/leds/tp-link:blue:lan3
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:lan4 -> ../../devices/virtual/leds/tp-link:blue:lan4
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:qss -> ../../devices/platform/leds-gpio/leds/tp-link:blue:qss
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:system -> ../../devices/platform/leds-gpio/leds/tp-link:blue:system
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:wan -> ../../devices/virtual/leds/tp-link:blue:wan
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:wlan2g -> ../../devices/platform/leds-gpio/leds/tp-link:blue:wlan2g
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:blue:wlan5g -> ../../devices/platform/leds-gpio/leds/tp-link:blue:wlan5g
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:green:usb1 -> ../../devices/platform/leds-gpio/leds/tp-link:green:usb1
lrwxrwxrwx    1 root     root             0 May  1 15:14 tp-link:green:usb2 -> ../../devices/platform/leds-gpio/leds/tp-link:green:usb2

(TP-Link Archer C7 -- the colors aren't "right", but it does list what the system knows about)

~# ls -l /sys/class/leds
lrwxrwxrwx 1 root root 0 Oct 17 22:11 ath9k-phy0 -> ../../devices/platform/ar933x_wmac/leds/ath9k-phy0
lrwxrwxrwx 1 root root 0 Jan 1 1970 ubnt:blue:wlan -> ../../devices/platform/leds-gpio/leds/ubnt:blue:wlan
lrwxrwxrwx 1 root root 0 Jan 1 1970 ubnt:white:status -> ../../devices/platform/leds-gpio/leds/ubnt:white:status
root@Orange:~#

Does

ls -l /sys/devices/platform/leds-gpio/leds/ubnt:white:status

reveal anything that suggests that the color can be changed?

Are there two, visible LEDs on the unit, or just one "hole" in the case? If just one hole, then you probably need to configure things so that the white LED turns off and the blue LED turns on for the event that you desire as a trigger.

yes there is only 1 hole and the LED on the OEM AirOS firmware can be white or blue but not both at the same time. for example when the Airgateway boots up using OEM firmware the LED is white and after the boot up is finished then the LED is Blue

I don't know that you can "mix" the stock triggers, so you may need to write a script to get the behavior I think you want. It might work if you set the white LED to be "not WLAN active" and the blue one to be "WLAN active", perhaps with some wonky behavior just after boot.

If that kind of thing doesn't work, I'd approach it with a script that "listens to" ubus events and manages the LEDs appropriately. https://openwrt.org/docs/guide-developer/ubus is pretty bare, so you many need to poke around a bit to figure out how to get what you need to determine the LED state you desire.

While the colour is usually part of the LED name, as far as the GPIO system is concerned, you can't change the colour - just like you can't magically make a red LED a green one in software. For RGB LEDs, you usually see each colour as an individual LED, as they're controlled by different GPIOs - taking the BT Home Hub 5 type A as an example, you get:

broadband-* is a single RGB led:

  • bthomehubv5a:red:broadband
  • bthomehubv5a:green:broadband
  • bthomehubv5a:blue:broadband

wireless-* is a single RGB led:

  • bthomehubv5a:red:wireless
  • bthomehubv5a:green:wireless
  • bthomehubv5a:blue:wireless

power-* is a single RGB led:

  • bthomehubv5a:red:power
  • bthomehubv5a:green:power
  • bthomehubv5a:blue:power

in this case I guees it 2 diferrent LEDS inside the Airgateway. I just want the led to be blue the whole time, dont need white led in my case but no matter what I change at LED config from GUi only the white LED turns on or off. no sign of blue led. Do eny one know which file in the LEDE directory controls the LED? maybe I can fix it by playing around with editing but I dont know which file I should edit.

AirGateway

thats what I need, blue LED turned on

A typical LED stanza in /etc/config/system looks like (Archer C7, so the names are different, and the triggers are mine)

config led
	option default '0'
	option name 'Yin-Yang'
	option sysfs 'tp-link:blue:qss'
	option trigger 'netdev'
	option dev 'br-mesh'
	option mode 'rx'

tp-link:blue:qss is off by default, and on when netdev says that br-mesh receives data. LuCI knows it as "Yin-Yang".

Without seeing your config or your LuCI, it's hard to know exactly what to change, but you should be able to turn the white one "off" and trigger the blue one on whatever you want (within reason). If they don't show in LuCI, try the "Add" button in the LED config section.

fixed it! I added 2 configurations on LED settings in Luci Gui. 1 es set to white NONE and the other is set to blue DefaultON and boom! blue LED is ON :smiley: thanks guys for the help :slight_smile:

If your question is solved, please consider marking this topic as [Solved].