5

I have been trying set up USB modem on my pi (Raspberry Pi 3 Model B+) but have not been successful. The modem in itself is recognized - lsusb shows the entry for the device - but I cant't get it connected to the Internet. I have a SIM card with a valid contract in the modem so that is not the problem. I would appreciate any help or advice on this.

I loosely followed this article, which ends with successfully using the exact same modem. But it didn't quite work out for me.

https://www.niandc.co.jp/sol/tech/date20151005_512.php

1. Checking USB device mode

First, My modem is probably in the modem mode, not the storage device mode. The id is the same 1004:6326 shown in the article.

2. modprobe command

Next is modprobe command. At first, /dev/tty does not have ttyUSB* files, but after running 'sudo modprobe' command, the following 4 files were created in /dev/.

crw-rw---- 1 root dialout 188,  0 Oct 10 07:07 /dev/ttyUSB0
crw-rw---- 1 root dialout 188,  1 Oct 10 07:03 /dev/ttyUSB1
crw-rw---- 1 root dialout 188,  2 Oct 10 07:03 /dev/ttyUSB2
crw-rw---- 1 root dialout 188,  3 Oct 10 07:03 /dev/ttyUSB3

This step looks the same with the article above and is probably working fine. Also this behavior is consistent; every time I boot the rpi there are no /dev/ttyUSB* files and executing the modprobe command always creates four ttyUSB files above.

3. cu and wvdial

Next I tried two things but neither worked.

3-a. cu command

In the article, 'cu' command is used to confirm the connection so I tried it. I couldn't find which ttyUSB file maps to the modem, so I ran cu on all 4 ttyUSB? files.

cu command on different /dev/ttyUSB? files produces different results;

sudo cu -l ttyUSB0

→ Says 'Line in use and ttyUSB2'

sudo cu -l ttyUSB1
sudo cu -l ttyUSB3

→ Both print 'Connected.' and freeze

sudo cu -l ttyUSB2

→ Prints error messages below:

cu: Stale lock /var/lock/LCK..ttyUSB2 held by process 6807 created 2018-10-11 13:20:14
cu: remove (/var/lock/LCK..ttyUSB2): Operation not permitted
cu: /dev/ttyUSB2: Line in use

3-b. wvdial

sudo wvdial on /dev/ttyUSB0 to /dev/ttyUSB3 all results in '--> Modem not responding.'

Update (Oct. 21, 2018)

As I stated in the comment, I should have checked the compatibility more thoroughly. Maybe there is not point anymore but here is lsusb and wvdial.conf

lsusb

'Device 005' is the USB modem

Bus 001 Device 005: ID 1004:6327 LG Electronics, Inc.
Bus 001 Device 004: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub   
wvdial.conf
[Dialer Defaults]
    Modem = /dev/ttyUSB3
    ISDN = 0
    Modem Type = Analog Modem
    Baud = 460800
    Init1 = ATX3
    Init2 = AT&F Q0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
    Init3 = at+cgdcont=1,"IP","i-aeonmobile.com"
    Phone = *99#
    Dial Attempts = 5
    Stupid Mode = on
    Dial Command = ATDT
    Idle Seconds = 7200
    Ask Passwords = 0
    Password = "0000"
    Username = "user"
    Carrier Check = on
    New PPPD = 1
    Auto DNS = on
4
  • It seem to me that it is working, only that you don't know what to do next? After the text Connected, you are in the AT command interpreter. You should be able to type ATI and get some info.
    – not2qubit
    Oct 14, 2018 at 14:16
  • What is the ouput of lsusb? Also post the content of etc/wvdial.conf: and make sure it reads Modem = /dev/ttyUSB1 or 3. Then once you have connected message you need to fire up wvdial. and show all commands you used. (and the output)
    – not2qubit
    Oct 14, 2018 at 14:24
  • Did you look at this and this and this?
    – not2qubit
    Oct 14, 2018 at 14:31
  • Thanks for the advice, and sorry for not being responsive. I found that I might have got a SIM which is not compatible with the USB modem. I am deeply embarrassed by this. I am trying to get a confirmation if this is the case, but it is likely incompatible. Oct 20, 2018 at 18:57

1 Answer 1

1

I finally managed to get the modem working.(Yes the modem and the SIM card turned out to be compatible; I confirmed it on Windows using the vendor's driver)

I've got two things to report.

1. Device file

I didn't notice this at first but found that running 'modprobe usbserial' creates a symbolic link as well as 4 ttyUSB* files (ttyUSB0 to 3) under /dev.

lrwxrwxrwx  1 root root           7 Nov  1 08:21 gsmmodem -> ttyUSB2

So this means ttyUSB2 is likely the modem if I have only one modem on the pi's USB ports.

2. wvdial.conf

wvdial worked after I edited two parts of it. One is to change the value of Modem to /dev/gsmodem I found above. The other is Init1 to Init4 lines. These strings are sent to the modem to initialize it when wvdial command is executed. As such, it could be that this is specific to the modem and perhaps also the region/country where the modem is used (I live in Japan). Either way, after changing these two parts, wvdial.conf looks like this and it works.

[Dialer Defaults]
    Modem = /dev/gsmmodem
    ISDN = 0
    Modem Type = Analog Modem
    Baud = 460800
    Init1 = ATH
    Init2 = AT+CFUN=1
    Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FClASS=0
    Init4 = at+cgdcont=1,"IP","n-aeonmobile.com"
    Phone = *99***1#
    Dial Attempts = 5
    Stupid Mode = on
    Dial Command = ATDT
    Idle Seconds = 7200
    Ask Passwords = 0
    Password = "0000"
    Username = "[email protected]"
    Carrier Check = on
    New PPPD = 1
    Auto DNS = on

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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