OpenWrt Forum Archive

Topic: Hacking WNDR3800 LED's

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

Hello everyone! I am having some difficulty turning off the blue 5 GHz LED. I would like it to remain off after radio1 is brought up from cron. I have both radios set to turn off using the following cron information:
00 23 * * * wifi down radio0
00 10 * * * wifi up radio0
00 22 * * * wifi down radio1
00 04 * * * wifi up radio1
I have edited the following files to see if I could permanently turn the LED files:
/etc/board.d/01_leds
wndr3700v4 | \
wndr4300)
    ucidef_set_led_netdev "wan" "WAN (green)" "netgear:green:wan" "eth0.2"
    ucidef_set_led_usbdev "usb" "USB" "netgear:green:usb" "1-1"
    ucidef_set_led_wlan "wlan2g" "WLAN2G" "netgear:green:wlan2g" "phy0tpt"
    ucidef_set_led_wlan "wlan5g" "WLAN5G" "netgear:blue:wlan5g" "0"
/etc/config/system
config led 'led_wlan5g'
    option name 'WLAN5G'
    option sysfs 'ath9k-phy1'
    option default '0'   
    option trigger 'none'
This is not working. sad

I have a WNDR3800 with Arokh's DD build# r48233 installed. Any ideas would be appreciated.

lately i have been playing with the ea4500 buttons and leds with success but i'm not familiar with the wndr3800.  can you execute this command and tell me what you see?  i like to see what are the actual led names for your router.  let me see if i'm able to turn off your blue led.

ls /sys/class/leds/

wrtboy - First thanks for responding, I really appreciate it.

Here is the output from ls /sys/class/leds/

ath9k-phy0            netgear:green:usb     netgear:orange:power
ath9k-phy1            netgear:green:wan     netgear:orange:wps
netgear:green:power   netgear:green:wps

try this command and see if it shuts off the 5ghz led.

echo "0" > /sys/class/leds/ath9k-phy1/brightness

Yes the command does shut off the 5GHz led! And of course the following will turn it back on:

echo "1" > /sys/class/leds/ath9k-phy1/brightness

Do you think if it put your command in as a cron job after the 5GHz network restarts in the morning that it will turn the led off?

(Last edited by GethroC on 30 Mar 2016, 14:40)

You could also put that command into a hotplug script, so that when the interface comes up, you turn the brightness to 0

EEDIT:
Example: settings wan LED color in wndr3800 according to the line speed:
https://forum.openwrt.org/viewtopic.php … 43#p314143

(Last edited by hnyman on 30 Mar 2016, 14:43)

test each method and share your results here.  i think either method works.

a shout-out:  i have also inherited a wndr3700v2 from a neighbor after he upgraded his router last holiday.  it's been running flawlessly on a hnyman cc build with dibdot's adblock.  kudos to both of them, and testers, for making it so easy.

Thanks wrtboy and hnyman for the info!!! Placing this command:

echo "0" > /sys/class/leds/ath9k-phy1/brightness

in the cron job works well. I have not tried hnyman's approach yet but I will.

So the cron job version as I have set it up  for now:

00 00 * * * wifi down radio1
00 04 * * * wifi up radio1
01 04 * * * echo "0" > /sys/class/leds/ath9k-phy1/brightness

Why not configure the led to be off in /etc/config/system? Ie. set trigger none.

I'm not much of a script writer, but, here is what I came up with before testing:

#!/bin/sh

if [ "$ACTION" = wifi up ]; then
        if [ "$INTERFACE" = "radio1" ] ; then
                echo "0" > /sys/class/leds/ath9k-phy1/brightness
        else
                echo "0" > /sys/class/leds/ath9k-phy1/brightness
                fi
        fi
fi

I named the file 99-radio1ledoff.

sera:
Here is what I have in /etc/config/system:

config led 'led_wan'
    option name 'WAN LED (green)'
    option sysfs 'netgear:green:wan'
    option trigger 'none'
    option default '1'

config led 'led_usb'
    option name 'USB'
    option sysfs 'netgear:green:usb'
    option trigger 'usbdev'
    option interval '50'
    option dev '1-1'
    option default '0'

Would I setup something like this for radio1?
GethroC

Along the line of:

config led 'led_wlan'
    option name 'WLAN'
    option sysfs 'ath9k-phy1'
    option trigger 'none'

alternatively use default-on trigger with default set to off

Thanks sera, I will give that a try. GethroC

Question sera:
So if I used the default-on trigger would it look like this:

config led 'led_wlan'
    option name 'WLAN'
    option sysfs 'ath9k-phy1'
    option default-on 'off'
config led 'led_wlan'
    option name 'WLAN'
    option sysfs 'ath9k-phy1'
    option trigger 'default-on'
    option default '0'

I recommend to look into https://wiki.openwrt.org/doc/uci/system once more

(Last edited by sera on 11 May 2016, 11:21)

GethroC wrote:
        if [ "$INTERFACE" = "radio1" ] ; then
                echo "0" > /sys/class/leds/ath9k-phy1/brightness
        else
                echo "0" > /sys/class/leds/ath9k-phy1/brightness

Both branches of the then/else seem to do the same action... Likely one of them should be either 255 or 1.

The discussion might have continued from here.