OpenWrt Forum Archive

Topic: [HOWTO] wndr3700v2 -> Script to power off all leds

The content of this topic has been archived on 7 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Here's a little script which can turn ALL! leds of the wndr3700v2 on/off.
Maybe someone has a use for this.

Btw: I first tried to manage this over uci but couldn't get it to
work for all leds, so i did it via gpio ports and the rest over /sys ...

#!/bin/sh

if [ "$1" ] && [ "$1" == "--on" ]
then
        echo 255 > /sys/devices/platform/leds-gpio/leds/wndr3700:green:power/brightness
        echo 255 > /sys/devices/pci0000:00/0000:00:11.0/leds/ath9k-phy0/brightness
        echo 255 > /sys/devices/pci0000:00/0000:00:12.0/leds/ath9k-phy1/brightness
        /sbin/swconfig dev rtl8366s port 1 set led 6
        /sbin/swconfig dev rtl8366s port 2 set led 9

elif [ "$1" ] && [ "$1" == "--off" ]
then
        echo 0 > /sys/devices/platform/leds-gpio/leds/wndr3700:green:power/brightness
        echo 0 > /sys/devices/pci0000:00/0000:00:11.0/leds/ath9k-phy0/brightness
        echo 0 > /sys/devices/pci0000:00/0000:00:12.0/leds/ath9k-phy1/brightness
        /sbin/swconfig dev rtl8366s port 1 set led 0
        /sbin/swconfig dev rtl8366s port 2 set led 0
fi

I wonder if the lan ports is connected to a 100M network card.Lan leds is bright by default on Openwrt?

(Last edited by axishero on 22 Jun 2012, 00:45)

thanks!
I tried an hour now to get my 5ghz blue led off, this worked! smile

(Last edited by gotschi on 14 Jul 2013, 12:45)

The discussion might have continued from here.