# ppp and u3g with dlink dwm-222



## mjl (Mar 25, 2022)

Hello

I have a DLink DWM-222 revision A2 USB LTE modem, which according to





						Mobile Broadband - DD-WRT Wiki
					






					wiki.dd-wrt.com
				



supports serial & qmi.

I've added the necessary usbdev entries

https://cgit.freebsd.org/src/commit/?id=a75444c14304e63a3b0369d01c86a077e98fc9f9

and the AT interface appears to be on port 2, i.e., /dev/cuaU0.2 as I can type AT commands and get responses returned to me.  I've configured ppp.conf as follows:


```
vfnz:
 set device /dev/cuaU0.2
 set phone *99\#
 set timeout 0
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT OK-AT-OK \\dATDT\\T TIMEOUT 10 CONNECT\\s150000000"
 set authname ""
 set authkey ""
 disable ipv6cp
 disable mppe
 disable vjcomp
 disable acfcomp
 disable deflate
 disable pred1
 disable protocomp
 disable lqr
```

I put the 150000000 after the connect expect clause because when I did this interactively with cu -l /dev/cuaU0.2 that was the string I got back from the modem.

I'm not having a lot of luck:

```
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: /dev/pts/0: dial vfnz
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: set device /dev/cuaU0.2
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: set phone *99#
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: set timeout 0
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: set dial ABORT BUSY ABORT NO\sCARRIER TIMEOUT 5 "" AT OK-AT-OK \dATDT\T TIMEOUT 10 CONNECT\s150000000
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: set authname
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: set authkey ********
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: disable ipv6cp
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: disable mppe
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: disable vjcomp
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: disable acfcomp
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: disable deflate
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: disable pred1
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: disable protocomp
Mar 25 15:43:28 pi ppp[1440]: tun0: Command: vfnz: disable lqr
Mar 25 15:43:28 pi ppp[1440]: tun0: Phase: bundle: Establish
Mar 25 15:43:28 pi ppp[1440]: tun0: Phase: deflink: closed -> opening
Mar 25 15:43:28 pi ppp[1440]: tun0: Phase: deflink: Connected!
Mar 25 15:43:28 pi ppp[1440]: tun0: Phase: deflink: opening -> dial
Mar 25 15:43:28 pi ppp[1440]: tun0: Chat: Phone: *99#
Mar 25 15:43:28 pi ppp[1440]: tun0: Chat: deflink: Dial attempt 1 of 1
Mar 25 15:43:28 pi ppp[1440]: tun0: Chat: Send: AT^M
Mar 25 15:43:28 pi ppp[1440]: tun0: Chat: Expect(5): OK
Mar 25 15:43:28 pi ppp[1440]: tun0: Chat: Received: AT^M^M
Mar 25 15:43:28 pi ppp[1440]: tun0: Chat: Received: OK^M
Mar 25 15:43:28 pi ppp[1440]: tun0: Chat: Send: ATDT*99#^M
Mar 25 15:43:30 pi ppp[1440]: tun0: Chat: Expect(10): CONNECT 150000000
Mar 25 15:43:40 pi ppp[1440]: tun0: Chat: Expect timeout
Mar 25 15:43:40 pi ppp[1440]: tun0: Warning: Chat script failed
Mar 25 15:43:40 pi ppp[1440]: tun0: Phase: deflink: dial -> hangup
Mar 25 15:43:40 pi ppp[1440]: tun0: Phase: deflink: Disconnected!
Mar 25 15:43:40 pi ppp[1440]: tun0: Phase: deflink: Connect time: 12 secs: 0 octets in, 0 octets out
Mar 25 15:43:40 pi ppp[1440]: tun0: Phase: deflink: 0 packets in, 0 packets out
Mar 25 15:43:40 pi ppp[1440]: tun0: Phase:  total 0 bytes/sec, peak 0 bytes/sec on Fri Mar 25 15:43:28 2022
Mar 25 15:43:40 pi ppp[1440]: tun0: Phase: deflink: hangup -> closed
Mar 25 15:43:40 pi ppp[1440]: tun0: Phase: bundle: Dead
Mar 25 15:43:43 pi ppp[1440]: tun0: Phase: /dev/pts/0: Client connection closed.
Mar 25 15:43:43 pi ppp[1440]: tun0: Phase: PPP Terminated (normal).
```
When I go back in with `cu -l /dev/cuaU0.2` after ppp gives up, I immediately receive:


```
[mjl@pi ~]$ sudo cu -l /dev/cuaU0.2
Connected
ATDT*99#
CONNECT 150000000
```

That is, for some reason, ppp is not getting the lines it expects, though the modem seems to be supplying them.  This is probably something pretty basic in my configuration that I've done wrong.  Any ideas?

Note: the modem does have the appropriate APN configured, so I elided it from my dial command:

```
[mjl@pi ~]$ sudo cu -l /dev/cuaU0.2
Connected
AT
OK
AT+CGDCONT?
+CGDCONT: 1,"IP","vodafone","0.0.0.0",0,0

OK
```

Thanks.


----------



## covacat (Mar 25, 2022)

try to set ATE0 in the init string
also set the chat script to look just for connect without baud rate
if it fails run ppp interactively 
like ppp isp
term
if you connect type ~p


----------

