2

I'm using an USB 3G/4G modem to access the Internet (connection with wvdial) but also to query my account usage, recharge and buy data offers with AT commands on the serial ports. Sometimes the modem just hangs and none of the /dev/ttyUSB0-3 respond. The only way to re-initialize the modem is to physically remove it and re-insert it in the USB port.

I'm wondering if there is a way to do the same initialization by software so that I would be able to include this in a recovery script.

I'm running on Ubuntu 16.04, 18.04 and Ransperian stretch and the modems I tested are from Qualcom and Huawei.

mszmurlo
  • 123
  • 4

1 Answers1

2

You could try unloading & re-loading the kernel module responsible for the modem's /dev/ttyUSB* device(s).

If that does not help, you might try uhubctl: a program that can control the per-port power switches of (some) USB hubs, including some root hubs. If your set-up allows controlling the power of the USB port the modem is connected to, switching it off and back on would be the strongest reinitialization you can do without physically disconnecting the modem.

telcoM
  • 4,153
  • 12
  • 23
  • 1
    Didn't try re-loading the modules but `uhubctl` works great on RPi. RPi is actually my primary target. Thanks – mszmurlo Aug 12 '18 at 15:28