FW: QMICLI tools examples and documentation for begginers

dominik.lastovcic at x-logic.net dominik.lastovcic at x-logic.net
Thu Sep 23 08:55:09 UTC 2021


Thank you for your advice. 

Dominik Lastovčić / Software engineer

X-LOGIC d.o.o.
Zagreb Innovation Center
Avenija Dubrovnik 15, 10000 Zagreb, Croatia
Pavilion: 12 / 1st floor / Office: 16
www.x-logic.net
www.linkedin.com/company/x-logic-ltd


-----Original Message-----
From: Aleksander Morgado <aleksander at aleksander.es> 
Sent: Thursday, September 23, 2021 9:27 AM
To: dominik.lastovcic at x-logic.net
Cc: libqmi (development) <libqmi-devel at lists.freedesktop.org>
Subject: Re: FW: QMICLI tools examples and documentation for begginers

Hey

>
> sudo qmicli -p -d /dev/cdc-wdm0 --dms-set-operating-mode='online'
>
> sudo ip link set wwan0 down
>
> echo 'Y' | sudo tee /sys/class/net/wwan0/qmi/raw_ip
>
> sudo ip link set wwan0 up
>
> sudo qmicli -p -d /dev/cdc-wdm0 
> --device-open-net='net-raw-ip|net-no-qos-header' 
> --wds-start-network="apn='m2m.tele2.com',ip-type=4" 
> --client-no-release-cid
>
> sudo udhcpc -S -n -i wwan0 (-S = log to sysfile, -n = exit if lease 
> not obtained)
>
>
>
>
>
> These commands are executed every time the wwan0 interface can’t ping 
> 8.8.8.8
>
>
>
> The problem I faces with running these commands in a loop was CID exhaustion. Do you think I could simply avoid that problem with restarting the modem every time it is unable to ping?

When you detect that the interface can't ping 8.8.8.8, you should probably not assume the WDS session is already fully disconnected, because it may be an intermittent ping failure or something like that.
Instead, you can explicitly run --wds-stop-network using the session ID returned in the start operation and also with --client-cid and the CID returned in that same operation. And after, that stop network command, try to --wds-start-network again re-using again the same WDS CID.

The CID exhaustion happens because on every start network operation you're allocation a full new WDS client; you should instead fully understand what --client-no-release-cid and --client-cid=CID do, and use them.

--
Aleksander
https://aleksander.es



More information about the libqmi-devel mailing list