1

I'm trying to configure 3G USB dongle as backup solution to WiFi. Using Raspberry 4b, latest raspbian in which seems usb 3G dongles automatically converted to modems as I see. So I'm skipping usb-modeswitch part and trying to connect through wvdial. Connection seems successfull but in few seconds - disconnect. Highly appreciate any help.

I'm using Huawei E372 or Huawei E397B - same result. Initially it connects already as modem (1506)

pi@raspberrypi:~/3g $ lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 014: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~/3g $ ls -al /dev/gsm*
-rw-r--r-- 1 root root 0 Dec 25 11:33 /dev/gsmmodem
lrwxrwxrwx 1 root root 7 Dec 25 11:48 /dev/gsmmodem2 -> ttyUSB0

wvdial config:

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","internet",,0,0
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *99***1#
Modem = /dev/gsmmodem
Username = { }
Password = { }
New PPPD = yes
Baud = 460800

connection:

pi@raspberrypi:~/3g sudo wvdial
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","internet",,0,0
AT+CGDCONT=1,"IP","internet",,0,0
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Wed Dec 25 11:33:39 2019
--> Pid of pppd: 22588
--> Using interface ppp0
--> pppd: X[1f]�[01]X[1f]�[01]
--> pppd: X[1f]�[01]X[1f]�[01]
--> pppd: X[1f]�[01]X[1f]�[01]
--> pppd: X[1f]�[01]X[1f]�[01]
--> pppd: X[1f]�[01]X[1f]�[01]
--> pppd: X[1f]�[01]X[1f]�[01]
--> pppd: X[1f]�[01]X[1f]�[01]
--> Disconnecting at Wed Dec 25 11:33:42 2019
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 5 seconds
--> Cannot open /dev/gsmmodem: No such file or directory
--> Cannot open /dev/gsmmodem: No such file or directory
--> Cannot open /dev/gsmmodem: No such file or directory
--> Disconnecting at Wed Dec 25 11:33:43 2019

log:

Dec 25 11:33:47 raspberrypi kernel: [58307.025422] usb 1-1.2: Product: HUAWEI Mobile
Dec 25 11:33:47 raspberrypi kernel: [58307.025435] usb 1-1.2: Manufacturer: Huawei Technologies
Dec 25 11:33:47 raspberrypi kernel: [58307.028680] usb-storage 1-1.2:1.0: USB Mass Storage device detected
Dec 25 11:33:47 raspberrypi kernel: [58307.029145] scsi host0: usb-storage 1-1.2:1.0
Dec 25 11:33:47 raspberrypi mtp-probe: checking bus 1, device 13: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2"
Dec 25 11:33:47 raspberrypi mtp-probe: bus: 1, device: 13 was not an MTP device
Dec 25 11:33:47 raspberrypi mtp-probe: checking bus 1, device 13: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2"
Dec 25 11:33:47 raspberrypi mtp-probe: bus: 1, device: 13 was not an MTP device
Dec 25 11:33:47 raspberrypi usb_modeswitch: switch device 12d1:1505 on 001/013
Dec 25 11:33:47 raspberrypi kernel: [58307.818077] usb 1-1.2: USB disconnect, device number 13
0

Found an answer. Instead of Modem = /dev/gsmmodem or Modem = /dev/ttyUSB0 need to set Modem = /dev/ttyUSB2 - it's not obvious and depends on modem type I guess. Nevertheless it states gsmmodemm on USB0:

pi@raspberrypi:~ $ ls -al /dev/gsm*
lrwxrwxrwx 1 root root 7 Dec 25 20:32 /dev/gsmmodem -> ttyUSB0

To figure out which port to dial - just run automatic wvdial configuratiin - sudo wvdialconf and pick up last one.

Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB0<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Max speed is 9600; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
ttyUSB2<*1>: ATQ0 V1 E1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB2<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB2<*1>: Speed 9600: AT -- OK
ttyUSB2<*1>: Max speed is 9600; that should be safe.
ttyUSB2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0<Info>: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
ttyUSB2<Info>: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

| improve this answer | |
0

USB modem connections usually get disconnected due to poor signal strength.

I have written a daemon script to reconnect it if it gets disconnected.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.