Hello!
I wonder is it possible to manage LEDs on the board via shell commands?
There are a plenty of them, but by default the board uses only 2.5 (PWR, G and sometimes B is blinking).
I’d like to utilize all others, e.x. set a watchdog for an interface and connect it to an LED.
Or may be put the board in the “stealth” mode.
frank-w
(Frank W.)
September 29, 2024, 9:23am
2
Afaik only 1 green (GPIO79_V1P8_VBUS_P0) and one blue (GPIO79_V1P8_VBUS_P1) led can be controlled via software
Wonder why both are gpio79 in my schematic…
In “my” current source (from daniel) blue led is gpio63
wps {
label = "WPS";
linux,code = <KEY_RESTART>;
gpios = <&pio 14 GPIO_ACTIVE_LOW>;
};
};
gpio-leds {
compatible = "gpio-leds";
led_green: led-green {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_GREEN>;
gpios = <&pio 79 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
led_blue: led-blue {
function = LED_FUNCTION_WPS;
color = <LED_COLOR_ID_BLUE>;
gpios = <&pio 63 GPIO_ACTIVE_HIGH>;
Thank you!
I found those LEDs under /sys/class/leds
directory + some unknown ones:
root@OpenWrt:/sys/class/leds# ls -lh
lrwxrwxrwx 1 root root 0 Jan 1 1970 blue:wps -> ../../devices/platform/gpio-leds/leds/blue:wps
lrwxrwxrwx 1 root root 0 Jan 1 1970 green:status -> ../../devices/platform/gpio-leds/leds/green:status
lrwxrwxrwx 1 root root 0 Jan 1 1970 mt7530-0:00:green:lan -> ../../devices/platform/soc/15020000.switch/mdio_bus/mt7530-0/mt7530-0:00/leds/mt7530-0:00:green:lan
lrwxrwxrwx 1 root root 0 Jan 1 1970 mt7530-0:01:green:lan -> ../../devices/platform/soc/15020000.switch/mdio_bus/mt7530-0/mt7530-0:01/leds/mt7530-0:01:green:lan
lrwxrwxrwx 1 root root 0 Jan 1 1970 mt7530-0:02:green:lan -> ../../devices/platform/soc/15020000.switch/mdio_bus/mt7530-0/mt7530-0:02/leds/mt7530-0:02:green:lan
lrwxrwxrwx 1 root root 0 Jan 1 1970 mt7530-0:03:green:lan -> ../../devices/platform/soc/15020000.switch/mdio_bus/mt7530-0/mt7530-0:03/leds/mt7530-0:03:green:lan
I indeed can control the green one and the blue one:
echo 1 > /sys/class/leds/blue:wps/brightness
echo 1 > /sys/class/leds/green:status/brightness
echo 0 > /sys/class/leds/blue:wps/brightness
echo 0 > /sys/class/leds/green:status/brightness
The other ones - I don’t know what they are. And mt7530
seems like a wrong platform.
Well, that’s not a christmas tree, but two is better that nothing.
frank-w
(Frank W.)
September 29, 2024, 11:20am
4
The mt7530 leds are for the internal switch (the wan/lan ports),not sure why they are exposed to sysfs.