4G USB Modem - D-Link DWM-222 supported but not working

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Tue Mar 07, 2017 9:43    Post subject: 4G USB Modem - D-Link DWM-222 supported but not working Reply with quote
I've been trying to setup a 4G LTE Modem - D-Link DWM222

The modem should be supported according to the wiki:
https://www.dd-wrt.com/wiki/index.php/3G_/_3.5G#D-Link
DWM-222 A1 LTE CAT4 2001:ab00 2001:7e35 2 1 5 0 serial (& qmi) generic

DD-WRT v3.0-r31544 std (02/28/17)

there are several issues:
- mode switch is not done automatically (solved - see below)
The vendor and device id correspond but usb_modeswitch is not triggered automatically
when manually triggered, the mode switch is successfull and the device id changes as expected in the wiki
I've seen that lots of the supposed to be supported modems are missing here: http://svn.dd-wrt.com/browser/src/router/libutils/lib3g.c?rev=
http://svn.dd-wrt.com/ticket/5759

- connection is not established (not solved)
this might be due to missing part in qmi driver

Any Ideas?

Code:

root@DD-WRT:~# lsusb
Bus 001 Device 002: ID 2001:ab00
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
Bus 003 Device 001: ID 1d6b:0002
Bus 004 Device 001: ID 1d6b:0003
root@DD-WRT:/tmp# cat /tmp/comgt* /tmp/ppp/options.pppoe
comgt 01:03:08 -> -- Error Report --
comgt 01:03:08 -> ----> ^
comgt 01:03:08 -> Error @0, line 1, Could not open scriptfile "CGATT".
. (1)

Trying list of devices
Unable to locate default devices, try the -d option.
defaultroute
usepeerdns
noipdefault
noauth
ipcp-max-failure 30
crtscts
460800
connect "COMGTDIAL='ATD*99***1#' /usr/sbin/comgt DIAL -d  >/tmp/comgt.out 2>&1"

root@DD-WRT:/tmp# usb_modeswitch -J -K -v 2001 -p ab00
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 002 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: Mobile Connect
     Product: Mobile Connect
  Serial No.: f2bdedab74ee
-------------------------
Warning: MessageContent/StandardEject ignored; can't combine with special mode
Using standard Huawei switching message
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Read the response to message 1 (CSW) ...
 Device seems to have vanished after reading. Good.
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!

root@DD-WRT:/tmp# lsusb
Bus 001 Device 003: ID 2001:7e35
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
Bus 003 Device 001: ID 1d6b:0002
Bus 004 Device 001: ID 1d6b:0003
root@DD-WRT:/tmp# cat /tmp/comgt* /tmp/ppp/options.pppoe
comgt 01:04:58 -> -- Error Report --
comgt 01:04:58 -> ----> ^
comgt 01:04:58 -> Error @0, line 1, Could not open scriptfile "CGATT".
. (1)

Setting Connection mode '0'
Variant #2 Huawei
Error sending 'ATYSCFG=2,0,3FFFFFFF,2,4'
Trying list of devices

Dialling with custom string:ATD*99***1#

FINITO
defaultroute
usepeerdns
noipdefault
noauth
ipcp-max-failure 30
crtscts
460800
connect "COMGTDIAL='ATD*99***1#' /usr/sbin/comgt DIAL -d /dev/usb/tts/1 >/tmp/comgt.out 2>&1"
/dev/usb/tts/1
root@DD-WRT:/tmp# nvram show | grep -i 3g
size: 36406 bytes (29130 left)
3gdata=/dev/usb/tts/1
3gnmvariant=2
wan_proto=3g
root@DD-WRT:/tmp#
Sponsor
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7631

PostPosted: Wed Mar 08, 2017 4:44    Post subject: Re: 4G USB Modem - D-Link DWM-222 supported but not working Reply with quote
hackler756 wrote:

The vendor and device id correspond but usb_modeswitch is not triggered automatically


The initial id 2001:ab00 is on my list for next lib3g.c update later this month.

hackler756 wrote:

I've seen that lots of the supposed to be supported modems are missing here: http://svn.dd-wrt.com/browser/src/router/libutils/lib3g.c?rev=


Lots of? I don't think so, please specify which so I can include them when updating lib3g

_________________
Kernel panic: Aiee, killing interrupt handler!
hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Mon Mar 13, 2017 22:26    Post subject: Reply with quote
here is the comparison: 49 vs 1009 - just a few Cool

Code:

# fetch dd-wrt mobile broadband Device Wiki and parse file, fetch current revision of lib3g.c from svn repo
curl "https://www.dd-wrt.com/wiki/index.php/Mobile_Broadband" 2>/dev/null | tail +240 | grep -i -e '<a name=\"\|</\?TABLE\|</\?TD\|</\?TR\|</\?TH' | sed 's/<a name=\"/<table><tr><td>****** COMPANY - /Ig' | sed 's/\"><\/a>.*$/<\/td><\/tr><\/table>\n/Ig' | sed 's/>[\ \t\n]*/>/g' | tr -d '\n' | sed 's/<\/TR[^>]*>/\n/Ig'  | sed 's/<\/\?\(TABLE\|TR\)[^>]*>//Ig' | sed 's/^<T[DH][^>]*>\|<\/\?T[DH][^>]*>$//Ig' | sed 's/<\/T[DH][^>]*><T[DH][^>]*>/,/Ig' | grep -v "Model,Vendor,3G Standard,Default Id,Modem Id,User" > ddwrt_mb_devices
curl "http://svn.dd-wrt.com/browser/src/router/libutils/lib3g.c?format=txt" 2>/dev/null >lib3g.c
# validate IDs and compare
IFS_OLD=$IFS
IFS=$'\n'
for i in $(cat ddwrt_mb_devices); do
if [[ $i == "****** COMPANY - "* ]]; then echo $i; continue; fi
ven_id=`echo "${i}" | cut -d"," -f5 | cut -d":" -f1 | grep -E "^[a-f0-9]{4}$"`
dev_id=`echo "${i}" | cut -d"," -f5 | cut -d":" -f2 | grep -E "^[a-f0-9]{4}$"`
if [ "$ven_id" == "" -o "$dev_id" == "" ]; then echo "ID is missing or malformed: "$i; continue; fi
grep -i "${ven_id}" lib3g.c | grep -i "${dev_id}" | grep -v -e "^\/\/" | grep -v -i "not yet in driver" > /dev/null && { printf "found: ";echo $i; } || { printf "NOT found: "; echo $i; }
done > result_list.txt
IFS=$IFS_OLD

$ grep -e "^found: " result_list.txt | wc -l
1009

$ grep -e "^NOT found: " result_list.txt | grep -v -i "wip" | wc -l
49

$ grep -e "^ID is missing or malformed: " result_list.txt | wc -l
46


I'll post the AT Commands for the DWM-222 A1 shortly ...



result_list.txt
 Description:

Download
 Filename:  result_list.txt
 Filesize:  94.54 KB
 Downloaded:  997 Time(s)

LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7631

PostPosted: Tue Mar 14, 2017 8:49    Post subject: Reply with quote
hackler756 wrote:
here is the comparison: 49 vs 1009 - just a few Cool



Your script counts wrong Very Happy

Read the text in the wiki before the table, "wip" devices can not be supported either because dd-wrt does not support their type of protocols or because some info is missing (USB ID, interface layout, protocol type, or mode switching method).

I counted 38 possible candidates in your result_list and the outcome was:

1 USB ID typo in lib3g
7 missing "wip" in the wiki (corrected now)
12 devices added to my work copy of lib3g
2 devices pending (should probably not be in the wiki)
16 false hits ("also qmi but not yet in driver")

_________________
Kernel panic: Aiee, killing interrupt handler!
hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Tue Mar 14, 2017 10:07    Post subject: Reply with quote
cool - thanks LOM!

wrong counts Shocked - it's absolutly possible

1) WIPs were NOT counted - it's a grep -v
$ grep -e "^NOT found: " result_list.txt | grep -v -i "wip" | wc -l
49 vs. 197 incl. WIP

2) all devices are counted as "NOT found" if config line is commented like
// {0x19d2, 0x1023, NULL, NULL, NULL, 0 | ETH, NULL, "ZTE K4201-Z (modem)"},
bad example - device is WIP ... so not counted Smile

3) false positives ...
I've included all "not yet in driver" as my DWM-222 is not working
{0x2001, 0x7e35, "option", "2", "1", 2 | GENERIC, NULL, "D-Link DWM-222 A1 (modem)"}, // also qmi but not yet in driver

let me know what you need to fix the Dlink DWM-222
hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Tue Mar 14, 2017 10:25    Post subject: Reply with quote
AT Command Trace of DWM-222

PIN Query / PIN Status
Initialisation
Status (IMSI, IMEI, Firmware, etc)
Network Info (ID, Signal Strength, HPLMN)
Connection
Connection Infos IP, Traffic Stats
Disconnection
SMS and Contacts readout



dwm-222 rs232 trace.txt
 Description:

Download
 Filename:  dwm-222 rs232 trace.txt
 Filesize:  35.83 KB
 Downloaded:  1066 Time(s)

hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Fri Mar 17, 2017 13:12    Post subject: Reply with quote
LOM wrote:

1 USB ID typo in lib3g
7 missing "wip" in the wiki (corrected now)
12 devices added to my work copy of lib3g
2 devices pending (should probably not be in the wiki)
16 false hits ("also qmi but not yet in driver")


Please push these source changes to svn.dd-wrt.com.
Will get back with feedback right after the next build.
hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Tue Mar 21, 2017 12:00    Post subject: Reply with quote
Thanks for your effort LOM!

lib3g.c update to repo is pending:
http://svn.dd-wrt.com/ticket/5779

I'll provide feedback here after the next dd-wrt build.

Update on the stats: only 1 device not found from current supported devices list in updated lib3g.c:
not found: GTM501,,HSDPA 7.2 HSUPA 5.76,0af0:d035,0af0:d035,,,,,hso,minicard

updated script - check on the correct correct source for lib3g.c (currently SVN Ticket 5779)

Code:

# fetch dd-wrt mobile broadband Device Wiki and parse file, fetch current revision of lib3g.c from svn repo
echo "fetching router list"
curl "https://www.dd-wrt.com/wiki/index.php/Mobile_Broadband" 2>/dev/null | tail +240 | grep -i -e '<a name=\"\|</\?TABLE\|</\?TD\|</\?TR\|</\?TH' | sed 's/<a name=\"/<table><tr><td>****** COMPANY - /Ig' | sed 's/\"><\/a>.*$/<\/td><\/tr><\/table>\n/Ig' | sed 's/>[\ \t\n]*/>/g' | tr -d '\n' | sed 's/<\/TR[^>]*>/\n/Ig'  | sed 's/<\/\?\(TABLE\|TR\)[^>]*>//Ig' | sed 's/^<T[DH][^>]*>\|<\/\?T[DH][^>]*>$//Ig' | sed 's/<\/T[DH][^>]*><T[DH][^>]*>/,/Ig' | grep -v "Model,Vendor,3G Standard,Default Id,Modem Id,User" > ddwrt_mb_devices
echo "fetching lib3g.c"
# lib3g.c from LOMs Ticket
curl http://svn.dd-wrt.com/raw-attachment/ticket/5779/lib3g.c 2>/dev/null >lib3g.c
# lib3g.c from SVN - current revision
#curl "http://svn.dd-wrt.com/browser/src/router/libutils/lib3g.c?format=txt" 2>/dev/null >lib3g.c
# validate IDs and compare
IFS_OLD=$IFS
IFS=$'\n'
echo "parsing ..."
for i in $(cat ddwrt_mb_devices); do
  if [[ $i == "****** COMPANY - "* ]]
  then
    echo "skipping company line:" $i
    continue
  fi
  ven_id=`echo "${i}" | cut -d"," -f5 | cut -d":" -f1 | grep -E "^[a-f0-9]{4}$"`
  dev_id=`echo "${i}" | cut -d"," -f5 | cut -d":" -f2 | grep -E "^[a-f0-9]{4}$"`
  if [ "$ven_id" == "" -o "$dev_id" == "" ]
  then
    echo "ID is missing or malformed: "$i
    continue
  fi
  x=`grep -i "${ven_id}" lib3g.c | grep -i "${dev_id}"`
  # if marked as WIP ( work in progress ) this takes priority
  if [[ $i == *"wip"* ]]
  then
    printf "wip: "
  else
    case "$x" in
      *"not yet in driver"*) printf "not yet in driver: ";;
      ^//*) printf "commented: ";;
      "") printf "not found: ";;
      *) printf "found: ";;
    esac
  fi
  echo $i
done | tee result_list.txt
IFS=$IFS_OLD

echo "summary"
cat result_list.txt | cut -d":" -f1 | sort | uniq -c


result:
summary
979 found
46 ID is missing or malformed
1 not found
27 not yet in driver
46 skipping company line
199 wip
hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Fri Mar 24, 2017 10:30    Post subject: Reply with quote
update lib3g.c is still pending to svn repo Sad ...

!!! Please include the fix attached to http://svn.dd-wrt.com/ticket/5779 !!!

Couldn't find other options from the Mobile Broadband Wiki ...
the DLINK DWM-222 will be the only 4G LTE Cat4 modem that is directly supported by DD-WRT and actually available.

Huawei E3372 does not work - current versions can't be flashed back to 21.x Firmware (Modem / Bridge).
manged to get USB Modeswitch working for HiLink Mode - but even small datastreams with just a couple of MB are very unstable (TCP Retransmitts, Dupplicates).

The other supported options are not available anymore or branded:
E3272s-153
E3276
E3276s-151
K5007


Last edited by hackler756 on Fri Mar 24, 2017 15:26; edited 1 time in total
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7631

PostPosted: Fri Mar 24, 2017 13:44    Post subject: Reply with quote
hackler756 wrote:


Couldn't find other options from the Mobile Broadband Wiki ...
the DLINK DWM-222 will be the only 4G LTE Cat4 modem that is directly supported by DD-WRT and actually available.



You will not get any LTE speed from serial ppp dialup, only 20-30Mbps (depends on how powerful the cpu in the dongle is and how powerful the cpu in the router is).

There is no linux support for it from the manufacturer and no one has tested and confirmed that the qmi interface is working under linux so it is not currently supported by the linux qmi_wwan driver.
It is not even included in the linux serial driver so dd-wrt's serial support is based on the serial drivers ability to support usb id's on-the-fly via the newid function.

The dongle uses a mix of standard AT cmds and BroadMobi's (the real mfgr) proprietary AT cmds which are undocumented.
From what I can see, you will not be able to select preferred network mode (LTE, UMTS, GSM, ANY) since it is done with a cmd from the proprietary cmd set but with some luck the modem might do it automagically by itself.

_________________
Kernel panic: Aiee, killing interrupt handler!
hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Fri Mar 24, 2017 13:59    Post subject: Reply with quote
I'm looking for just one! working LTE CAT4 (or higher) modem that is supported my DD-WRT and is commercially available ...

I'm happy to look into any alternative to the DLink DWM-222 ...

BTW: Huawei E3372 is no alternative - you need a hacked firmware for modem / bridge mode which can't be installed on current models anymore.
E3372 HILink can be used with USB Modeswitch and DD-WRT but it is not stable for even the smallest data streams of a few MB ...
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7631

PostPosted: Sat Mar 25, 2017 2:40    Post subject: Reply with quote
hackler756 wrote:
I'm looking for just one! working LTE CAT4 (or higher) modem that is supported my DD-WRT and is commercially available ...



I don't know your budget or where you have tried to source your modem but there must be more than 3-4 to choose between among all dd-wrt supported modems, even if you limit your selection to LTE modems.

You should choose a qmi modem, they don't suffer from ppp speed limitation or proprietary cmd sets.
With unlimited budget I would buy the Sierra MC7455 minipcie card and an usb-to-pcie adapter.
MC7455 is LTE CAT6 and has worldwide frequency band support.

Alternatively you test the DWM-222 in qmi mode on a linux desktop by patching the qmi_wwan driver, then you submit a patch to the qmi_wwan and option driver maintainers. D-Link won't do it so someone has to be the first. Is that you? Cool

_________________
Kernel panic: Aiee, killing interrupt handler!
hackler756
DD-WRT User


Joined: 17 Sep 2014
Posts: 62
Location: Austria

PostPosted: Tue Apr 04, 2017 15:09    Post subject: Reply with quote
an ebay case (usb adapter) for the EM7455 should be arriving soon Very Happy
until then the patched up the old huawei e372 - black tantalums are yellow again - thanks digikey.
yet another obstacle - i had to downgrade to DD-WRT v3.0-r28815M kongac (01/15/16) for the e372 to work.

again - e372 is listed as working ... granted - the DD-WRt version is not mentioned.

i'm still thinking about taking on the whole effort - especially since parts of DD-WRT are closed source ...
Bedrock
DD-WRT Novice


Joined: 15 Mar 2012
Posts: 8

PostPosted: Fri Aug 25, 2017 9:25    Post subject: Reply with quote
Any solution from anyone?
I have a dwm-222 and wndr4500v2 and r6300v1, I try dd-wrt 31825 and tomato shibby 1.40. Not working. When I bought first I try wndr4500v2@shibby1.40, its work (HSDPA+), after I try in notebook(windows). Since then plug in computer it does not work in router just in computer.
UPDATE: See the next post.
(Sorry for my english.)


Last edited by Bedrock on Sat Aug 26, 2017 16:56; edited 1 time in total
Bedrock
DD-WRT Novice


Joined: 15 Mar 2012
Posts: 8

PostPosted: Sat Aug 26, 2017 14:35    Post subject: Reply with quote
I found a (half) solution @ Tomato Shibby (140). Thats work in HSDPA+ speed. (See my settings in attachments.)
Important: USB Storage support disabled! The USB Printer support enable because need hotplug script. (If you do not want every plug in login to admin/ssh/telnet console and run manual. Smile )



usb_support.png
 Description:
USB Settings
 Filesize:  20.18 KB
 Viewed:  13233 Time(s)

usb_support.png



wan_settings.png
 Description:
WAN Settings
 Filesize:  14.15 KB
 Viewed:  13243 Time(s)

wan_settings.png


Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum