Fw: question about qmicli

Aleksander Morgado aleksander at aleksander.es
Mon Oct 26 08:30:14 UTC 2020


Hey Galo,

> The previous problems are ok now, but i have another problem
> with the execution of the command:
>
> after a number of qmi commands,  the response fail and a error begin:
>
> $ sudo LD_LIBRARY_PATH=/usr/local/lib qmicli -p -d /dev/cdc-wdm0 --nas-get-system-info
> error: couldn't create client for the 'nas' service: QMI protocol error (5): 'ClientIdsExhausted'
>
> sudo LD_LIBRARY_PATH=/usr/local/lib  qmicli -p -d /dev/cdc-wdm0 --nas-get-signal-strength
> error: couldn't create client for the 'nas' service: QMI protocol error (5): 'ClientIdsExhausted'
>
> sudo LD_LIBRARY_PATH=/usr/local/lib qmicli -p -d /dev/cdc-wdm0 --nas-get-signal-info | grep 'info'
> error: couldn't create client for the 'nas' service: QMI protocol error (5): 'ClientIdsExhausted'
>
> what causes this errors and  how to solve this?
>

The "ClientIdsExhausted" means that you can no longer allocate more
NAS clients because you've already allocated too many. This should not
happen under normal operation if you just run "qmicli -p -d
/dev/cdc-wdm0 --nas-get-signal-info" because that command will
allocate a new client, run the NAS Get Signal Info, and then release
the client.

In your case, the error happened because you were running qmicli
against the wrong libqmi, and so you were allocating a new client,
running the NAS Get Signal Info, and then crashing qmicli before the
clean release. If you don't have the crashes, you won't have that
ClientIdsExhausted error.

But, while we're at it, there's another suggestion that I can give
here. If you plan to run the same NAS Get Signal Info command over and
over every 10s, you could allocate one single NAS client and re-use it
for all your commands every 10s, instead of doing the client
allocation/release for every command you run. You can easily do so
like this:

// Allocate a new NAS client and don't release it
qmicli -d /dev/cdc-wdm0 -p --nas-noop --client-no-release-cid
// the output will give you the "Client ID" value XXX

while [ xxx ]
    // Now reuse the same client as much as you need
    qmicli -d /dev/cdc-wdm0 -p --nas-get-signal-info
--client-cid=[XXX] --client-no-release-cid

// and once you no longer need the client, do a clean release (i.e.
running without --client-no-release-cid):
qmicli -d /dev/cdc-wdm0 -p --nas-noop --client-cid=[XXX]

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list