libqmi instead of NetworkManager?

Aleksander Morgado aleksander at aleksander.es
Fri Oct 2 01:21:50 PDT 2015


Hi Paul,

On Fri, Oct 2, 2015 at 12:00 AM, Paul R <r_paulr at outlook.es> wrote:
>
> I'm a newbie to 3G modems on Linux, using libqmi-1.8 to control a Sierra
> MC7354 mini-PCI modem in an embarked system (Ubuntu 14.04.2LTS, 3.16
> kernel).
> NetworkManager starts a 3GPP connection using this hardware, and I can get
> an IP and test ping ok. But it takes a couple of minutes to re-establish
> connection when signal is lost after is received again. I´d like to use
> libqmi and not Network-Manager to detect and handle this situation faster,
> and easily . I can´t wait two minutes to recover from this on an embarked
> system and it seems libqmi goes faster for this.
>

Note that NetworkManager is not really the one setting up all the
communication with the modem, ModemManager is doing that, and
ModemManager itself is using libqmi internally.

You say it takes a couple of minutes to re-establish connection when
signal is lost after is received again. I'm assuming you have the
settings configured as auto-connect in NetworkManager, right?

Also, it's not that libqmi "goes faster"; it likely is that
ModemManager does more steps than your single qmicli commands. And of
course, if using libqmi, you'll need to detect the disconnection and
re-connect yourself (i.e. a single --wda-start-network won't
reconnect).

> But if I disable NetworkManager in my Linux boot, and I do a simple
> qmi-network /dev/cdc_wdm0 start it blocks on DHCP acquisition:
>
> # ./utils/qmi-network /dev/cdc-wdm0 start
>
> Loading profile...
>     APN: myapn.com
> Starting network with 'qmicli -d /dev/cdc-wdm0 --wds-start-network=myapn.com
> --client-no-release-cid'...
> Saving state... (CID: 8)
> Saving state... (PDH: 1205839304)
> Network started successfully            ---> Is OK...but...
>
> #ifup wwan0
> Internet Systems Consortium DHCP Client 4.2.4
> Copyright 2004-2012 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
> Listening on LPF/wwan0/96:49:7d:1c:8b:67
> Sending on   LPF/wwan0/96:49:7d:1c:8b:67
> Sending on   Socket/fallback
> DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 3 (xid=0x6dc65ce8)
> ...
> and it blocks in this DHCP.
>
> BUT, if I start NetworkManager (at boot or in any moment), then I STOP it,
> and do the same again, it works.
> So...what does NetworkManager do, that correctly initializes my modem, and I
> can´t do with libqmi ?. Does qmicli initialize the modem?


This really looks like you're using the network interface that is set
as raw-ip by default. Basically, your MC7304 likely exposes 2 WWAN+QMI
pairs: one of them being "raw-ip" and the other one being "802.3". You
need to use the one that comes in "802.3" OR automatically convert the
"raw-ip" one to "802.3". ModemManager takes care of that for you
automatically, but if you prefer to use qmicli instead, you can always
do a a "--wda-set-data-format=802-3" command BEFORE the start network.

So yeah, qmicli doesn't explicitly "initialize" anything in the modem
for you, it just provides you the commands to do it. ModemManager,
instead, does a lot of those initializations already.

> Also, wen using NetworkManager I see lots of CDMA trial an error probes. I´m
> not going to use CDMA. How can I disable it with libqmi?
> Could you help me?

Could you provide the messages you're talking about?

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list