If I look at usr/bin/mt1300_led I see options to change brigtness for example.
If I do etc/init.d/led stop
The led stops, and goes on again in a second, so somewhere there is a script (maybe in hotplug.d) that checks the status of the router and sets the led accordingly.
So there must be a script that I can change to add the status of the vpn.
Something with the fact that tun0 is up when on VPN.
So if I can ping through tun0 the led breath and If I canāt ping tun0 itās goes back to default.
I think the following script makes the led do what it default does.
/usr/bin/mt1300_led_deamon
#!/bin/sh
status="0"
count=`uci get mwan3.wan.count 2>/dev/null`
timeout=`uci get mwan3.wan.timeout 2>/dev/null`
track_ip=`uci get mwan3.wan.track_ip 2>/dev/null`
[ -z "$count" ] && count="1"
[ -z "$timeout" ] && timeout="2"
[ -z "$track_ip" ] && track_ip="1.1.1.1 1.0.0.1"
mt1300_led off
mt1300_led blue_breath daemon
for ip in $track_ip;
do
ping -c $count -W $timeout -q $ip 1>/dev/null
ret=`echo $?`
if [ "$ret" = "0" ];then
status="1"
break
fi
done
while true
do
if [ "$status" = "0" ];then
mt1300_led blue_breath daemon
else
mt1300_led white daemon
fi
sleep 5
#mwan3 will not be used in the AP/WDS mode
mode=`uci -q get glconfig.bridge.mode`
if [ "$mode" = "ap" -o "$mode" = "wds" ];then
[ "$status" = 1 ] && sleep 10
for ip in $track_ip;
do
ping -c $count -W $timeout -q $ip 1>/dev/null
ret=`echo $?`
if [ "$ret" = "0" ];then
status="1"
break
else
status="0"
fi
done
continue
fi
if [ "$status" = "0" ];then
interface=`get_wan_interface`
if [ -z "$interface" ];then
continue
fi
for ip in $track_ip;
do
ping -c $count -W $timeout -q $ip 1>/dev/null
ret=`echo $?`
if [ "$ret" = "0" ];then
status="1"
break
fi
done
else
interface=`get_wan_interface`
if [ -z "$interface" ];then
status="0"
continue
fi
mwan3_status=`mwan3 policies | grep "Current ipv4 policies:" -A 2 | tail -n 1 | sed 's/ //g' 2>/dev/null`
if [ "$mwan3_status" = "default" ];then
for ip in $track_ip;
do
ping -c $count -W $timeout -q $ip 1>/dev/null
ret=`echo $?`
if [ "$ret" = "0" ];then
status="1"
break
else
status="0"
fi
done
continue
fi
mwan3_interface=`echo $mwan3_status | awk -F \( '{print $1}' 2>/dev/null`
check=`echo $interface | grep $mwan3_interface 2>/dev/null`
if [ -z "$check" ];then
for ip in $track_ip;
do
ping -c $count -W $timeout -q $ip 1>/dev/null
ret=`echo $?`
if [ "$ret" = "0" ];then
status="1"
break
else
status="0"
fi
done
fi
fi
done
So there must be something I can add, that when tun0 is up, is does like white_breath.
For anyone who is interested in a solution for breathing led on vpn and a solid one when on normal wan. Just made a clean but dirty solution that works for me.
Please be aware that I probably broke a lot of things Iām apparantly not using, but it works for me.
For the ones that are feeling comfortable deeper into the system, It will not break mwan3, as I altered this for my needs and I use it extensively.
I deleted the content of the file /usr/bin/mt1300_led_deamon (or you rename the original for backup)
past the content below to the file and save it as /usr/bin/mt1300_led_deamon
#!/bin/sh
ip="1.1.1.1" # use any dns you want
count="1"
timeout="1"
mt1300_led off
mt1300_led blue_breath daemon
while true; do
status=$(ping -q -c "$count" -W "$timeout" "$ip" > /dev/null 2>&1 && echo "ok" || echo "fail")
if [ "$status" = "ok" ]; then
if [ -d /sys/class/net/tun* ]; then
mt1300_led white_breath daemon
else
mt1300_led white daemon
fi
else
mt1300_led blue_breath daemon
fi
sleep 10
done
Then restart the daemon with;
/etc/init.d/led restart
You can use any dns you want offcourse, default used by most is the dns from google 8.8.8.8, but I donāt us any Google or Facebook application or services. So I ban them from all my systems.
"FYI there are a lot of 8.8.8.8 and 8.8.4.4 in the firmware from Gl.Inet. This should be a choise not hardcoded.Just my 50 cents."
For I forget, make the file executable if you upload a new file instead of editing the original one.
Note that if anyone is looking at this and uses wireguard instead, youāll need to check for the existence of /sys/class/net/wg* instead.
Also, the script has been renamed to gl_mt1300_led_daemon and it seem the status checks may have changed as well. Iām not sure why, but I cannot ping 1.1.1.1 while using cloudflare. Not feel motivated enough to dig deeper.
@ray308 is right that itās weird all these ips and such are hard-coded. More I dive into these the scripts, the iffier the software side of this router isā¦
This is what I did, and it worked, and it did what I wanted. When first turning on, it will be blue, but after it boots, the white LED is off. Thanks @techhome !
Any clue on when this will show up in the app? While the app is handy for network settings, removing the complexity of dimming or controlling the blazing bright light would really help.
I would love to say āThanks that worksā, but when I tap on the system overview bar, it depresses like a button, but does nothing more. Iāve tried tapping 1, then 2, holding the two at the same time, holding system overview, and even swiping it sideways, but neither my Android cell or tablet can access the System overview section you show. The rest of the app seems to work. Ideas?
According to the status page in LuCI, Kernel Version is 4.14.241 and OpenWrt 19.07.8 r11364-ef56c85848. The Admin Panelās upgrade section shows 3.215 as the installed version.
I had used this trick to dim the LEDs, but with the upgrade, /usr/bin/mt1300_led is no longer there. Is it possible to dim the LEDs another way? I didnāt see a way within the app, control panel, or LuCI. Is there another file?
Iāll have to give up - The openwrt-mt1300-4.2.0-0210-1675977894 and todayās 0212 daily snapshot firmware just wasnāt stable. It would work at first, but at times it would not properly boot at power up, wouldnāt reset holding the button for 10 seconds, and required reloading firmware, Iāll just wait for the stable release. Thanks!