Problem with AirCard 340U on embedded Linux

Evade Flow evadeflow at gmail.com
Mon Aug 15 21:41:38 UTC 2016


*UPDATE* A suggestion by Aleksander from this previous thread:

  -
https://lists.freedesktop.org/archives/libqmi-devel/2015-October/001312.html

seems to have solved my problem. I simply added this line to my start
script, just before establishing the connection:

--wda-set-data-format=802-3

and now it works:

root at embedded-dev $ ./start-net.sh
[/dev/cdc-wdm0] Successfully set data format
                        QoS flow header: no
                    Link layer protocol: '802-3'
       Uplink data aggregation protocol: 'disabled'
     Downlink data aggregation protocol: 'disabled'
                          NDP signature: '0'
Downlink data aggregation max datagrams: '0'
     Downlink data aggregation max size: '0'
[/dev/cdc-wdm0] Network started
        Packet data handle: '1143419264'
[/dev/cdc-wdm0] Client ID not released:
        Service: 'wds'
            CID: '1'
[/dev/cdc-wdm0] Current settings retrieved:
           IP Family: IPv4
        IPv4 address: 33.207.34.250
    IPv4 subnet mask: 255.255.255.252
IPv4 gateway address: 33.207.34.249
    IPv4 primary DNS: 10.177.0.34
  IPv4 secondary DNS: 10.177.0.210
                 MTU: 1430
             Domains: none
killall: dhclient: no process killed
killall: dhclient: no process killed
Internet Systems Consortium DHCP Client 4.3.2
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

ipListening on LPF/wwp0s21f0u3u4i8/02:d1:eb:e7:be:59
Sending on   LPF/wwp0s21f0u3u4i8/02:d1:eb:e7:be:59
Sending on   Socket/fallback
DHCPREQUEST on wwp0s21f0u3u4i8 to 255.255.255.255 port 67
DHCPNAK from 33.207.34.249
 rDHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 4
DHCPREQUEST on wwp0s21f0u3u4i8 to 255.255.255.255 port 67
DHCPOFFER from 33.207.34.249
DHCPACK from 33.207.34.249
bound to 33.207.34.250 -- renewal in 3466 seconds.

This list proved to be an amazing resource for solving my problem, I just
needed to find the right search terms. I am *so* glad libqmi---and this
list---exist. THANK YOU! I wanted to be sure to follow up in case others
run into this same problem. I *think* everything is working fine now, but
I'll post back here if I discover any problems with the connection...

On Mon, Aug 15, 2016 at 2:42 PM, Evade Flow <evadeflow at gmail.com> wrote:

> I'm having a fight with a USB modem that I'm currently *losing*. Badly.
> I'm hoping members of this list can help me turn the tide! I have the
> following script that works fine on my desktop Linux system, but fails to
> obtain an IP address on an embedded target:
>
> #!/bin/bash
> set -euo pipefail
>
> export PATH=/home/embedded-dev/bin:$PATH
>
> if [[ "$(hostname)" = "embedded-dev" ]]; then
>   IFACE=wwp0s21f0u3u4i8
> else
>   IFACE=wwp0s26u1u2i8
> fi
>
> qmicli -p -d /dev/cdc-wdm0 --wds-start-network="fast.t-mobile.com"
> --client-no-release-cid
> sleep 1
> qmicli -p -d /dev/cdc-wdm0 --wds-get-current-settings
> sleep 1
> ip link set ${IFACE} up
> killall dhclient || true
> killall -9 dhclient || true
> sleep 1
> dhclient -v ${IFACE}
>
> For reference, here's the uname -a output for the target machine:
>
> root at embedded-dev $ uname -a
> Linux embedded-dev 4.1.13-abl #2 SMP Mon Aug 15 09:54:15 EDT 2016 x86_64
> GNU/Linux
>
> I've got libqmi-1.16.0 on this board:
>
> root at embedded-dev $ qmicli --version
>
> qmicli 1.16.0
> Copyright (C) 2015 Aleksander Morgado
> License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2
> .0.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> And this version of dhclient:
>
> root at embedded-dev $ dhclient --version
> isc-dhclient-4.3.2
>
> And here's the output that gets logged when I plug the device into a USB
> port:
>
> root at embedded-dev $ dmesg
> [  478.807167] usb 1-3.4: new high-speed USB device number 7 using xhci_hcd
> [  478.893117] usb 1-3.4: config 1 has an invalid interface number: 9 but
> max is 0
> [  478.893125] usb 1-3.4: config 1 has no interface number 0
> [  478.894156] usb 1-3.4: New USB device found, idVendor=1199,
> idProduct=0fff
> [  478.894160] usb 1-3.4: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [  478.894163] usb 1-3.4: Product: AirCard 340U
> [  478.894166] usb 1-3.4: Manufacturer: Sierra Wireless, Incorporated
> [  478.894169] usb 1-3.4: SerialNumber: 013323000518432
> [  478.896117] usb-storage 1-3.4:1.9: USB Mass Storage device detected
> [  478.897287] usb-storage: probe of 1-3.4:1.9 failed with error -5
> [  482.179390] usb 1-3.4: USB disconnect, device number 7
> [  482.460787] usb 1-3.4: new high-speed USB device number 8 using xhci_hcd
> [  482.546811] usb 1-3.4: config 1 has an invalid interface number: 8 but
> max is 4
> [  482.546819] usb 1-3.4: config 1 has an invalid interface number: 9 but
> max is 4
> [  482.546822] usb 1-3.4: config 1 has no interface number 1
> [  482.546825] usb 1-3.4: config 1 has no interface number 4
> [  482.547806] usb 1-3.4: New USB device found, idVendor=1199,
> idProduct=9051
> [  482.547811] usb 1-3.4: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [  482.547814] usb 1-3.4: Product: AirCard 340U
> [  482.547817] usb 1-3.4: Manufacturer: Sierra Wireless, Incorporated
> [  482.547819] usb 1-3.4: SerialNumber: 013323000518432
> [  482.550472] qcserial 1-3.4:1.2: Qualcomm USB modem converter detected
> [  482.551133] usb 1-3.4: Qualcomm USB modem converter now attached to
> ttyUSB0
> [  482.551683] qcserial 1-3.4:1.3: Qualcomm USB modem converter detected
> [  482.552020] usb 1-3.4: Qualcomm USB modem converter now attached to
> ttyUSB1
> [  482.552692] qmi_wwan 1-3.4:1.8: cdc-wdm0: USB WDM device
> [  482.553086] qmi_wwan 1-3.4:1.8 wwan0: register 'qmi_wwan' at
> usb-0000:00:15.0-3.4, WWAN/QMI device, 0e:b8:0a:b2:69:43
> [  482.554014] usb-storage 1-3.4:1.9: USB Mass Storage device detected
> [  482.555115] scsi host5: usb-storage 1-3.4:1.9
> [  482.557113] qcserial 1-3.4:1.0: Qualcomm USB modem converter detected
> [  482.557430] usb 1-3.4: Qualcomm USB modem converter now attached to
> ttyUSB2
> [  482.571196] qmi_wwan 1-3.4:1.8 wwp0s21f0u3u4i8: renamed from wwan0
> [  483.545931] scsi 5:0:0:0: Direct-Access     Aircard  Disk Drive
> 1.00 PQ: 0 ANSI: 2
> [  483.548424] sd 5:0:0:0: Attached scsi generic sg0 type 0
> [  483.550934] sd 5:0:0:0: [sda] Attached SCSI removable disk
>
> When I run the script on the target, I see the following output:
>
> root at embedded-dev $ ./start-net.sh
> [/dev/cdc-wdm0] Network started
>         Packet data handle: '1143419264'
> [/dev/cdc-wdm0] Client ID not released:
>         Service: 'wds'
>             CID: '1'
> [/dev/cdc-wdm0] Current settings retrieved:
>            IP Family: IPv4
>         IPv4 address: 21.87.88.78
>     IPv4 subnet mask: 255.255.255.252
> IPv4 gateway address: 21.87.88.77
>     IPv4 primary DNS: 10.177.0.34
>   IPv4 secondary DNS: 10.177.0.210
>                  MTU: 1430
>              Domains: none
> Internet Systems Consortium DHCP Client 4.3.2
> Copyright 2004-2015 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
>
> Listening on LPF/wwp0s21f0u3u4i8/0e:b8:0a:b2:69:43
> Sending on   LPF/wwp0s21f0u3u4i8/0e:b8:0a:b2:69:43
> Sending on   Socket/fallback
> DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 5
> DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 10
> DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 17
> DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 9
> DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 8
> DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 12
> No DHCPOFFERS received.
> No working leases in persistent database - sleeping.
>
> My desktop machine is running Fedora 23:
>
> [~$:999] uname -a
> Linux localhost.localdomain 4.4.9-300.fc23.x86_64 #1 SMP Wed May 4
> 23:56:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
>
> It's also using libqmi-1.16.0, and a slightly different version of
> dhclient:
>
> [~$:1017] dhclient --version
> isc-dhclient-4.3.3-P1
>
> When I plug the modem into this machine and run the same script, it emits
> the following:
>
> [~$:1014] sudo ./start-net.sh
> [sudo] password for demo:
> [/dev/cdc-wdm0] Network started
>         Packet data handle: '1143422144'
> [/dev/cdc-wdm0] Client ID not released:
>         Service: 'wds'
>             CID: '3'
> [/dev/cdc-wdm0] Current settings retrieved:
>            IP Family: IPv4
>         IPv4 address: 26.173.92.29
>     IPv4 subnet mask: 255.255.255.252
> IPv4 gateway address: 26.173.92.30
>     IPv4 primary DNS: 10.177.0.34
>   IPv4 secondary DNS: 10.177.0.210
>                  MTU: 1430
>              Domains: none
> dhclient: no process found
> dhclient: no process found
> Internet Systems Consortium DHCP Client 4.3.3-P1
> Copyright 2004-2016 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
>
> Listening on LPF/wwp0s26u1u2i8/7a:b0:a0:37:07:94
> Sending on   LPF/wwp0s26u1u2i8/7a:b0:a0:37:07:94
> Sending on   Socket/fallback
> DHCPDISCOVER on wwp0s26u1u2i8 to 255.255.255.255 port 67 interval 5
> (xid=0xc4f9f664)
> DHCPREQUEST on wwp0s26u1u2i8 to 255.255.255.255 port 67 (xid=0xc4f9f664)
> DHCPOFFER from 26.173.92.30
> DHCPACK from 26.173.92.30 (xid=0xc4f9f664)
> bound to 26.173.92.29 -- renewal in 3212 seconds.
>
> After that, I have a glorious LTE connection to the Interwebs! But I've
> had no luck getting it to work on the embedded device. Can anybody
> recommend steps to troubleshoot this?
>
> Some things I've tried so far include:
>
> 1. Upgrading from libqmi-1.12.2 to 1.16.0. This allowed me to use
> --wds-get-current-settings, but dhclient still failed to obtain an IP
> address.
>
> 2. Manually configure the connection based on the settings reported by qmicli
> -p -d /dev/cdc-wdm0 --wds-get-current-settings. I was unable to get this
> to work, neither on the target, nor on my desktop machine. The IP address,
> routing table and /etc/resolv.conf *looked *correct to me, but... I'm not
> very familiar with the commands ip addr, ip route, ip link, etc, so I
> probably made some mistakes. When other posts on this mailing list
> suggested using dhclient, for similar situations, I didn't pursue manual
> configuration any further. If somebody can tell me the correct commands
> needed to manually configure the connection, I can check this, if it helps.
>
> 3. Applying the patches mentioned in this mailing list thread:
> https://lists.freedesktop.org/archives/libqmi-devel/2015-
> December/001477.html
>
> I'm about out of ideas at this point. I've seen other posts on this
> mailing list that mention using tcpdump to sniff packets, but I'm not
> sure I'd know which interface to capture on, or how to interpret the
> traces. Any hints/tips along those lines will be much appreciated!
>
> One other thing that may be worth mentioning is that the kernel log output
> upon inserting the modem into my desktop machine is more-or-less
> *identical*, except for a few errors that get emitted:
>
> [83474.891190] usb 1-1.2: new high-speed USB device number 13 using
> ehci-pci
> [83474.977240] usb 1-1.2: config 1 has an invalid interface number: 9 but
> max is 0
> [83474.977247] usb 1-1.2: config 1 has no interface number 0
> [83474.978607] usb 1-1.2: New USB device found, idVendor=1199,
> idProduct=0fff
> [83474.978616] usb 1-1.2: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [83474.978622] usb 1-1.2: Product: AirCard 340U
> [83474.978627] usb 1-1.2: Manufacturer: Sierra Wireless, Incorporated
> [83474.978631] usb 1-1.2: SerialNumber: 013323000518432
> [83474.980975] usb-storage 1-1.2:1.9: USB Mass Storage device detected
> [83474.982028] usb-storage: probe of 1-1.2:1.9 failed with error -5
> [83478.556940] usb 1-1.2: USB disconnect, device number 13
> [83478.811958] usb 1-1.2: new high-speed USB device number 14 using
> ehci-pci
> [83478.898017] usb 1-1.2: config 1 has an invalid interface number: 8 but
> max is 4
> [83478.898024] usb 1-1.2: config 1 has an invalid interface number: 9 but
> max is 4
> [83478.898027] usb 1-1.2: config 1 has no interface number 1
> [83478.898030] usb 1-1.2: config 1 has no interface number 4
> [83478.899477] usb 1-1.2: New USB device found, idVendor=1199,
> idProduct=9051
> [83478.899483] usb 1-1.2: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [83478.899487] usb 1-1.2: Product: AirCard 340U
> [83478.899490] usb 1-1.2: Manufacturer: Sierra Wireless, Incorporated
> [83478.899492] usb 1-1.2: SerialNumber: 013323000518432
> [83478.901929] qcserial 1-1.2:1.2: Qualcomm USB modem converter detected
> [83478.902109] usb 1-1.2: Qualcomm USB modem converter now attached to
> ttyUSB0
> [83478.902571] qcserial 1-1.2:1.3: Qualcomm USB modem converter detected
> [83478.902718] usb 1-1.2: Qualcomm USB modem converter now attached to
> ttyUSB1
> [83478.903582] qmi_wwan 1-1.2:1.8: cdc-wdm0: USB WDM device
> [83478.903957] qmi_wwan 1-1.2:1.8 wwan0: register 'qmi_wwan' at
> usb-0000:00:1a.0-1.2, WWAN/QMI device, 32:5b:78:6c:82:3a
> [83478.904613] usb-storage 1-1.2:1.9: USB Mass Storage device detected
> [83478.905929] scsi host16: usb-storage 1-1.2:1.9
> [83478.906604] qcserial 1-1.2:1.0: Qualcomm USB modem converter detected
> [83478.906769] usb 1-1.2: Qualcomm USB modem converter now attached to
> ttyUSB2
> [83478.984865] qmi_wwan 1-1.2:1.8 wwp0s26u1u2i8: renamed from wwan0
> [83479.455637] qcserial ttyUSB2: usb_wwan_indat_callback: resubmit read
> urb failed. (-2)
> [83479.455655] qcserial ttyUSB2: usb_wwan_indat_callback: resubmit read
> urb failed. (-2)
> [83479.455660] qcserial ttyUSB2: usb_wwan_indat_callback: resubmit read
> urb failed. (-2)
> [83479.455941] qcserial ttyUSB2: Qualcomm USB modem converter now
> disconnected from ttyUSB2
> [83479.455974] qcserial 1-1.2:1.0: device disconnected
> [83479.911726] scsi 16:0:0:0: Direct-Access     Aircard  Disk Drive
> 1.00 PQ: 0 ANSI: 2
> [83479.912912] sd 16:0:0:0: Attached scsi generic sg2 type 0
> [83479.917020] sd 16:0:0:0: [sdb] Attached SCSI removable disk
>
> Perhaps those resubmit read urb failed errors provide a clue as to why
> this device works on my desktop, but not the embedded device?
>
> Thanks for your consideration, this has been driving me nuts for two weeks
> now... `:-]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20160815/7f7a129e/attachment-0001.html>


More information about the libqmi-devel mailing list