<div dir="ltr">I eventually got this to work:<br><ol><li>Check an SD card is present (no point in hanging around otherwise): qmicli --device=/dev/cdc-wdm0 --device-open-qmi --uim-get-card-status<br></li><li>Wait for GSM, WCDMA or LTE status to show available: qmicli -d /dev/cdc-wdm0 --device-open-qmi --nas-get-system-info<br></li><li>Then connect: qmicli -d /dev/cdc-wdm0 --device-open-qmi --wds-start-network="ip-type=4,apn=internet" --client-no-release-cid<br></li></ol><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 3, 2020 at 10:02 PM Tom Isaacson <<a href="mailto:tom.isaacson@teknique.com">tom.isaacson@teknique.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><span>Apologies if this is dumb but I'm new to QMI. I'm trying to add LTE support on an embedded Linux device to an app. The commands below work fine when entered on the command line manually, but if I try to call them from the app on startup step 3 sometimes fails. I've checked that </span>/sys/class/net/wwan0/ exists after step 2 and I've tried calling step 3 multiple times with a 100ms pause in between but still no luck.</div><div><span><br></span></div><div dir="ltr">Step 1: Set link type to raw ip<br>$ echo Y > /sys/class/net/wwan0/qmi/raw_ip<br>Step 2: Bring interface up<br>$ ip link set dev wwan0 up<br>Step 3: Start Network (apn name MAY need to be SIM specific)<br>$ qmicli -d /dev/cdc-wdm0 --device-open-qmi --wds-start-network="ip-type=4,apn=internet" --client-no-release-cid<br>Step 4: Obtain IP lease<span><br></span></div><div dir="ltr">$ udhcpc -q -f -n -i wwan0</div><div dir="ltr"><br></div><div>Calling step 3 with "-v" gives me:</div><div>"qmicli -d /dev/cdc-wdm0 --device-open-qmi --wds-start-network="ip-type=4,apn=internet" --client-no-release-cid -v"<br>[/dev/cdc-wdm0] Opening device with flags 'none'...<br>[/dev/cdc-wdm0] loaded driver of cdc-wdm port: qmi_wwan<br>[/dev/cdc-wdm0] created endpoint<br>QMI Device at '/dev/cdc-wdm0' ready<br>[/dev/cdc-wdm0] Assuming service 'wds' is supported...<br>[/dev/cdc-wdm0] Allocating new client ID...<br>[/dev/cdc-wdm0] sent message...<br><<<<<< RAW:<br><<<<<< length = 16<br><<<<<< data = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:01<br>[/dev/cdc-wdm0] sent generic request (translated)...<br><<<<<< QMUX:<br><<<<<< length = 15<br><<<<<< flags = 0x00<br><<<<<< service = "ctl"<br><<<<<< client = 0<br><<<<<< QMI:<br><<<<<< flags = "none"<br><<<<<< transaction = 1<br><<<<<< tlv_length = 4<br><<<<<< message = "Allocate CID" (0x0022)<br><<<<<< TLV:<br><<<<<< type = "Service" (0x01)<br><<<<<< length = 1<br><<<<<< value = 01<br><<<<<< translated = wds<br>[/dev/cdc-wdm0] received message...<br><<<<<< RAW:<br><<<<<< length = 24<br><<<<<< data = 01:17:00:80:00:00:01:01:22:00:0C:00:02:04:00:00:00:00:00:01:02:00:01:11<br>[/dev/cdc-wdm0] received generic response (translated)...<br><<<<<< QMUX:<br><<<<<< length = 23<br><<<<<< flags = 0x80<br><<<<<< service = "ctl"<br><<<<<< client = 0<br><<<<<< QMI:<br><<<<<< flags = "response"<br><<<<<< transaction = 1<br><<<<<< tlv_length = 12<br><<<<<< message = "Allocate CID" (0x0022)<br><<<<<< TLV:<br><<<<<< type = "Result" (0x02)<br><<<<<< length = 4<br><<<<<< value = 00:00:00:00<br><<<<<< translated = SUCCESS<br><<<<<< TLV:<br><<<<<< type = "Allocation Info" (0x01)<br><<<<<< length = 2<br><<<<<< value = 01:11<br><<<<<< translated = [ service = 'wds' cid = '17' ]<br>[/dev/cdc-wdm0] Registered 'wds' (version unknown) client with ID '17'<br>Network start parameters set (apn: 'internet', 3gpp_profile: '0', 3gpp2_profile: '0', auth: 'unspecified', ip-type: '4', username: 'unspecified', password: 'unspecified', autoconnect: 'unspecified')<br>Asynchronously starting network...<br>[/dev/cdc-wdm0] sent message...<br><<<<<< RAW:<br><<<<<< length = 28<br><<<<<< data = 01:1B:00:00:01<br>:11:00:01:00:20:00:0F:00:19:01:00:04:14:08:00:69:6E:74:65:72:6E:65:74<br>[/dev/cdc-wdm0] sent generic request (translated)...<br><<<<<< QMUX:<br><<<<<< length = 27<br><<<<<< flags = 0x00<br><<<<<< service = "wds"<br><<<<<< client = 17<br><<<<<< QMI:<br><<<<<< flags = "none"<br><<<<<< transaction = 1<br><<<<<< tlv_length = 15<br><<<<<< message = "Start Network" (0x0020)<br><<<<<< TLV:<br><<<<<< type = "IP Family Preference" (0x19)<br><<<<<< length = 1<br><<<<<< value = 04<br><<<<<< translated = ipv4<br><<<<<< TLV:<br><<<<<< type = "APN" (0x14)<br><<<<<< length = 8<br><<<<<< value = 69:6E:74:65:72:6E:65:74<br><<<<<< translated = internet<br>[/dev/cdc-wdm0] received message...<br><<<<<< RAW:<br><<<<<< length = 39<br><<<<<< data = 01:26:00:80:01:11:02:01:00:20:00:1A:00:02:04:00:01:00:0E:00:01:04:00:00:00:00:00:10:02:00:03:0<br>0:11:04:00:03:00:D1:07<br>[/dev/cdc-wdm0] received generic response (translated)...<br><<<<<< QMUX:<br><<<<<< length = 38<br><<<<<< flags = 0x80<br><<<<<< service = "wds"<br><<<<<< client = 17<br><<<<<< QMI:<br><<<<<< flags = "response"<br><<<<<< transaction = 1<br><<<<<< tlv_length = 26<br><<<<<< message = "Start Network" (0x0020)<br><<<<<< TLV:<br><<<<<< type = "Result" (0x02)<br><<<<<< length = 4<br><<<<<< value = 01:00:0E:00<br><<<<<< translated = FAILURE: CallFailed<br><<<<<< TLV:<br><<<<<< type = "Packet Data Handle" (0x01)<br><<<<<< length = 4<br><<<<<< value = 00:00:00:00<br><<<<<< translated = 0<br><<<<<< TLV:<br><<<<<< type = "Call End Reason" (0x10)<br><<<<<< length = 2<br><<<<<< value = 03:00<br><<<<<< translated = generic-no-service<br><<<<<< TLV:<br><<<<<< type = "Verbose Call End Reason" (0x11)<br><<<<<< length = 4<br><<<<<< value = 03:00:D1:07<br><<<<<< translated = [ type = 'cm' reason = '2001' ]<br>[/dev/cdc-wdm0] Client ID not released:<br> Service: 'wds'<br> CID: '17'<br>[/dev/cdc-wdm0] Releasing 'wds' client with flags 'none'...<br>[/dev/cdc-wdm0] Unregistered 'wds' client with ID '17'<br>Client released<br>Closed<br></div><div><br></div><div>Is there any explanation of what these errors actually mean?</div><div><br></div><div>Thanks.</div><div><br></div><div>Tom Isaacson</div><div><br></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><span><div dir="ltr" style="margin-left:0pt" align="left"><table style="border:none;border-collapse:collapse"><colgroup><col width="20"><col width="173"><col width="175"></colgroup><tbody><tr style="height:18pt"><td colspan="2" style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(0,178,190);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap">Tom Isaacson</span></p></td><td rowspan="5" style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Roboto,sans-serif;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:113px;height:32px"><img src="https://lh5.googleusercontent.com/HTS-qYUlv27dUaAg-R1UIlnvols3YOiN8kKgyAi6ATUN2SjkXpZEyh4LbNfnP5qMOdLlZkrKDGW76cVyvMqJOYRTQ3wiFXuY4EpiIYndDAyyC1UZ9VojAXzg9e5epmjKlQV1xwVl" width="113" height="33.2354007979688" style="margin-left: 0px;"></span></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(102,102,102);vertical-align:baseline;white-space:pre-wrap">6 Apollo Drive, Rosedale Auckland 0632</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(102,102,102);vertical-align:baseline;white-space:pre-wrap">PO Box 300622, Albany </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(102,102,102);vertical-align:baseline;white-space:pre-wrap">Auckland 0752</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(102,102,102);vertical-align:baseline;white-space:pre-wrap">New Zealand</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><a href="http://www.teknique.com/" target="_blank"><span style="font-size:9pt;font-family:Arial;color:rgb(0,178,190);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap">www.teknique.com</span></a></p></td></tr><tr style="height:39pt"><td colspan="2" style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(102,102,102);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Principal Software Engineer</span></p></td></tr><tr style="height:12pt"><td style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(0,178,190);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap">E</span></p></td><td style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(102,102,102);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><a href="mailto:tom.isaacson@teknique.com" target="_blank">tom.isaacson@teknique.com</a></span></p></td></tr><tr style="height:14pt"><td style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(0,178,190);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap">P</span></p></td><td style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(102,102,102);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">+64 9 282 3132</span></p></td></tr><tr style="height:15pt"><td style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font color="#00b2be" face="Arial"><span style="font-size:12px;white-space:pre-wrap"><b>M</b></span></font></p></td><td style="vertical-align:top;padding:2.88pt;overflow:hidden"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:Arial;color:rgb(102,102,102);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">+64 21 362021</span></p></td></tr></tbody></table></div><br></span></div></div></div></div></div>