LEDs and GPIOs

In the directory /sys/devices/platform/leds-gpio/leds/, I’m seeing 6 LEDs, but on there are 9 LEDs in total.
It is missing the LAN2/LAN3/LAN4. Where are the settings to activate those LEDs ?

Those three LEDs are not configured in kernel. You can use them in this way:

echo "14" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio29/direction
echo "1" > /sys/class/gpio/gpio29/value

The gpio of LAN2/LAN3/LAN4 are 14, 15, 16 according to the docs.

refer to:


Thanks a lot !

How to do the same LED controls on GPIO1 and GPIO13 ?
Trying to do a echo “1” > /sys/class/gpio/export give “write error: Device or resource busy”.
I understand that it is busy because of “domino:green:lan1”, but how to make it released ?

I found this:

it works

root@OpenWrt:/# echo “leds-gpio” > /sys/bus/platform/drivers/leds-gpio/unbind
root@OpenWrt:/# cat /sys/kernel/debug/gpio
GPIOs 0-21, ar2315-gpio:
gpio-0 (sysfs ) in lo
gpio-5 (reset ) in hi
gpio-6 (sysfs ) in lo

Now you can use gpio export (i.e echo 11 > /sys/class/gpio/export), and change ‘direction’ and ‘value’ of the gpio to directly control it.

Thanks for the hint !
Now, I have some more GPIOs … :slight_smile: