Wireless failover to off-by-default AP?

Hi,

One of the reasons why I bought the GL-MT6000 is WAN failover : I want my wired and wireless devices to stay online on the router’s network using my smartphone’s wireless WAN (4G) when my ethernet WAN (FTTH) is down.

So, I tested this and it works.

But, my smartphone’s wireless WAN isn’t always on (obviously), so when it’s off, the router’s wireless LAN becomes unstable as it’s endlessly looking for the AP, so I had to disable it, which means I’ll have to manually enable it when I’ll need it.

What I’d like instead is that the router automatically starts looking for my smartphone’s wireless WAN when and only when my ethernet WAN is down, so I’ll only have to enable it and the router will automatically connect to it.

Thanks

It would be easier to implement if you mean the pppoe or DHCP wan interface is down which would trigger a hotplug event.
If you mean the interface is on but the internet is not accessible, it’ll be a different solution.
which case fits more to yours?

The second one :

Thanks

Hello, any news on this ? Thanks

I thought the repeater switch could be triggered by kmwan hotplug, but actually not.
So we have to write a watch script to do this:

#!/bin/sh
# enable repater when cable wan is offline, otherwise disable repeater.

disable_repeater() {
    ubus call repeater disconnect
}

enable_repeater() {
	uci set repeater.@main[0].disabled='0'
	uci commit repeater
	/etc/init.d/repeater restart
}

while true; do
    wanonline=$(cat /proc/gl-kmwan/config | grep -w wan:online)
    if [ -n "$wanonline" ] && [ "$WAN_STATUS" != "online" ]; then
        WAN_STATUS="online"
        disable_repeater
    elif [ -z "$wanonline" ] && [ "$WAN_STATUS" != "offline" ]; then
        WAN_STATUS="offline"
        enable_repeater
    fi
    sleep 5
done

file named, /usr/bin/watch.sh, then run it by:

sh /usr/bin/watch.sh &