Wan LED behavior change in openwrt

I am writing to request support for changing the WAN LED to amber when the internet connection is not present in my TP-Link Archer C6 V3 running OpenWRT. I have followed the instructions in the other forums but that didn't seems to be helping me.

I would be grateful if you could provide me with any advice on how I can resolve this issue. If there is any additional information I need to provide, please let me know.

Thank you for your time and consideration.

1 Like

use https://openwrt.org/docs/guide-user/base-system/hotplug to create script changing the LED color, when connection goes down/up.

ax example from another device Amber led on WRT3200ACM when VPN is down possible?

1 Like

Well I don't know how to do it for my router because I'm a noob to scripts but you can teach me how to implement. :confused:

want fries with that ?

google linux scripting for dummies ...

I am not familiar with the LUCI route so I will cover the way to do it via ssh-login and command line usage.

You need to edit the file /etc/config/system. There you'll find the LED entry for WAN.

config led 'led_wan'
	option name 'WAN'
	option sysfs 'green:wan'
	option trigger 'netdev'
	option mode 'link tx rx'
	option dev 'wan'

Change option sysfs 'green:wan' to option sysfs 'orange:wan:'

Quicker way with uci:
uci set system.led_wan.sysfs='orange:wan' and then uci commit

That should suffice.

1 Like

/etc/config/system
How to browse this file?

winscp works

1 Like

The wiki has the basic information on access via ssh: https://openwrt.org/docs/guide-quick-start/sshadministration

Depending on your OS you will find the steps to take there.

1 Like

I know how to access the ssh bht i don't know what commands I've to input.

Ah, I see. You either edit the file directly with vi /etc/config/system or use the following commands:

uci set system.led_wan.sysfs='orange:wan'
uci commit

You can verify the change with uci show system.led_wan

Are you sure this command change the led colour toh orange when there is no internet?

My bad, I thought you wanted to replace the color only. Now that I think about it though, basic communication between your OpenWrt device and the router sitting before it, like DHCP, already triggers tx rx.

Maybe this link helps you with the script needed: [Solved] Changing WAN LED light to amber depending on network status - #5 by kaly

2 Likes

Can you please help.me out how to implement this script in openwrt

you do realize the thread describes how to implement it on openwrt ?

Let me try to implement.

Finally guys i've got it working for my tp-link archer c6 v3. Steps for doing it are as follows:
1.You'll need to install the package named "openssh-sftp-server".
2.After installing the packages you've have to sftp into the router "like accessing the routers files" with the help of WinSCP .
### WinSCP
3.Fill in the details like routers ip address and password.
4.You'll need to find this directory "/etc/hotplug.d/iface/".
5.Create a new file named as 30-wanled.
6.Paste my code as i've altered it to work on my router .

#!/bin/sh
#/etc/hotplug.d/iface/30-wanled

#Check WAN Connection
while :
	do
	
    Status=$(ping -q -c 1 -W 1 8.8.8.8  > /dev/null 2>&1 && echo "ok" || echo "FAIL")
	
	if [ "$Status" = "ok" ]; then

    echo 0 > /sys/class/leds/orange:wan/brightness
    echo 255 > /sys/class/leds/green:wan/brightness

	else 

    echo 255 > /sys/class/leds/orange:wan/brightness
    echo 0 > /sys/class/leds/green:wan/brightness

	fi
	
	sleep 10
done

7.Reboot the router.
8.Test it yourself.

1 Like

No you don't, you just have to tell winscp to use scp instead of sftp.

2 Likes

Nvm I'll learn more :grin:.Btw led tends to remain on the orange/amber side when the wan cable is disconnected. Any suggestions please?

1 Like

are you sure the led paths are correct, they're device specific.

Yes paths are correct because I've been exploring paths through winscp before copying the commands.