Controlling LED Brightness through UCI

Hi all,

I just finished installing OpenWRT on some Google WiFi units, and I've got nearly everything working exactly the way I want, with one exception: the LED status light is way too bright.

For now, I've just disabled the LEDs, but since the device has full RGB support via /sys/class/leds/LED0_*/brightness, I'd really like to do some customization. I'm able to tweak them manually by writing values directly (e.g., echo "48" > /sys/class/leds/LED0_Red/brightness) but naturally these changes don't survive a reboot.

I was kind of hoping there was a UCI option I could use along the lines of uci set system.@led[0].brightness, but no such option seems to exist.

(On that subject, is there an authoritative list of supported options somewhere? The wiki just seems to show a few examples.)

If this isn't currently supported, I'd be interested in contributing, if someone would be kind enough to point me to the relevant source.

Thanks,

  • xale

For things that don't have specific settings and for which you have a command-line solution, it's usually easiest just to put them in /etc/rc.local, which gets execute at the end of the boot sequence. Put your echo command in that file and it will be run every time the device is power cycled.

1 Like

Hey Eric, thanks for the reply.

Adding a startup script is certainly option, so I'll fall back on that if there's nothing else, but I'd still be interested in seeing a canonical list of options, (if such a thing exists) or a least a link to the LED-related source code I could peruse.

That wold be /etc/init.d/led, the fairly straightforward init script setting up the LEDs.

Interestingly, your wish already has been granted: A brightness option for LEDs has been introduced at the end of 2024, just a bit too late to make it into 24.10, but it will be in the next release, 25.12.

1 Like

Awesome, thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.