Hi all, I have just received my AR750s and I absolutely love it.
I am currently tethering my android phone via easytether via the following documentation EasyTether - GL.iNet Docs but I have noticed that the auto-connect instructions don’t seem to auto-connect the phone on reboot, or when connection is lost. I have to physically unplug and plug my phone to the usb cable and it automatically connects. I am wondering if there is an alternate way to fix this issue? I am running the latest 3.104.
Maybe you can write a script to check internet periodically. When there is no Internet you can power cycle the USB port. The USB port is controlled by GPIO so it can be power off and on again.
Thanks for the idea Alzahao! I’ve been looking around for a way to implement, I saw that you had mentioned in another post to start/stop usb I would have to use the following:
ls /sys/class/leds/ usbpow
Then control the USB power using it
echo 0 > /sys/class/leds/…usbpow…/brightness
echo 1 > /sys/class/leds/…usbpow…/brightness
The below works, but for some reason it doesn’t work on reboot. I have to manually remove and reconnect the device although I’ve also added the @reboot sh checkInternet
if nc -zw1 google.com 443; then
echo "we have connectivity"
else
echo "resetting usb"
echo 1 > /sys/class/leds/…usbpow…/brightness
echo 0 > /sys/class/leds/…usbpow…/brightness
fi
You need to check connectivity multiple times, not one time, which may be wrong. Generally you can check 3 times and no connectivity and then label it a no
During boot, there is no internet yet, so this script execute quickly and then end. What you need to do is: (a) add detection of the easytethering interface. Only when there is easytether interface you start, otherwise you wait. (b) add some delay to execute this script after boot.
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
How did the test go? Is this a solution to having to unplug/plug to enable it to reconnect? I use the Automate app to automatically turn on USB tether when connecting the cable, but am having the same issue with having to manually unplug/plug after a power failure and the router restarts.
root@GL-AR750S:~# ./wan-watchdog.sh
sh: “0”: out of range
./wan-watchdog.sh: line 17: can't create /sys/class/leds/gl-ar750s:white:usbpower/brightness: nonexistent directory
./wan-watchdog.sh: line 19: can't create /sys/class/leds/gl-ar750s:white:usbpower/brightness: nonexistent directory
root@GL-AR750S:~#
I had the same problem with my Slate router (no EasyTether reconnect on router reboot) and found this thread. I wanted to reply to confirm that the script and cron task from @alzhao work perfectly for me. Thanks for the great support!
Would this need any modification for a GL-AXT1800? I recently had a power outage and experienced the same issue. And could I get more detail on exactly how to add this script?