Details/sequence/order of allocate_client calls? Allocate client for WDA fails...

Martin Maurer martin.maurer at mmeacs.de
Sun Oct 1 09:10:01 UTC 2023


Am 29.09.2023 um 17:44 schrieb Martin Maurer:
>
> Am 29.09.2023 um 09:46 schrieb Martin Maurer:
>> Hello,
>>
>> I have a question about allocating clients. I use this (based on 
>> python example in repo):
>>
>> def open_ready(qmidev,result,user_data=None):
>>     print("open_ready")
>>     try:
>>         qmidev.open_finish(result)
>>     except GLib.GError as error:
>>         sys.stderr.write("Couldn't open QMI device: %s\n" % 
>> error.message)
>>         main_loop.quit()
>>         return
>>
>>     qmidev.allocate_client(Qmi.Service.DMS, Qmi.CID_NONE, 10, None, 
>> allocate_client_DMS_ready, None)
>>
>>     qmidev.allocate_client(Qmi.Service.WDA, Qmi.CID_NONE, 10, None, 
>> allocate_client_WDA_ready, None)
>>
>>     qmidev.allocate_client(Qmi.Service.WDS, Qmi.CID_NONE, 10, None, 
>> allocate_client_WDS_ready, None)
>>
>>
>> This gives me:
>>
>>
>> open_ready
>> allocate_client_DMS_ready
>> allocate_client_DMS_ready: successful
>> CID 4
>> allocate_client_WDA_ready
>> Couldn't allocate QMI client WDA: QMI protocol error (3): 'Internal'
>> device_close
>> device_close_ready
>> Query done
>> allocate_client_WDS_ready
>> Couldn't allocate QMI client WDS: CID allocation failed in the CTL 
>> client: Transaction timed out
>>
>>
>> I am using:
>>
>> $ qmicli --version
>> qmicli 1.33.8
>> Copyright (C) 2012-2023 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.
>>
>> $
>>
>>
>> Why it fails to allocate a simple WDA client? Does it need more, so 
>> that I can allocate it successfully? Or order important?
>>
>> And even when it fails, why does WDS fail afterwards?
>>
>> When I comment out "WDA" it behaves correctly:
>>
>> open_ready
>> allocate_client_DMS_ready
>> allocate_client_DMS_ready: successful
>> CID 5
>> allocate_client_WDS_ready
>> allocate_client_WDS_ready: successful
>> CID 21
>>
>> Or do I need to wait for an answer from this
>>
>> qmidev.allocate_client(Qmi.Service.DMS, Qmi.CID_NONE, 10, None, 
>> allocate_client_DMS_ready, None)
>>
>> before calling
>>
>> qmidev.allocate_client(Qmi.Service.WDA, Qmi.CID_NONE, 10, None, 
>> allocate_client_WDA_ready, None)  ?
>>
>>
>> PS: How can I query used libqmi version in Python?
>>
>> PS2: And how I can I enable debug (like -v) in Python? Some Python 
>> call? Or must I use some environment variable?
>>
>>
>> Many thanks!
>>
>> Best regards,
>>
>> Martin
>>
>
> Same happens via command line:
>
> trio at radio2:~/qmi-python $ sudo qmicli -v -p -d /dev/cdc-wdm0 
> --device-open-qmi --wda-noop
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] opening device with 
> flags 'proxy'...
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] created endpoint
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] sent message...
> <<<<<< RAW:
> <<<<<<   length = 28
> <<<<<<   data   = 01:1B:00:00:00:00:00:01:00:FF:10:00...
>
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] sent generic request 
> (translated)...
> <<<<<< QMUX:
> <<<<<<   length  = 27
> <<<<<<   flags   = 0x00
> <<<<<<   service = "ctl"
> <<<<<<   client  = 0
> <<<<<< QMI:
> <<<<<<   flags       = "none"
> <<<<<<   transaction = 1
> <<<<<<   tlv_length  = 16
> <<<<<<   message     = "Internal Proxy Open" (0xFF00)
> <<<<<< TLV:
> <<<<<<   type       = "Device Path" (0x01)
> <<<<<<   length     = 13
> <<<<<<   value      = 2F:64:65:76:2F:63:64:63:2D:77:64:6D:30
> <<<<<<   translated = /dev/cdc-wdm0
>
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] received message...
> <<<<<< RAW:
> <<<<<<   length = 19
> <<<<<<   data   = 01:12:00:80:00:00:01:01:00:FF:07:00...
>
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] received generic 
> response (translated)...
> <<<<<< QMUX:
> <<<<<<   length  = 18
> <<<<<<   flags   = 0x80
> <<<<<<   service = "ctl"
> <<<<<<   client  = 0
> <<<<<< QMI:
> <<<<<<   flags       = "response"
> <<<<<<   transaction = 1
> <<<<<<   tlv_length  = 7
> <<<<<<   message     = "Internal Proxy Open" (0xFF00)
> <<<<<< TLV:
> <<<<<<   type       = "Result" (0x02)
> <<<<<<   length     = 4
> <<<<<<   value      = 00:00:00:00
> <<<<<<   translated = SUCCESS
>
> [29 Sep 2023, 16:41:27] [Debug] QMI Device at '/dev/cdc-wdm0' ready
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] assuming service 'wda' 
> is supported...
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] allocating new client 
> ID...
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] sent message...
> <<<<<< RAW:
> <<<<<<   length = 16
> <<<<<<   data   = 01:0F:00:00:00:00:00:02:22:00:04:00...
>
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] sent generic request 
> (translated)...
> <<<<<< QMUX:
> <<<<<<   length  = 15
> <<<<<<   flags   = 0x00
> <<<<<<   service = "ctl"
> <<<<<<   client  = 0
> <<<<<< QMI:
> <<<<<<   flags       = "none"
> <<<<<<   transaction = 2
> <<<<<<   tlv_length  = 4
> <<<<<<   message     = "Allocate CID" (0x0022)
> <<<<<< TLV:
> <<<<<<   type       = "Service" (0x01)
> <<<<<<   length     = 1
> <<<<<<   value      = 1A
> <<<<<<   translated = wda
>
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] received message...
> <<<<<< RAW:
> <<<<<<   length = 19
> <<<<<<   data   = 01:12:00:80:00:00:01:02:22:00:07:00...
>
> [29 Sep 2023, 16:41:27] [Debug] [/dev/cdc-wdm0] received generic 
> response (translated)...
> <<<<<< QMUX:
> <<<<<<   length  = 18
> <<<<<<   flags   = 0x80
> <<<<<<   service = "ctl"
> <<<<<<   client  = 0
> <<<<<< QMI:
> <<<<<<   flags       = "response"
> <<<<<<   transaction = 2
> <<<<<<   tlv_length  = 7
> <<<<<<   message     = "Allocate CID" (0x0022)
> <<<<<< TLV:
> <<<<<<   type       = "Result" (0x02)
> <<<<<<   length     = 4
> <<<<<<   value      = 01:00:03:00
> <<<<<<   translated = FAILURE: Internal
>
> error: couldn't create client for the 'wda' service: QMI protocol 
> error (3): 'Internal'
> $
>
>
> I am using a self compiled libqmi 1.33.8
>
>
> wda is listed:
>
> trio at radio2:~/qmi-python $ sudo qmicli -p -d /dev/cdc-wdm0 
> --get-service-version-info
> [/dev/cdc-wdm0] Supported versions:
>         ctl (1.5)
>         wds (1.67)
>         dms (1.0)
>         nas (1.25)
>         qos (1.12)
>         wms (1.10)
>         auth (1.3)
>         at (1.2)
>         voice (2.1)
>         cat2 (2.24)
>         uim (1.46)
>         pbm (1.4)
>         test (1.0)
>         loc (2.0)
>         sar (1.0)
>         ts (1.0)
>         tmd (1.0)
>         wda (1.16)
>         csvt (1.1)
>         coex (1.0)
>         pdc (1.0)
>         rfrpe (1.0)
>         dsd (1.0)
>         unknown [0x2d] (1.0)
>         unknown [0x30] (1.0)
>         unknown [0x32] (1.0)
>         unknown [0x36] (1.0)
> trio at radio2:~/qmi-python $
>

The error itself seems to be specific to the Quectel (4G) EM05-E (two 
different firmware revisions tested, happens with both).

Getting a client for WDA works with a Quectel (5G) RM520N-GL.

I wrote a message to Quectel support for clarification.




More information about the libqmi-devel mailing list