Thanks Al, I have found a possible solution @ [OpenWrt Wiki] Smartphone USB tethering
Though, we don’t need to use hub-ctrl because of the usbpow. I am currently testing this, please see below if it helps anyone:
Creating a script that checks the connection and if it’s down, it resets the USB port and network
cat << “EOF” > /root/wan-watchdog.sh
#!/bin/sh
Fetch WAN gateway
. /lib/functions/network.sh
network_flush_cache
network_find_wan NET_IF
network_get_gateway NET_GW “${NET_IF}”
Check WAN connectivity
TRIES=“0”
while [ “${TRIES}” -lt 5 ]
do
if ping -w 3 “${NET_GW}” &> /dev/null
then exit 0
else let TRIES++
fi
done
Restart network and USB port
/etc/init.d/network stop
echo 1 > /sys/class/leds/gl-ar750s:white:usbpower/brightness
sleep 1
echo 0 > /sys/class/leds/gl-ar750s:white:usbpower/brightness
/etc/init.d/network start
EOF
chmod +x /root/wan-watchdog.sh
Add cron job to check every minute
cat << “EOF” >> /etc/crontabs/root
-
-
-
-
- /root/wan-watchdog.sh
EOF
1 Like