question about qmicli

Galo Irarrazabal girarraz at hotmail.com
Mon Oct 26 13:52:35 UTC 2020


Thanks again Aleksander,
in respect to this:

"In your case, the error happened because you were running qmicli
against the wrong libqm"

i've found this commands to get and compile the new version of libqmi

wget http://www.freedesktop.org/software/libqmi/libqmi1.26.6.tar.xz
tar -vxf libqmi-1.16.0.tar.xz
cd libqmi-1.16.0
sudo apt-get install glib-networking libmbim-glib-dev
./configure --prefix=/usr --disable-static
make && sudo make install

in a previuos answer you indicate:
"$ LD_LIBRARY_PATH=/usr/local/lib qmicli -p -d /dev/cdc-wdm0 --nas-get-signal-strength "

 how can i found the correct locations of the new libqmi ... ?
while i wait for respone i will try to found ..

thaks in advance and best rehards

Galo Irarrazabal O.


________________________________
From: libqmi-devel <libqmi-devel-bounces at lists.freedesktop.org> on behalf of Galo Irarrazabal <girarraz at hotmail.com>
Sent: Sunday, October 25, 2020 6:55 PM
To: libqmi-devel at lists.freedesktop.org <libqmi-devel at lists.freedesktop.org>
Subject: Fw: question about qmicli


sended .. thanks
________________________________
From: Galo Irarrazabal <girarraz at hotmail.com>
Sent: Saturday, October 24, 2020 10:10 AM
To: Aleksander Morgado <aleksander at aleksander.es>
Subject: Re: question about qmicli


Hi Aleksander

Thanks a lot for your help.
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?

Note: I need to send this commands every 10 seconds.

thanks in advamce
Galo Irarrazabal O.




________________________________
From: Aleksander Morgado <aleksander at aleksander.es>
Sent: Friday, October 23, 2020 12:34 AM
To: Galo Irarrazabal <girarraz at hotmail.com>
Cc: libqmi-devel at lists.freedesktop.org <libqmi-devel at lists.freedesktop.org>
Subject: Re: question about qmicli

Hey,

> I'm writing some questions to Aleksander in the web page https://sigquit.wordpress.com/2012/08/20/an-introduction-to-libqmi/
>
>  i have a problem executing one especific qmi commnad inside a python script with the call
> content = subprocess.run("sudo qmicli -p -d /dev/cdc-wdm0 --wds-get-packet-statistics  --device-open-sync | awk '/TX packets dropped:/,/RX packets dropped:/'", check=True, shell=True,stdout=subprocess.PIPE)
>
> I've probe without -p and without --device-open-sync  but the problem is the same
> always receive as response : error: couldn't get packet statistics: QMI protocol error (15): 'OutOfCall'
>
> aleksander anser that the modem must be connected to receive response, but the modem is connected
> with ip, sending pings to google and sending http posts to another site

The fact that you're running a command with --device-open-sync may end
up disconnecting the device, because that cleans up all allocated QMI
clients. Don't do that, don't run with --device-open-sync.

Also, you need to run --wds-get-packet-statistics on the specific WDS
client that got the modem connected i.e. When you run WDS Start
Network on a WDS client, that client is the one that keeps the
connection up, and that client is the one that will give you the
packet statistics for the specific connection that was brought up.
E.g. in ModemManager we use a WDS client for IPv4 and another WDS
client for IPv6, and we can get packet statistics for both separately.

>
> but the real problem is after some minutes the response is
> [22 Oct 2020, 17:16:40] -Error ** __qmi_message_ctl_sync_response_parse: assertion 'qmi_message_get_message_id (message) == QMI_MESSAGE_CTL_SYNC' failed
>
> (qmicli:8618): GLib-GIO-CRITICAL **: 17:16:40.933: g_task_return_error: assertion 'error != NULL' failed
>
> the command is inside a try exception block but this block the execution of next qmicli commands, and really clock the connection of the modem (cell comm)
> the module user is a SIMCOM SIM7600G-H
>

That issue was fixed in this commit:
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/commit/69354f53f180b32c8f183a1217582e557b791220

I believe what you're seeing is due to using --device-open-sync. If
you use that option, you should use it exclusively on the first
command you send to the module, and only if your program is the only
one using the module, otherwise you're breaking the flow for every
other program as well. My suggestion is to completely ignore that
option, not even sure why you started to use it :)

> if i execute the same qmi command in the command line every one of then intents i get the result expected. in other terminal i run a ping to google to verify the connection
>
> how to prevent this problem? i need the params rx_dropped and tx_dropped given by this command.
>

As said before, you should run the command on the WDS client that
brought up the connection with Start Network.

> another problem is for example in the execution of this qmicli command
> contenido = subprocess.run("sudo qmicli -p -d /dev/cdc-wdm0 --nas-get-signal-strength --device-open-sync | awk '/RSSI:/,/SINR/'", check=True, shell=True,stdout=subprocess.PIPE)
>
> the result is always:
> qmicli: symbol lookup error: qmicli: undefined symbol: qmi_message_nas_get_signal_info_output_get_tdma_signal_strength_extended
>
> this not make any problem with the awk filter and i can get the parameters rssi and Ecio, but how can i get no error in the execution?
>

This is because you're running your custom compiled qmicli but using
an older libqmi-glib library. If I had to bet, you built libqmi
yourself without using a custom --prefix in configure, and so you
installed qmicli in /usr/local/bin and libqmi-glib in /usr/local/lib,
but when you run "qmicli" the PATH looks first in /usr/local so you're
running qmicli from your newly built instance but linking to
libqmi-glib in /usr/lib (probably the system-installed one).  I
believe it's Debian/Ubuntu the ones that have /usr/local/bin in the
PATH by default and that creates a big mess. I'm assuming all this,
but if it is true and you did build your own libqmi without using
--prefix in configure, try to run qmicli like this instead:

$ LD_LIBRARY_PATH=/usr/local/lib qmicli -p -d /dev/cdc-wdm0
--nas-get-signal-strength ....

Or, otherwise, install libqmi "on top" of the system-installed one
with --prefix=/usr or whatever your system uses.

--
Aleksander
https://aleksander.es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20201026/c31859e2/attachment.htm>


More information about the libqmi-devel mailing list