What's new

How to reset USB port or USB modem?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Pila

Regular Contributor
As my router (56) gets confused after external WAN IP address change and shuts down outbound communication, I need a way to:

a) make my USB modem hung up and/or redial

b) shut down my USB port and restart it (modem will redial automatically)

from a script. Can someone help me as I am unable to do so?
 
What router do you have? What firmware version? What USB modem? What ISP?

I hope others can help answer your question(s), but the missing information makes me think they won't be able to. ;)
 
What router do you have? What firmware version? What USB modem? What ISP?

I did not put that info here originaly as it is irellevant. This is a pure Linux script question dependant on Linux implementation at Asus routers. Same as a reboot of my router whcih I want to avoid: type reboot :) in any case.

For modem hang and dial: ath and atd are the same as they were 50+ years ago, but I see / know of no way to issue them directly. Killing and restarting an USB port must be the same procedure regardles of what is connected to it - i was just not able to do it properly for Asus router.

But: Asuswrt-Merlin RT-AC56U_380.59_0
Modems: 3g Huawei E3131 (currently used, single NAT) and 4g Huawei K5150 Vodafone (double NAT). ISP VIPnet Croatia.
 
Last edited:
No it is not a pure Linux script question, it is a matter of controlling hardware from a script and that is very far from just being a script matter. There is AFAIK no generic Linux command to turn on or off an USB port. I looked around a lot for this before because an USB cell modem I used for sending SMS needed to be reconnected once or twice a week.
 
OK, true. I can kill my active USB modem link link several wways: unbind / bind, echo 0 > authorized or usb_modeswitch -v 12d1 -p 1506 -R

But: I do not know how to make it dial as after reset it does auttomatically. Where is the dialer?
 
What I meant, I do not need someone to walk me throught every step. I just need to know which command I need to dial the USB modem from a script.

But, judging from many replies, I can only use Raspberry to kill the power in the modem USB cable :(
 
OK, true. I can kill my active USB modem link link several wways: unbind / bind, echo 0 > authorized or usb_modeswitch -v 12d1 -p 1506 -R

For me, those tricks didn't work. I still had to remove the modem from the port.

I think the dialing is performed by pppd (if it uses regular dialup). If the modem emulates a network interface the dialup should be performed by the modem itself.
 
For me, those tricks didn't work. I still had to remove the modem from the port.

Me to. Or reboot entire router which is not exactly alegant solution.

I think the dialing is performed by pppd (if it uses regular dialup). If the modem emulates a network interface the dialup should be performed by the modem itself.

My modem does not dial after any of the commands I mentioned before. Only after it gets disconected from power. Or maybe Router dials, I do not know. I will try looking for this pppd.
 
Why the commands:

> sh -c 'echo 2-2 > /sys/bus/usb/drivers/usb/unbind'

> sh -c 'echo 2-2 > /sys/bus/usb/drivers/usb/bind'

do not turn USB modem off and back on?
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top