qmicli sometimes fails to connect
Tom Isaacson
tom.isaacson at teknique.com
Wed Jun 10 04:27:02 UTC 2020
I eventually got this to work:
1. Check an SD card is present (no point in hanging around otherwise):
qmicli --device=/dev/cdc-wdm0 --device-open-qmi --uim-get-card-status
2. Wait for GSM, WCDMA or LTE status to show available: qmicli -d
/dev/cdc-wdm0 --device-open-qmi --nas-get-system-info
3. Then connect: qmicli -d /dev/cdc-wdm0 --device-open-qmi
--wds-start-network="ip-type=4,apn=internet" --client-no-release-cid
On Wed, Jun 3, 2020 at 10:02 PM Tom Isaacson <tom.isaacson at teknique.com>
wrote:
> 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 /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.
>
> Step 1: Set link type to raw ip
> $ echo Y > /sys/class/net/wwan0/qmi/raw_ip
> Step 2: Bring interface up
> $ ip link set dev wwan0 up
> Step 3: Start Network (apn name MAY need to be SIM specific)
> $ qmicli -d /dev/cdc-wdm0 --device-open-qmi
> --wds-start-network="ip-type=4,apn=internet" --client-no-release-cid
> Step 4: Obtain IP lease
> $ udhcpc -q -f -n -i wwan0
>
> Calling step 3 with "-v" gives me:
> "qmicli -d /dev/cdc-wdm0 --device-open-qmi
> --wds-start-network="ip-type=4,apn=internet" --client-no-release-cid -v"
> [/dev/cdc-wdm0] Opening device with flags 'none'...
> [/dev/cdc-wdm0] loaded driver of cdc-wdm port: qmi_wwan
> [/dev/cdc-wdm0] created endpoint
> QMI Device at '/dev/cdc-wdm0' ready
> [/dev/cdc-wdm0] Assuming service 'wds' is supported...
> [/dev/cdc-wdm0] Allocating new client ID...
> [/dev/cdc-wdm0] sent message...
> <<<<<< RAW:
> <<<<<< length = 16
> <<<<<< data = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:01
> [/dev/cdc-wdm0] sent generic request (translated)...
> <<<<<< QMUX:
> <<<<<< length = 15
> <<<<<< flags = 0x00
> <<<<<< service = "ctl"
> <<<<<< client = 0
> <<<<<< QMI:
> <<<<<< flags = "none"
> <<<<<< transaction = 1
> <<<<<< tlv_length = 4
> <<<<<< message = "Allocate CID" (0x0022)
> <<<<<< TLV:
> <<<<<< type = "Service" (0x01)
> <<<<<< length = 1
> <<<<<< value = 01
> <<<<<< translated = wds
> [/dev/cdc-wdm0] received message...
> <<<<<< RAW:
> <<<<<< length = 24
> <<<<<< 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
> [/dev/cdc-wdm0] received generic response (translated)...
> <<<<<< QMUX:
> <<<<<< length = 23
> <<<<<< flags = 0x80
> <<<<<< service = "ctl"
> <<<<<< client = 0
> <<<<<< QMI:
> <<<<<< flags = "response"
> <<<<<< transaction = 1
> <<<<<< tlv_length = 12
> <<<<<< message = "Allocate CID" (0x0022)
> <<<<<< TLV:
> <<<<<< type = "Result" (0x02)
> <<<<<< length = 4
> <<<<<< value = 00:00:00:00
> <<<<<< translated = SUCCESS
> <<<<<< TLV:
> <<<<<< type = "Allocation Info" (0x01)
> <<<<<< length = 2
> <<<<<< value = 01:11
> <<<<<< translated = [ service = 'wds' cid = '17' ]
> [/dev/cdc-wdm0] Registered 'wds' (version unknown) client with ID '17'
> Network start parameters set (apn: 'internet', 3gpp_profile: '0',
> 3gpp2_profile: '0', auth: 'unspecified', ip-type: '4', username:
> 'unspecified', password: 'unspecified', autoconnect: 'unspecified')
> Asynchronously starting network...
> [/dev/cdc-wdm0] sent message...
> <<<<<< RAW:
> <<<<<< length = 28
> <<<<<< data = 01:1B:00:00:01
> :11:00:01:00:20:00:0F:00:19:01:00:04:14:08:00:69:6E:74:65:72:6E:65:74
> [/dev/cdc-wdm0] sent generic request (translated)...
> <<<<<< QMUX:
> <<<<<< length = 27
> <<<<<< flags = 0x00
> <<<<<< service = "wds"
> <<<<<< client = 17
> <<<<<< QMI:
> <<<<<< flags = "none"
> <<<<<< transaction = 1
> <<<<<< tlv_length = 15
> <<<<<< message = "Start Network" (0x0020)
> <<<<<< TLV:
> <<<<<< type = "IP Family Preference" (0x19)
> <<<<<< length = 1
> <<<<<< value = 04
> <<<<<< translated = ipv4
> <<<<<< TLV:
> <<<<<< type = "APN" (0x14)
> <<<<<< length = 8
> <<<<<< value = 69:6E:74:65:72:6E:65:74
> <<<<<< translated = internet
> [/dev/cdc-wdm0] received message...
> <<<<<< RAW:
> <<<<<< length = 39
> <<<<<< 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
> 0:11:04:00:03:00:D1:07
> [/dev/cdc-wdm0] received generic response (translated)...
> <<<<<< QMUX:
> <<<<<< length = 38
> <<<<<< flags = 0x80
> <<<<<< service = "wds"
> <<<<<< client = 17
> <<<<<< QMI:
> <<<<<< flags = "response"
> <<<<<< transaction = 1
> <<<<<< tlv_length = 26
> <<<<<< message = "Start Network" (0x0020)
> <<<<<< TLV:
> <<<<<< type = "Result" (0x02)
> <<<<<< length = 4
> <<<<<< value = 01:00:0E:00
> <<<<<< translated = FAILURE: CallFailed
> <<<<<< TLV:
> <<<<<< type = "Packet Data Handle" (0x01)
> <<<<<< length = 4
> <<<<<< value = 00:00:00:00
> <<<<<< translated = 0
> <<<<<< TLV:
> <<<<<< type = "Call End Reason" (0x10)
> <<<<<< length = 2
> <<<<<< value = 03:00
> <<<<<< translated = generic-no-service
> <<<<<< TLV:
> <<<<<< type = "Verbose Call End Reason" (0x11)
> <<<<<< length = 4
> <<<<<< value = 03:00:D1:07
> <<<<<< translated = [ type = 'cm' reason = '2001' ]
> [/dev/cdc-wdm0] Client ID not released:
> Service: 'wds'
> CID: '17'
> [/dev/cdc-wdm0] Releasing 'wds' client with flags 'none'...
> [/dev/cdc-wdm0] Unregistered 'wds' client with ID '17'
> Client released
> Closed
>
> Is there any explanation of what these errors actually mean?
>
> Thanks.
>
> Tom Isaacson
>
>
--
Tom Isaacson
6 Apollo Drive, Rosedale Auckland 0632
PO Box 300622, Albany
Auckland 0752
New Zealand
www.teknique.com
Principal Software Engineer
E
tom.isaacson at teknique.com
P
+64 9 282 3132
*M*
+64 21 362021
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20200610/70b86f63/attachment.htm>
More information about the libqmi-devel
mailing list