Posted: Sat Feb 12, 2022 17:08 Post subject: Supported D-Link 4G USB dongle does not work
Good day everyone
I have a Linksys WRT610n v2 router running DD-WRT v3.0-r48141 mega (01/21/22) firmware
and a D-Link DWM-222 A2 dongle, which seems to be supported according to this table
From dmesg, I can see that initial detection and setup of the modem goes well, but no ttyUSB devices are created. As a result, a PPP interface is not created either. Also there is quite a lot of Unknown symbol errors from the related modules (cdc_acm, qmi_wwan, usb_wwan, sierra, etc.)
The modem works fine in Windows. Moreover, the router works flowlessly with exact same SIM card and exact same internet settings (APN, Dial String, etc.), but with an older 3G modem (Huawei E3531). However, I need to get this D-Link 4G modem to work. Is there anything I can try to make it work? Does it make sense to try an older firmware?
Jan 1 01:00:24 camgate daemon.notice pppd[1546]: pppd 2.4.8 started by root, uid 0
Jan 1 01:00:24 camgate daemon.info pppd[1546]: Exit.
Jan 1 01:00:25 camgate user.info : [ppp_redial] : redial process successfully started
Jan 1 01:01:08 camgate daemon.notice pppd[1886]: pppd 2.4.8 started by root, uid 0
Jan 1 01:01:08 camgate daemon.info pppd[1886]: Exit.
Jan 1 01:01:52 camgate daemon.notice pppd[2100]: pppd 2.4.8 started by root, uid 0
Jan 1 01:01:52 camgate daemon.info pppd[2100]: Exit.
Jan 1 01:02:35 camgate daemon.notice pppd[2319]: pppd 2.4.8 started by root, uid 0
Jan 1 01:02:35 camgate daemon.info pppd[2319]: Exit.
Jan 1 01:03:19 camgate daemon.notice pppd[2531]: pppd 2.4.8 started by root, uid 0
Jan 1 01:03:19 camgate daemon.info pppd[2531]: Exit.
Code:
root@camgate:~# dmesg
bootloader size: 262144
nvram size: 65536
Physically mapped flash: Filesystem type: squashfs, size=0x54474e
partition size = 5581824
Creating 5 MTD partitions on "Physically mapped flash":
0x000000000000-0x000000040000 : "cfe"
0x000000040000-0x0000007e0000 : "linux"
0x00000020d400-0x000000760000 : "rootfs"
mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
mtd: partition "rootfs" set to be root filesystem
0x0000007e0000-0x0000007f0000 : "nvram"
0x000000760000-0x0000007e0000 : "ddwrt"
Creating 1 MTD partitions on "Physically mapped flash":
0x0000007f0000-0x000000800000 : "nvram_cfe"
ERROR: Unknown flash, device_id:0x00
bcmsflash: found no supported devices
brcmnand: found no supported devices
nflash: found no supported devices
create ctf proc
et_module_init: passivemode set to 0x0
et_module_init: txworkq set to 0x0
et_module_init: et_txq_thresh set to 0xce4
et_module_init: et_rxlazy_timeout set to 0x3e8
et_module_init: et_rxlazy_framecnt set to 0x20
et_module_init: et_rxlazy_dyn_thresh set to 0
robo attach
robo id 3115
attach ctf for eth%d
_ctf_attach:attach eth%d
bind ctf to eth if
eth0: Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller 7.14.164.18 (r692288)
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
PPP MPPE Compression module registered
NET: Registered protocol family 24
_ctf_attach:attach wl0
cmd 2 new_cmd 0
PCI: Enabling device 0000:01:01.0 (0000 -> 0002)
_ctf_attach:attach wl1
Broadcom Watchdog Timer: 0.07 initialized.
u32 classifier
Performance counters on
Actions configured
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (913 buckets, 3652 max)
nf_conntrack_rtsp v0.7 loading
xt_time: kernel timezone is -0000
gre: GRE over IPv4 demultiplexor driver
nf_nat_rtsp v0.7 loading
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 17
bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
Bridge firewalling registered
8021q: 802.1Q VLAN Support v1.8
startup nvram driver
found nvram
found cfe nvram
check if nvram copy is required CFE Size is 61440
nvram copy magic is 48534C46
max nvram space = 65536
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing unused kernel memory: 228K
switch id 15
switch id32 53115
b5301x_common: found switch: BCM53115, rev 8
bcm_robo_config_vlan_fun vid=1, vlan->members=0x11e, vlan->untag=0x1e
bcm_robo_config_vlan_fun ports=1 2 3 4 8t
bcm_robo_config_vlan_fun vid=2, vlan->members=0x101, vlan->untag=0x101
bcm_robo_config_vlan_fun ports=0 8
bcm_robo_config_vlan_fun vid=1, vlan->members=0x11f, vlan->untag=0x1f
bcm_robo_config_vlan_fun ports=0 1 2 3 4 8t
device br0 entered promiscuous mode
device vlan1 entered promiscuous mode
device eth0 entered promiscuous mode
device eth2 entered promiscuous mode
device eth0 left promiscuous mode
device eth0 entered promiscuous mode
br0: port 2(eth2) entered forwarding state
br0: port 2(eth2) entered forwarding state
br0: port 1(vlan1) entered forwarding state
br0: port 1(vlan1) entered forwarding state
device br0 left promiscuous mode
device br0 entered promiscuous mode
device br0 left promiscuous mode
CTF: disabled
fast-classifier (PBR safe v2.1.6b): starting up
fast-classifier: registered
ip6_tables: (C) 2000-2006 Netfilter Core Team
cdc_acm: Unknown symbol usb_put_intf (err 0)
cdc_acm: Unknown symbol usb_alloc_urb (err 0)
cdc_acm: Unknown symbol usb_anchor_urb (err 0)
cdc_acm: Unknown symbol usb_free_urb (err 0)
cdc_acm: Unknown symbol usb_alloc_coherent (err 0)
cdc_acm: Unknown symbol usb_ifnum_to_if (err 0)
cdc_acm: Unknown symbol usb_register_driver (err 0)
cdc_acm: Unknown symbol usb_get_intf (err 0)
cdc_acm: Unknown symbol usb_driver_release_interface (err 0)
cdc_acm: Unknown symbol usb_clear_halt (err 0)
cdc_acm: Unknown symbol usb_submit_urb (err 0)
cdc_acm: Unknown symbol usb_free_coherent (err 0)
cdc_acm: Unknown symbol usb_driver_claim_interface (err 0)
cdc_acm: Unknown symbol usb_control_msg (err 0)
cdc_acm: Unknown symbol usb_deregister (err 0)
cdc_acm: Unknown symbol usb_kill_urb (err 0)
cdc_acm: Unknown symbol usb_get_from_anchor (err 0)
cdc_wdm: Unknown symbol usb_alloc_urb (err 0)
cdc_wdm: Unknown symbol usb_free_urb (err 0)
cdc_wdm: Unknown symbol usb_register_driver (err 0)
cdc_wdm: Unknown symbol usb_submit_urb (err 0)
cdc_wdm: Unknown symbol usb_register_dev (err 0)
cdc_wdm: Unknown symbol usb_deregister (err 0)
cdc_wdm: Unknown symbol usb_deregister_dev (err 0)
cdc_wdm: Unknown symbol usb_kill_urb (err 0)
usbnet: Unknown symbol usb_alloc_urb (err 0)
usbnet: Unknown symbol usb_free_urb (err 0)
usbnet: Unknown symbol usb_clear_halt (err 0)
usbnet: Unknown symbol usb_submit_urb (err 0)
usbnet: Unknown symbol usb_control_msg (err 0)
usbnet: Unknown symbol usb_set_interface (err 0)
usbnet: Unknown symbol usb_string (err 0)
usbnet: Unknown symbol usb_unlink_urb (err 0)
usbnet: Unknown symbol usb_get_urb (err 0)
usbnet: Unknown symbol usb_scuttle_anchored_urbs (err 0)
usbnet: Unknown symbol usb_kill_urb (err 0)
usbnet: Unknown symbol usb_get_from_anchor (err 0)
qmi_wwan: Unknown symbol usbnet_write_cmd (err 0)
qmi_wwan: Unknown symbol usb_ifnum_to_if (err 0)
qmi_wwan: Unknown symbol usb_register_driver (err 0)
qmi_wwan: Unknown symbol usbnet_change_mtu (err 0)
qmi_wwan: Unknown symbol usbnet_open (err 0)
qmi_wwan: Unknown symbol usb_driver_release_interface (err 0)
qmi_wwan: Unknown symbol usbnet_get_ethernet_addr (err 0)
qmi_wwan: Unknown symbol cdc_parse_cdc_header (err 0)
qmi_wwan: Unknown symbol usbnet_tx_timeout (err 0)
qmi_wwan: Unknown symbol usbnet_suspend (err 0)
qmi_wwan: Unknown symbol usbnet_start_xmit (err 0)
qmi_wwan: Unknown symbol usb_driver_claim_interface (err 0)
qmi_wwan: Unknown symbol usbnet_get_endpoints (err 0)
qmi_wwan: Unknown symbol usb_deregister (err 0)
qmi_wwan: Unknown symbol usb_cdc_wdm_register (err 0)
qmi_wwan: Unknown symbol usbnet_stop (err 0)
qmi_wwan: Unknown symbol usbnet_disconnect (err 0)
qmi_wwan: Unknown symbol usbnet_probe (err 0)
qmi_wwan: Unknown symbol usbnet_resume (err 0)
usbserial: Unknown symbol usb_put_intf (err 0)
usbserial: Unknown symbol usb_alloc_urb (err 0)
usbserial: Unknown symbol usb_free_urb (err 0)
usbserial: Unknown symbol usb_register_driver (err 0)
usbserial: Unknown symbol usb_match_one_id (err 0)
usbserial: Unknown symbol usb_disabled (err 0)
usbserial: Unknown symbol usb_show_dynids (err 0)
usbserial: Unknown symbol usb_get_intf (err 0)
usbserial: Unknown symbol usb_put_dev (err 0)
usbserial: Unknown symbol usb_get_dev (err 0)
usbserial: Unknown symbol usb_submit_urb (err 0)
usbserial: Unknown symbol usb_match_id (err 0)
usbserial: Unknown symbol usb_store_new_id (err 0)
usbserial: Unknown symbol usb_poison_urb (err 0)
usbserial: Unknown symbol usb_unpoison_urb (err 0)
usbserial: Unknown symbol usb_deregister (err 0)
usbserial: Unknown symbol usb_kill_urb (err 0)
usb_wwan: Unknown symbol usb_alloc_urb (err 0)
usb_wwan: Unknown symbol usb_anchor_urb (err 0)
usb_wwan: Unknown symbol usb_free_urb (err 0)
usb_wwan: Unknown symbol usb_serial_port_softint (err 0)
usb_wwan: Unknown symbol usb_submit_urb (err 0)
usb_wwan: Unknown symbol usb_control_msg (err 0)
usb_wwan: Unknown symbol usb_unlink_urb (err 0)
usb_wwan: Unknown symbol usb_kill_urb (err 0)
usb_wwan: Unknown symbol usb_get_from_anchor (err 0)
sierra: Unknown symbol usb_alloc_urb (err 0)
sierra: Unknown symbol usb_anchor_urb (err 0)
sierra: Unknown symbol usb_free_urb (err 0)
sierra: Unknown symbol usb_serial_port_softint (err 0)
sierra: Unknown symbol usb_clear_halt (err 0)
sierra: Unknown symbol usb_kill_anchored_urbs (err 0)
sierra: Unknown symbol usb_submit_urb (err 0)
sierra: Unknown symbol usb_control_msg (err 0)
sierra: Unknown symbol usb_set_interface (err 0)
sierra: Unknown symbol usb_serial_deregister_drivers (err 0)
sierra: Unknown symbol usb_unanchor_urb (err 0)
sierra: Unknown symbol usb_kill_urb (err 0)
sierra: Unknown symbol usb_get_from_anchor (err 0)
sierra: Unknown symbol usb_serial_register_drivers (err 0)
option: Unknown symbol usb_wwan_write (err 0)
option: Unknown symbol usb_wwan_close (err 0)
option: Unknown symbol usb_wwan_port_probe (err 0)
option: Unknown symbol usb_submit_urb (err 0)
option: Unknown symbol usb_wwan_tiocmget (err 0)
option: Unknown symbol usb_wwan_chars_in_buffer (err 0)
option: Unknown symbol usb_wwan_write_room (err 0)
option: Unknown symbol usb_wwan_port_remove (err 0)
option: Unknown symbol usb_serial_deregister_drivers (err 0)
option: Unknown symbol usb_wwan_dtr_rts (err 0)
option: Unknown symbol usb_wwan_open (err 0)
option: Unknown symbol usb_wwan_ioctl (err 0)
option: Unknown symbol usb_serial_register_drivers (err 0)
option: Unknown symbol usb_wwan_tiocmset (err 0)
qcserial: Unknown symbol usb_wwan_write (err 0)
qcserial: Unknown symbol usb_wwan_close (err 0)
qcserial: Unknown symbol usb_wwan_port_probe (err 0)
qcserial: Unknown symbol usb_wwan_chars_in_buffer (err 0)
qcserial: Unknown symbol usb_wwan_write_room (err 0)
qcserial: Unknown symbol usb_set_interface (err 0)
qcserial: Unknown symbol usb_wwan_port_remove (err 0)
qcserial: Unknown symbol usb_serial_deregister_drivers (err 0)
qcserial: Unknown symbol usb_wwan_dtr_rts (err 0)
qcserial: Unknown symbol usb_wwan_open (err 0)
qcserial: Unknown symbol usb_serial_register_drivers (err 0)
br0: port 2(eth2) entered forwarding state
br0: port 1(vlan1) entered forwarding state
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ehci-pci 0000:00:04.1: EHCI Host Controller
ehci-pci 0000:00:04.1: new USB bus registered, assigned bus number 1
ehci-pci 0000:00:04.1: irq 5, io mem 0x18004000
ehci-pci 0000:00:04.1: USB 0.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-pci: OHCI PCI platform driver
ohci-pci 0000:00:04.0: OHCI PCI host controller
ohci-pci 0000:00:04.0: new USB bus registered, assigned bus number 2
ohci-pci 0000:00:04.0: irq 5, io mem 0x18009000
usb 1-1: new high-speed USB device number 2 using ehci-pci
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
fast-classifier: shutting down
fast-classifier (PBR safe v2.1.6b): starting up
fast-classifier: registered
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver cdc_wdm
usbcore: registered new interface driver qmi_wwan
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver sierra
usbserial: USB Serial support registered for Sierra USB modem
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver qcserial
usbserial: USB Serial support registered for Qualcomm USB modem
random: nonblocking pool is initialized
It seems that USB mode switching fails for some reason. I tried executing manually usb_modeswitch -v 0x2001 -p 0xac01 -S -W and it ended with Segmentation fault:
Code:
root@camgate:~# usb_modeswitch -v 0x2001 -p 0xac01 -S -W
Take all parameters from the command line
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.4.0 (C) Josua Dietze 2016
* Based on libusb1/libusbx
Look for default devices ...
found USB ID 2001:ac01
vendor ID matched
product ID matched
found USB ID 1d6b:0002
found USB ID 1d6b:0001
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
USB description data (for identification)
-------------------------
Manufacturer: Mobile Connect
Product: Mobile Connect
Serial No.: a9d3d07f63c2
-------------------------
Send Sierra control message
communication with device stopped. May have switched modes anyway
-> Run lsusb to note any changes. Bye!
Thank you, kernel-panic69. It seems though that usb_modeswitch works, even though it finishes with Segmentation fault. I tried instead a standard eject instead of Sierra mode and it finally worked: usb_modeswitch -K -v 2001 -p ac01
Now the USB storage is disconnected and I have the dongle in modem mode, which is preserved through router reboots:
qmi_wwan 1-1:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:04.1-1, WWAN/QMI device, 36:27:7a:8b:21:87
usbcore: registered new interface driver qmi_wwan
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver sierra
usbserial: USB Serial support registered for Sierra USB modem
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
option 1-1:1.0: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1:1.1: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1:1.2: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
option 1-1:1.3: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
usbcore: registered new interface driver qcserial
usbserial: USB Serial support registered for Qualcomm USB modem
random: nonblocking pool is initialized
However, still no PPP interface. I noticed that there is no device name in file /tmp/ppp/options.pppoe, and even if I add it manually (e.g., /dev/ttyUSB0), it will be deleted automatically within a minute or so:
After flashing a new build 48352, the modem worked right away and I have now ppp0 interface and internet functioning. LOM, thank you again for your efforts with lib3g.
On the negative side, I discovered that most of the uqmi commands do not work. I was hoping to be able to send SMS messages. Does anyone know if this is an expected behaviour?
I also noticed that usb_modeswitch was updated from version 2.4 to 2.6.1. However, it still finishes with Segmentation fault, though the mode is switched correctly just like with the previous version - so it must be something specific to DD-WRT. dmesg has these messages during Segmenttion fault:
Code:
do_page_fault(): sending SIGSEGV to usb_modeswitch for invalid read access from 00000008
epc = 00407111 in usb_modeswitch[400000+e000]
ra = 0040561b in usb_modeswitch[400000+e000]
After flashing a new build 48352, the modem worked right away and I have now ppp0 interface and internet functioning.
I think that is your problem, the modem is connecting using ppp serial dial-up instead of qmi.
Seems someone has heavily modified the protocol selection part in lib3g since I rewrote it many years ago. It is spaghetti code now (it doesn't look like Sebastian's coding style..)
check that 3gdata is set to qmi:
nvram show | grep 3gdata
It looks like you can force qmi protocol by setting an nvram variable:
nvram set checkforce = 98
nvram commit
then replug the modem. _________________ Kernel panic: Aiee, killing interrupt handler!
You are absolutely right, and I believe I found what causes the problem. Macros for HAVE_LIBQMI and HAVE_UQMI on line 1777 are simply undefined, and the code between lines 1777 and 1810 is never executed. What is executed instead is the code at 1811 and below. This is easy to see from here:
Variable 3gnmvariant gets set on line 1813, and in my case it is equal to 2: (2 | QMI) & 0x0f = (2 | 0x80) & 0x0f = 2. If I manually set 3gcontrol and 3gdata to qmi they get redefined back to /dev/usb/tts/* within a minute even if checkforce=98. I guess this is done by redial process who calls get3GControlDevice() from lib3g.
I could not find where HAVE_LIBQMI and HAVE_UQMI macros are defined, but that code probably needs to be checked.
Joined: 06 Jun 2006 Posts: 7445 Location: Dresden, Germany
Posted: Fri Feb 18, 2022 10:08 Post subject:
depswa wrote:
You are absolutely right, and I believe I found what causes the problem. Macros for HAVE_LIBQMI and HAVE_UQMI on line 1777 are simply undefined, and the code between lines 1777 and 1810 is never executed. What is executed instead is the code at 1811 and below. This is easy to see from here:
Variable 3gnmvariant gets set on line 1813, and in my case it is equal to 2: (2 | QMI) & 0x0f = (2 | 0x80) & 0x0f = 2. If I manually set 3gcontrol and 3gdata to qmi they get redefined back to /dev/usb/tts/* within a minute even if checkforce=98. I guess this is done by redial process who calls get3GControlDevice() from lib3g.
I could not find where HAVE_LIBQMI and HAVE_UQMI macros are defined, but that code probably needs to be checked.
these are not undefined in my builds. uqmi is included and the macro is set. but correct me if i'm wrong _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Joined: 06 Jun 2006 Posts: 7445 Location: Dresden, Germany
Posted: Fri Feb 18, 2022 10:12 Post subject:
found a bad typo. you where right see 48394. _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Thank you for the quick fix, BrainSlayer. I confirm that it works correctly now, and the connection is made through qmi protocol. I have wwan0 interface instead of ppp0. And also can send SMS messages.
Code:
root@camgate:~# ip route
default via 10.138.126.33 dev wwan0
10.138.126.0/26 dev wwan0 scope link src 10.138.126.32
127.0.0.0/8 dev lo scope link
192.168.0.0/24 dev br0 scope link src 192.168.0.1
root@camgate:~# nvram show | grep 3g
size: 31378 bytes (34158 left)
3gcontrol=qmi
3gdata=qmi
wan_proto=3g
root@camgate:~# uqmi -d /dev/cdc-wdm0 --get-data-status
"connected"
root@camgate:~# uqmi -d /dev/cdc-wdm0 --send-message "Testing SMS" --send-message-target xxxxxxxx
root@camgate:~#
Unfortunately, some of the uqmi functionality is still unavailable, but I guess this is specific to particular 4G modem. For me, the most important is the ability to send SMS and it works great.
Joined: 06 Jun 2006 Posts: 7445 Location: Dresden, Germany
Posted: Sat Feb 19, 2022 12:29 Post subject:
qmi is a api. but it doesnt force a vendor to implement everything. there are also wifi devices with qmi api. they do not support gsm networks of course then _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s