I have a Beryl GL-MT1300 and need to power off and on the USB based on a schedule. It seems that the 4g modem that I have connected to it needs an actual reboot every so often and this is at a remote location (so I can't just unplug it to reset it). Is there a script or something that I can do in Luci to accomplish this using cron?
I forgot to note the uptime on the Beryl before I rebooted it. That may have given me a clue about the modem having issues because maybe a reboot caused it but I'm not thinking that was the case.
I tried a reboot of the router (Beryl). Then a disconnect/reconnect of the tether device (4g modem). Neither of those actions allowed the 4g modem to connect again. The only thing that worked was physically disconnecting the 4g modem for about a minute and then plugging it back in. This is why I am asking about power off/on for the USB port.
Firmware is 4.3.19
Reboot (router) schedule is set to off (until I know for sure that it won't affect the 4g modem).
Thanks, I'll try that out with another GL.Inet router that I purchased for testing. It's an Opal and so fairly cheap but it may be able to help me debug and try it out.
#changing directories and checking to see what is there
root@GL-A1300:/sys/class/leds# cd /sys/class/gpio/
root@GL-A1300:/sys/class/gpio# ls
export gpiochip412 unexport usb_power
#checking to see if the state of a pin
root@GL-A1300:/sys/class/gpio# cat /sys/class/gpio/gpio8/value
cat: can't open '/sys/class/gpio/gpio8/value': No such file or directory
#trying to create based on link you provided
root@GL-A1300:~# echo 8 > /sys/class/gpio/export
ash: write error: Invalid argument
#tried to see what usb_power might do
root@GL-A1300:/sys/class/gpio# /sys/class/gpio/usb_power
-ash: /sys/class/gpio/usb_power: Permission denied
It's not going to kill a flash drive while it's plugged in to a USB port as it doesn't get hot enough. Ive had a flash drive plugged in to a router for over 5 yeas and still works.
The hardware design of the USB interface of each device may be different.
We d like to check to see if the MT1300 supports disabling and enabling USB. Please await.
but I suppose if part of the schedule process had an unmount before turning power off then it would at least not potentially cause issues with a USB drive.
Is there more to add on this? Iām now stuck having to drive out to a remote site because the USB 4g modem connected to my router has likely stopped responding again. Would be great if I could just schedule a power on/off recycle of the port on a weekly or daily schedule. As it is, the device has been offline for 17 hours now. Grrr
Any help on a more resilient solution would be greatly appreciated. Thanks
Given that you have a task schedule to control the LED's on/off state, WiFi Power, it might be interesting to implement a similar schedule for the USB ports too.