Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
isaac
Posts: 5
Joined: 02 Mar 2015, 00:24

DWM 156 fails at ATDT*99#

Post by isaac » 02 Mar 2015, 00:44

Hi,

I am trying to use D-Link DWM-156 on my ARM board to access Internet.
Here is my wvdial.conf:

Code: Select all

[Dialer Defaults]
Phone = 
Username = 
Password = 
New PPPD = yes

[Dialer mtn]

Init1 = ATZ 
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","internet"

Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *99#
Modem = /dev/ttyUSB0
Username = { }
Password = { }
Baud = 921600
By running sudo wvdial mtn on my PC, I can connect to Internet on 3G.
But when I try this command on my ARM board (running lubuntu kernel 3.4.79), it fails. Here is the output:

Code: Select all

linaro@cubietruck:~$ sudo wvdial mtn
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
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","mtnirancell"
AT+CGDCONT=1,"IP","mtnirancell"
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
ERROR
OK
--> Invalid dial command.
--> Disconnecting at Sun Mar  1 22:38:37 2015

Here is the lsusb:

Code: Select all

linaro@cubietruck:~$ lsusb 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 003: ID 2001:7d01 D-Link Corp. 
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
This is messages shown up in dmesg after connecting the USB Modem:

Code: Select all

linaro@cubietruck:~$ dmesg
[code][ 4227.094883] ehci_irq: port change detect
[ 4227.373656] usb 4-1: new high-speed USB device number 2 using sw-ehci
[ 4227.526809] scsi3 : usb-storage 4-1:1.0
[ 4228.526670] scsi 3:0:0:0: CD-ROM            HSPA USB SCSI CD-ROM      6225 PQ: 0 ANSI: 0 CCS
[ 4228.537447] sr0: scsi3-mmc drive: 0x/0x caddy
[ 4228.546755] sr 3:0:0:0: Attached scsi CD-ROM sr0
[ 4228.791382] ehci_irq: port change detect
[ 4228.795433] usb 4-1: USB disconnect, device number 2
[ 4229.343662] ehci_irq: port change detect
[ 4229.623657] usb 4-1: new high-speed USB device number 3 using sw-ehci
[ 4229.797248] option 4-1:1.2: GSM modem (1-port) converter detected
[ 4229.806876] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 4229.819354] option 4-1:1.3: GSM modem (1-port) converter detected
[ 4229.832177] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 4229.840851] option 4-1:1.4: GSM modem (1-port) converter detected
[ 4229.848964] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 4229.856329] option 4-1:1.5: GSM modem (1-port) converter detected
[ 4229.865938] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB3
[ 4229.892012] scsi4 : usb-storage 4-1:1.6
[ 4230.898800] scsi 4:0:0:0: Direct-Access     HSPA USB SCSI CD-ROM      6225 PQ: 0 ANSI: 0 CCS
[ 4230.920225] sd 4:0:0:0: [sda] Attached SCSI removable disk

I wonder what is missing/misconfigured on my ARM board and is causing this issue.
Any idea?

isaac
Posts: 5
Joined: 02 Mar 2015, 00:24

Re: DWM 156 fails at ATDT*99#

Post by isaac » 02 Mar 2015, 13:51

After some investigation, I noticed I am getting 99, 99 for AT+CSQ on the embedded board:

Code: Select all

AT+CSQ
+CSQ: 99, 99

OK
A typical signal quality I get on my Ubuntu PC is something like this for the same USB modem and SIM card:

Code: Select all

AT+CSQ
+CSQ: 25, 99

OK
Could this be a clue to the issue? How can I find the root cause of this problem?

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: DWM 156 fails at ATDT*99#

Post by Josh » 02 Mar 2015, 15:04

ATDT was for analogue modems.

Try ATD.

Edit: The problem may be different. Try this as the phone number:
*99***1#

(Found in this thread)

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: DWM 156 fails at ATDT*99#

Post by LOM » 03 Mar 2015, 05:17

isaac wrote: A typical signal quality I get on my Ubuntu PC is something like this for the same USB modem and SIM card:

Code: Select all

AT+CSQ
+CSQ: 25, 99

OK
Could this be a clue to the issue? How can I find the root cause of this problem?
I don't think you will get correct signal info until you are connected.

What linux kernel version does your Ubuntu PC run on?
What does NetworkManager say about the connection, direct ethernet (cdc_mbim) or ppp dialup via the ModemManager plugin?

My guess is that your Ubuntu PC uses the dongle in mbim mode and doesn't do ppp dialup ,I don't think your dongle even supports ppp dialup.
We have seen the same from other dongles in the new D-Link series (2001:7d0x), they have only worked in direct ethernet mode via the cdc_mbim driver.

isaac
Posts: 5
Joined: 02 Mar 2015, 00:24

Re: DWM 156 fails at ATDT*99#

Post by isaac » 05 Mar 2015, 12:25

Both ATD and ATDT gives an "ERROR" response. I've tried different numbers but they all failed.

Changing /dev/ttyUSB0 to /dev/ttyUSB1 gave me this error repeatedly:

Code: Select all

--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
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"
AT+CGDCONT=1,"IP","internet"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
NO CARRIER
--> No Carrier!  Trying again.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
NO CARRIER
--> No Carrier!  Trying again.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
NO CARRIER
--> No Carrier!  Trying again.
Changing /dev/ttyUSB0 to /dev/ttyUSB2 and /dev/ttyUSB3 gave me this:

Code: Select all

--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.
I suppose the modem is only available on /dev/ttyUSB0 (and probably /dev/ttyUSB1).

Josh wrote:ATDT was for analogue modems.

Try ATD.

Edit: The problem may be different. Try this as the phone number:
*99***1#

(Found in this thread)

isaac
Posts: 5
Joined: 02 Mar 2015, 00:24

Re: DWM 156 fails at ATDT*99#

Post by isaac » 05 Mar 2015, 12:56

I have a Ubuntu 14.04 installed in a VMWare on my PC. The uname -a output on this Ubuntu:

Code: Select all

Linux ubuntu 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13 15:49:09 UTC 2014 i686 i686 i686 GNU/Linux
The uname -a output on the embedded device:

Code: Select all

Linux cubietruck 3.4.79 #4 SMP PREEMPT Wed Sep 17 14:46:01 CST 2014 armv7l armv7l armv7l GNU/Linux
I've noticed a /dev/cdc-wdm0 is created on the PC when connecting the dongle, but it is not appeared on the embedded board. I hoped cdc-wdm0 is not critical for modem functionality and there is still the possibility to get this dongle working.


Here is a log from dmesg on Ubuntu PC after connecting the modem:

Code: Select all

isaac@ubuntu:~$

[ 1306.887960] usb 1-1: new high-speed USB device number 7 using ehci-pci
[ 1307.309502] usb 1-1: New USB device found, idVendor=2001, idProduct=7d01
[ 1307.309510] usb 1-1: New USB device strings: Mfr=9, Product=10, SerialNumber=0
[ 1307.309514] usb 1-1: Product: D-Link DWM-156
[ 1307.309517] usb 1-1: Manufacturer: D-Link,Inc  
[ 1307.388349] cdc_mbim 1-1:1.0: cdc-wdm0: USB WDM device
[ 1307.388572] cdc_mbim 1-1:1.0 wwan0: register 'cdc_mbim' at usb-0000:02:03.0-1, CDC MBIM, d6:96:c1:fc:81:57
[ 1307.403375] option 1-1:1.2: GSM modem (1-port) converter detected
[ 1307.403901] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 1307.405411] option 1-1:1.3: GSM modem (1-port) converter detected
[ 1307.405570] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 1307.418800] option 1-1:1.4: GSM modem (1-port) converter detected
[ 1307.418929] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 1307.434355] option 1-1:1.5: GSM modem (1-port) converter detected
[ 1307.434529] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[ 1307.449941] usb-storage 1-1:1.6: USB Mass Storage device detected
[ 1307.450255] scsi8 : usb-storage 1-1:1.6
[ 1308.486155] scsi 8:0:0:0: Direct-Access     HSPA USB SCSI CD-ROM      6225 PQ: 0 ANSI: 0 CCS
[ 1308.486486] sd 8:0:0:0: Attached scsi generic sg2 type 0
[ 1308.505352] sd 8:0:0:0: [sdb] Attached SCSI removable disk

And here is the output of successful wvdial on Ubuntu PC:

Code: Select all

isaac@ubuntu:~$ 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","mtnirancell"
AT+CGDCONT=1,"IP","mtnirancell"
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT 14400000
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Thu Mar  5 14:01:35 2015
--> Pid of pppd: 4535
--> Using interface ppp0
--> pppd: �Y�[08]�Y�[08]8Y�[08]
--> pppd: �Y�[08]�Y�[08]8Y�[08]
--> pppd: �Y�[08]�Y�[08]8Y�[08]
--> pppd: �Y�[08]�Y�[08]8Y�[08]
--> pppd: �Y�[08]�Y�[08]8Y�[08]
--> local  IP address 10.19.172.105
--> pppd: �Y�[08]�Y�[08]8Y�[08]
--> remote IP address 10.64.64.64
--> pppd: �Y�[08]�Y�[08]8Y�[08]
--> primary   DNS address 92.42.51.31
--> pppd: �Y�[08]�Y�[08]8Y�[08]
--> secondary DNS address 8.8.8.8
--> pppd: �Y�[08]�Y�[08]8Y�[08]

I disabled the LAN adapters on the VMWare Ubuntu and was just connected to internet by the dongle. Here is a screenshot of the connections (is this NetworkManager?): https://imgur.com/LMLzfDA

And here is the output of ifconfig on Ubuntu PC at that state:

Code: Select all

eth0      Link encap:Ethernet  HWaddr 00:0c:29:55:4e:5b  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:1960 errors:0 dropped:0 overruns:0 frame:0
          TX packets:185 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:201304 (201.3 KB)  TX bytes:18371 (18.3 KB)
          Interrupt:19 Base address:0x2000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:238 errors:0 dropped:0 overruns:0 frame:0
          TX packets:238 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:18006 (18.0 KB)  TX bytes:18006 (18.0 KB)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:10.20.102.68  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:46 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:21736 (21.7 KB)  TX bytes:3057 (3.0 KB)

LOM wrote:
isaac wrote: A typical signal quality I get on my Ubuntu PC is something like this for the same USB modem and SIM card:

Code: Select all

AT+CSQ
+CSQ: 25, 99

OK
Could this be a clue to the issue? How can I find the root cause of this problem?
I don't think you will get correct signal info until you are connected.

What linux kernel version does your Ubuntu PC run on?
What does NetworkManager say about the connection, direct ethernet (cdc_mbim) or ppp dialup via the ModemManager plugin?

My guess is that your Ubuntu PC uses the dongle in mbim mode and doesn't do ppp dialup ,I don't think your dongle even supports ppp dialup.
We have seen the same from other dongles in the new D-Link series (2001:7d0x), they have only worked in direct ethernet mode via the cdc_mbim driver.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: DWM 156 fails at ATDT*99#

Post by LOM » 05 Mar 2015, 15:41

isaac wrote:
I've noticed a /dev/cdc-wdm0 is created on the PC when connecting the dongle, but it is not appeared on the embedded board. I hoped cdc-wdm0 is not critical for modem functionality and there is still the possibility to get this dongle working.
cdc_mbim and its helper cdc-wdm are drivers introduced in kernel 3.8 but I don't think it is them who makes the ppp function working.
It is more likely that NetworkManager (in the upper right corner of your screenshot) has initialised the dongle in such a way that ppp works.

What comes to mind is the AT+CFUN cmd (google it) that NetworkManager issues to almost all dongles. Actually it checks first if the dongle is in minimal function mode or if it is in flight mode and in which case NetworkManager sets it to normal mode.
You can squeeze in the AT+CFUN? cmd in vwdials config file just before the ATDT cmd in order to check the current status, the reply should be a "1" and if it isn't then you need to issue the cmd AT+CFUN=1,0

isaac
Posts: 5
Joined: 02 Mar 2015, 00:24

Re: DWM 156 fails at ATDT*99#

Post by isaac » 30 Mar 2015, 15:50

Thanks LOM! AT+CFUN=1,0 did the trick. :-) I don't know how many more days I had to spend to figure this out.

There is still some stability issues (sometimes the wvdial freezes during connecting) but I guess that could be due to 3G/GPRS coverage and other issues. Thanks again

Post Reply