<div dir="ltr"><div>*UPDATE* A suggestion by Aleksander from this previous thread:<br><br> - <a href="https://lists.freedesktop.org/archives/libqmi-devel/2015-October/001312.html">https://lists.freedesktop.org/archives/libqmi-devel/2015-October/001312.html</a><br><br></div>seems to have solved my problem. I simply added this line to my start script, just before establishing the connection:<br><div><pre>--wda-set-data-format=802-3</pre>and now it works:<br><br>root@embedded-dev $ ./start-net.sh<br>[/dev/cdc-wdm0] Successfully set data format<br> QoS flow header: no<br> Link layer protocol: '802-3'<br> Uplink data aggregation protocol: 'disabled'<br> Downlink data aggregation protocol: 'disabled'<br> NDP signature: '0'<br>Downlink data aggregation max datagrams: '0'<br> Downlink data aggregation max size: '0'<br>[/dev/cdc-wdm0] Network started<br> Packet data handle: '1143419264'<br>[/dev/cdc-wdm0] Client ID not released:<br> Service: 'wds'<br> CID: '1'<br>[/dev/cdc-wdm0] Current settings retrieved:<br> IP Family: IPv4<br> IPv4 address: 33.207.34.250<br> IPv4 subnet mask: 255.255.255.252<br>IPv4 gateway address: 33.207.34.249<br> IPv4 primary DNS: 10.177.0.34<br> IPv4 secondary DNS: 10.177.0.210<br> MTU: 1430<br> Domains: none<br>killall: dhclient: no process killed<br>killall: dhclient: no process killed<br>Internet Systems Consortium DHCP Client 4.3.2<br>Copyright 2004-2015 Internet Systems Consortium.<br>All rights reserved.<br>For info, please visit <a href="https://www.isc.org/software/dhcp/">https://www.isc.org/software/dhcp/</a><br><br>ipListening on LPF/wwp0s21f0u3u4i8/02:d1:eb:e7:be:59<br>Sending on LPF/wwp0s21f0u3u4i8/02:d1:eb:e7:be:59<br>Sending on Socket/fallback <br>DHCPREQUEST on wwp0s21f0u3u4i8 to 255.255.255.255 port 67<br>DHCPNAK from 33.207.34.249 <br> rDHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 4<br>DHCPREQUEST on wwp0s21f0u3u4i8 to 255.255.255.255 port 67<br>DHCPOFFER from 33.207.34.249 <br>DHCPACK from 33.207.34.249 <br>bound to 33.207.34.250 -- renewal in 3466 seconds.<br><br></div><div>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...<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 2:42 PM, Evade Flow <span dir="ltr"><<a href="mailto:evadeflow@gmail.com" target="_blank">evadeflow@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I'm having a fight with a USB modem that I'm currently <i>losing</i>. 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:<br><br><span style="font-family:monospace,monospace"><font size="1">#!/bin/bash<br>set -euo pipefail<br><br>export PATH=/home/embedded-dev/bin:$P<wbr>ATH<br><br>if [[ "$(hostname)" = "embedded-dev" ]]; then<br> IFACE=wwp0s21f0u3u4i8<br>else<br> IFACE=wwp0s26u1u2i8<br>fi<br><br>qmicli -p -d /dev/cdc-wdm0 --wds-start-network="<a href="http://fast.t-mobile.com" target="_blank">fast.t-mo<wbr>bile.com</a>" --client-no-release-cid<br>sleep 1<br>qmicli -p -d /dev/cdc-wdm0 --wds-get-current-settings<br>sleep 1<br>ip link set ${IFACE} up<br>killall dhclient || true<br>killall -9 dhclient || true<br>sleep 1<br>dhclient -v ${IFACE}</font><br></span><br></div>For reference, here's the <span style="font-family:monospace,monospace">uname -a</span> output for the target machine:<br><br><font size="1"><span style="font-family:monospace,monospace">root@embedded-dev $ uname -a<br>Linux embedded-dev 4.1.13-abl #2 SMP Mon Aug 15 09:54:15 EDT 2016 x86_64 GNU/Linux<br></span></font><div><div><br></div><div>I've got <font size="1"><span style="font-family:monospace,monospace">libqmi-1.16.0</span></font> on this board:<br><br><font size="1"><span style="font-family:monospace,monospace">root@embedded-dev $ qmicli --version</span></font><br><br><font size="1"><span style="font-family:monospace,monospace">qmicli 1.16.0</span></font><br><font size="1"><span style="font-family:monospace,monospace">Copyright (C) 2015 Aleksander Morgado</span></font><br><font size="1"><span style="font-family:monospace,monospace">License GPLv2+: GNU GPL version 2 or later <<a href="http://gnu.org/licenses/gpl-2.0.html" target="_blank">http://gnu.org/licenses/gpl-2<wbr>.0.html</a>></span></font><br><font size="1"><span style="font-family:monospace,monospace">This is free software: you are free to change and redistribute it.</span></font><br><font size="1"><span style="font-family:monospace,monospace">There is NO WARRANTY, to the extent permitted by law.</span></font><br><br>And this version of <font size="1"><span style="font-family:monospace,monospace">dhclient</span></font>:<br><br><font size="1"><span style="font-family:monospace,monospace">root@embedded-dev $ dhclient --version<br>isc-dhclient-4.3.2</span></font><br><br>And here's the output that gets logged when I plug the device into a USB port:<br><br><font size="1"><span style="font-family:monospace,monospace">root@embedded-dev $ dmesg<br>[ 478.807167] usb 1-3.4: new high-speed USB device number 7 using xhci_hcd<br>[ 478.893117] usb 1-3.4: config 1 has an invalid interface number: 9 but max is 0<br>[ 478.893125] usb 1-3.4: config 1 has no interface number 0<br>[ 478.894156] usb 1-3.4: New USB device found, idVendor=1199, idProduct=0fff<br>[ 478.894160] usb 1-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br>[ 478.894163] usb 1-3.4: Product: AirCard 340U<br>[ 478.894166] usb 1-3.4: Manufacturer: Sierra Wireless, Incorporated<br>[ 478.894169] usb 1-3.4: SerialNumber: 013323000518432<br>[ 478.896117] usb-storage 1-3.4:1.9: USB Mass Storage device detected<br>[ 478.897287] usb-storage: probe of 1-3.4:1.9 failed with error -5<br>[ 482.179390] usb 1-3.4: USB disconnect, device number 7<br>[ 482.460787] usb 1-3.4: new high-speed USB device number 8 using xhci_hcd<br>[ 482.546811] usb 1-3.4: config 1 has an invalid interface number: 8 but max is 4<br>[ 482.546819] usb 1-3.4: config 1 has an invalid interface number: 9 but max is 4<br>[ 482.546822] usb 1-3.4: config 1 has no interface number 1<br>[ 482.546825] usb 1-3.4: config 1 has no interface number 4<br>[ 482.547806] usb 1-3.4: New USB device found, idVendor=1199, idProduct=9051<br>[ 482.547811] usb 1-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br>[ 482.547814] usb 1-3.4: Product: AirCard 340U<br>[ 482.547817] usb 1-3.4: Manufacturer: Sierra Wireless, Incorporated<br>[ 482.547819] usb 1-3.4: SerialNumber: 013323000518432<br>[ 482.550472] qcserial 1-3.4:1.2: Qualcomm USB modem converter detected<br>[ 482.551133] usb 1-3.4: Qualcomm USB modem converter now attached to ttyUSB0<br>[ 482.551683] qcserial 1-3.4:1.3: Qualcomm USB modem converter detected<br>[ 482.552020] usb 1-3.4: Qualcomm USB modem converter now attached to ttyUSB1<br>[ 482.552692] qmi_wwan 1-3.4:1.8: cdc-wdm0: USB WDM device<br>[ 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<br>[ 482.554014] usb-storage 1-3.4:1.9: USB Mass Storage device detected<br>[ 482.555115] scsi host5: usb-storage 1-3.4:1.9<br>[ 482.557113] qcserial 1-3.4:1.0: Qualcomm USB modem converter detected<br>[ 482.557430] usb 1-3.4: Qualcomm USB modem converter now attached to ttyUSB2<br>[ 482.571196] qmi_wwan 1-3.4:1.8 wwp0s21f0u3u4i8: renamed from wwan0<br>[ 483.545931] scsi 5:0:0:0: Direct-Access Aircard Disk Drive 1.00 PQ: 0 ANSI: 2<br>[ 483.548424] sd 5:0:0:0: Attached scsi generic sg0 type 0<br>[ 483.550934] sd 5:0:0:0: [sda] Attached SCSI removable disk</span></font><br></div><div><br></div><div>When I run the script on the target, I see the following output:<br><br><font size="1"><span style="font-family:monospace,monospace">root@embedded-dev $ ./start-net.sh<br>[/dev/cdc-wdm0] Network started<br> Packet data handle: '1143419264'<br>[/dev/cdc-wdm0] Client ID not released:<br> Service: 'wds'<br> CID: '1'<br>[/dev/cdc-wdm0] Current settings retrieved:<br> IP Family: IPv4<br> IPv4 address: 21.87.88.78<br> IPv4 subnet mask: 255.255.255.252<br>IPv4 gateway address: 21.87.88.77<br> IPv4 primary DNS: 10.177.0.34<br> IPv4 secondary DNS: 10.177.0.210<br> MTU: 1430<br> Domains: none<br>Internet Systems Consortium DHCP Client 4.3.2<br>Copyright 2004-2015 Internet Systems Consortium.<br>All rights reserved.<br>For info, please visit <a href="https://www.isc.org/software/dhcp/" target="_blank">https://www.isc.org/software/<wbr>dhcp/</a><br><br>Listening on LPF/wwp0s21f0u3u4i8/0e:b8:0a:<wbr>b2:69:43<br>Sending on LPF/wwp0s21f0u3u4i8/0e:b8:0a:<wbr>b2:69:43<br>Sending on Socket/fallback<br>DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 5<br>DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 10<br>DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 17<br>DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 9<br>DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 8<br>DHCPDISCOVER on wwp0s21f0u3u4i8 to 255.255.255.255 port 67 interval 12<br>No DHCPOFFERS received.<br>No working leases in persistent database - sleeping.</span></font><br><br></div><div>My desktop machine is running Fedora 23:<br><br>[~$:999] uname -a<br>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<br><br></div><div>It's also using <font size="1"><span style="font-family:monospace,monospace">libqmi-1.16.0</span></font>, and a slightly different version of <font size="1"><span style="font-family:monospace,monospace">dhclient</span></font>:<br><br><font size="1"><span style="font-family:monospace,monospace">[~$:1017] dhclient --version<br>isc-dhclient-4.3.3-P1</span></font><br><br>When I plug the modem into this machine and run the same script, it emits the following:<br><font size="1"><span style="font-family:monospace,monospace"><br>[~$:1014] sudo ./start-net.sh<br>[sudo] password for demo:<br>[/dev/cdc-wdm0] Network started<br> Packet data handle: '1143422144'<br>[/dev/cdc-wdm0] Client ID not released:<br> Service: 'wds'<br> CID: '3'<br>[/dev/cdc-wdm0] Current settings retrieved:<br> IP Family: IPv4<br> IPv4 address: 26.173.92.29<br> IPv4 subnet mask: 255.255.255.252<br>IPv4 gateway address: 26.173.92.30<br> IPv4 primary DNS: 10.177.0.34<br> IPv4 secondary DNS: 10.177.0.210<br> MTU: 1430<br> Domains: none<br>dhclient: no process found<br>dhclient: no process found<br>Internet Systems Consortium DHCP Client 4.3.3-P1<br>Copyright 2004-2016 Internet Systems Consortium.<br>All rights reserved.<br>For info, please visit <a href="https://www.isc.org/software/dhcp/" target="_blank">https://www.isc.org/software/<wbr>dhcp/</a><br><br>Listening on LPF/wwp0s26u1u2i8/7a:b0:a0:37:<wbr>07:94<br>Sending on LPF/wwp0s26u1u2i8/7a:b0:a0:37:<wbr>07:94<br>Sending on Socket/fallback<br>DHCPDISCOVER on wwp0s26u1u2i8 to 255.255.255.255 port 67 interval 5 (xid=0xc4f9f664)<br>DHCPREQUEST on wwp0s26u1u2i8 to 255.255.255.255 port 67 (xid=0xc4f9f664)<br>DHCPOFFER from 26.173.92.30<br>DHCPACK from 26.173.92.30 (xid=0xc4f9f664)<br>bound to 26.173.92.29 -- renewal in 3212 seconds.</span></font><br><br></div><div>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?<br><br></div><div>Some things I've tried so far include:<br><br></div><div>1. Upgrading from <font size="1"><span style="font-family:monospace,monospace">libqmi-1.12.2</span></font> to <font size="1"><span style="font-family:monospace,monospace">1.16.0</span></font>. This allowed me to use --wds-get-current-settings, but <font size="1"><span style="font-family:monospace,monospace">dhclient</span></font> still failed to obtain an IP address.<br></div><div><br>2. Manually configure the connection based on the settings reported by <font size="1"><span style="font-family:monospace,monospace">qmicli -p -d /dev/cdc-wdm0 --wds-get-current-settings</span></font>. I was unable to get this to work, neither on the target, nor on my desktop machine. The IP address, routing table and <font size="1"><span style="font-family:monospace,monospace">/etc/resolv.conf</span></font> <i>looked </i>correct to me, but... I'm not very familiar with the commands <font size="1"><span style="font-family:monospace,monospace">ip addr</span></font>, <font size="1"><span style="font-family:monospace,monospace">ip route</span></font>, <font size="1"><span style="font-family:monospace,monospace">ip link</span></font>, etc, so I probably made some mistakes. When other posts on this mailing list suggested using <font size="1"><span style="font-family:monospace,monospace">dhclient</span></font>, 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.<br><br></div><div>3. Applying the patches mentioned in this mailing list thread: <a href="https://lists.freedesktop.org/archives/libqmi-devel/2015-December/001477.html" target="_blank">https://lists.freedesktop.org/<wbr>archives/libqmi-devel/2015-<wbr>December/001477.html</a><br><br></div><div>I'm about out of ideas at this point. I've seen other posts on this mailing list that mention using <font size="1"><span style="font-family:monospace,monospace">tcpdump</span></font> 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!<br><br></div><div>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 <i>identical</i>, except for a few errors that get emitted:<br><br><font size="1"><span style="font-family:monospace,monospace">[83474.891190] usb 1-1.2: new high-speed USB device number 13 using ehci-pci<br>[83474.977240] usb 1-1.2: config 1 has an invalid interface number: 9 but max is 0<br>[83474.977247] usb 1-1.2: config 1 has no interface number 0<br>[83474.978607] usb 1-1.2: New USB device found, idVendor=1199, idProduct=0fff<br>[83474.978616] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br>[83474.978622] usb 1-1.2: Product: AirCard 340U<br>[83474.978627] usb 1-1.2: Manufacturer: Sierra Wireless, Incorporated<br>[83474.978631] usb 1-1.2: SerialNumber: 013323000518432<br>[83474.980975] usb-storage 1-1.2:1.9: USB Mass Storage device detected<br>[83474.982028] usb-storage: probe of 1-1.2:1.9 failed with error -5<br>[83478.556940] usb 1-1.2: USB disconnect, device number 13<br>[83478.811958] usb 1-1.2: new high-speed USB device number 14 using ehci-pci<br>[83478.898017] usb 1-1.2: config 1 has an invalid interface number: 8 but max is 4<br>[83478.898024] usb 1-1.2: config 1 has an invalid interface number: 9 but max is 4<br>[83478.898027] usb 1-1.2: config 1 has no interface number 1<br>[83478.898030] usb 1-1.2: config 1 has no interface number 4<br>[83478.899477] usb 1-1.2: New USB device found, idVendor=1199, idProduct=9051<br>[83478.899483] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br>[83478.899487] usb 1-1.2: Product: AirCard 340U<br>[83478.899490] usb 1-1.2: Manufacturer: Sierra Wireless, Incorporated<br>[83478.899492] usb 1-1.2: SerialNumber: 013323000518432<br>[83478.901929] qcserial 1-1.2:1.2: Qualcomm USB modem converter detected<br>[83478.902109] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB0<br>[83478.902571] qcserial 1-1.2:1.3: Qualcomm USB modem converter detected<br>[83478.902718] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB1<br>[83478.903582] qmi_wwan 1-1.2:1.8: cdc-wdm0: USB WDM device<br>[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<br>[83478.904613] usb-storage 1-1.2:1.9: USB Mass Storage device detected<br>[83478.905929] scsi host16: usb-storage 1-1.2:1.9<br>[83478.906604] qcserial 1-1.2:1.0: Qualcomm USB modem converter detected<br>[83478.906769] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB2<br>[83478.984865] qmi_wwan 1-1.2:1.8 wwp0s26u1u2i8: renamed from wwan0<br>[83479.455637] qcserial ttyUSB2: usb_wwan_indat_callback: resubmit read urb failed. (-2)<br>[83479.455655] qcserial ttyUSB2: usb_wwan_indat_callback: resubmit read urb failed. (-2)<br>[83479.455660] qcserial ttyUSB2: usb_wwan_indat_callback: resubmit read urb failed. (-2)<br>[83479.455941] qcserial ttyUSB2: Qualcomm USB modem converter now disconnected from ttyUSB2<br>[83479.455974] qcserial 1-1.2:1.0: device disconnected<br>[83479.911726] scsi 16:0:0:0: Direct-Access Aircard Disk Drive 1.00 PQ: 0 ANSI: 2<br>[83479.912912] sd 16:0:0:0: Attached scsi generic sg2 type 0<br>[83479.917020] sd 16:0:0:0: [sdb] Attached SCSI removable disk</span></font><br><br></div><div>Perhaps those <font size="1"><span style="font-family:monospace,monospace">resubmit read urb failed</span></font> errors provide a clue as to why this device works on my desktop, but not the embedded device?<br><br></div><div>Thanks for your consideration, this has been driving me nuts for two weeks now... `:-]<br></div></div></div>
</blockquote></div><br></div>