Using qmicli with a Sierra Wireless EM7455

Aleksander Morgado aleksander at aleksander.es
Tue Jun 23 07:18:04 UTC 2020


Hey!

> > > My resources for the proceeding I am reporting about here are: I
> > > started out at [1]
> > > https://wiki.archlinux.org/index.php/ThinkPad_mobile_Internet. I then
> > > tried to follow step-by-step the commands in the script mentioned in
> > > [1]: [2] https://github.com/penguin2716/qmi_setup. Googling for my
> > > error message I ended up with during following [2] led me to [3]
> > > https://lists.freedesktop.org/archives/libqmi-devel/2017-March/002193.html
> > > and [4] https://bugzilla.redhat.com/show_bug.cgi?id=1379406. After
> > > this the libqmi-devel mailing list came to my attention, so I am
> > > asking now here for advice. I am not using any front-end tool; I would
> > > like to use qmicli and qmi-network directly.
> >
> > Could you please let us know what your error message is? Please don't
> > make me click all those links to try to guess what your issue is ;)
>
> This was just the summary; the exact error message was:
>
> > The call of `qmicli` in the abovementioned list failed with:
> >
> > error: couldn't set operating mode: QMI protocol error (60): 'InvalidTransition'
>
> where the "call of qmicli in the abovementioned list" was:
>
> $ qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode online
>

For that specific issue, the --dms-set-fcc-authentication should be
what was needed.

> > > $ qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode online
> >
> > I would advice to always use the "-p" option when running qmicli
> > commands, and also configure PROXY=yes in the qmi-network profile
> > you're using. But for your initial assessment it may not be strictly
> > necessary.
>
> Why should I do so?
>

If you run your QMI commands through the qmi-proxy (or your MBIM
commands through the mbim-proxy), you can have multiple processes
running commands at the same time, as long as they all use the proxy.

> > > [/dev/cdc-wdm0] Operating mode retrieved:
> > >     Mode: 'low-power'
> > >     Reason: 'unknown'
> > >     HW restricted: 'no'
> >
> > Ok, if the modem was in low-power mode and it didn't allow you to put
> > it into online mode, please run:
> > $ sudo qmicli -d /dev/cdc-wdm0 --dms-set-fcc-authentication
>
> Okay.
>

That above should allow you to put the modem in full power mode (radio
state ON in MBIM).

> > > Loading profile at /etc/qmi-network.conf...
> > >     APN: internet.telekom
> > >     APN user: telekom
> > >     APN password: telekom
> > >     qmi-proxy: no
> > > Checking data format with 'qmicli -d /dev/cdc-wdm0 --wda-get-data-format '...
> > > Device link layer protocol retrieved: raw-ip
> > > Getting expected data format with 'qmicli -d /dev/cdc-wdm0
> > > --get-expected-data-format'...
> > > error: cannot get expected data format: Expected data format not
> > > retrieved properly: Failed to open file
> > > '/sys/class/net/wwp0s20f0u5i12/qmi/raw_ip': No such file or directory
> > > [19 Jun 2020, 16:15:15] -Warning ** [/dev/cdc-wdm0] MBIM device wasn't
> > > explicitly closed
> >
> > Ohhhhhhhh! Your EM7455 is running in MBIM mode, not in QMI mode!
> > Time to switch to mbimcli and mbim-network :D Please try with those.
> > Until now you have been running QMI commands "over MBIM", which is why
> > you didn't notice major problems. Now you can also ignore all the
> > comments above regarding the raw-ip requirement, that is a QMI thing
> > only.
>
> Should I send further messages to libmbim-devel at lists.freedesktop.org then?
>

Whatever you prefer, but you're very close to having everything ready anyway :D

>
> I obtained some useful results; logs of all commands run are attached.
> The network was started successfully, however with a line containing
> the phrase 'Network error', a line which I do not really understand.
> It states, amongst other things:
>
> `Available data classes: 'lte' Current cellular class: 'gsm'`
>
> The SIM is an LTE one.
>

The output of mbim-network shows you're registered, which is what you need.

> After having run `mbim-network`, I tried to start `dhcpcd` on the
> device, which failed by timeout (log is contained in the archive as
> well, together with the Journal log).
>
> Maybe the output of the call `$ mbim-network /dev/cdc-wdm0 start`
> makes more sense to you than to me?
>

Here's your command output; see inline.

>
>
> Command: mbim-network /dev/cdc-wdm0 start
>
> Loading profile at /etc/mbim-network.conf...
>     APN: internet.telekom
>     APN auth protocol: PAP
>     APN user: telekom
>     APN password: telekom
>     mbim-proxy: no
> Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close '...
> [/dev/cdc-wdm0] Subscriber ready status retrieved: Ready state: 'initialized' Subscriber ID: 'xxxxxxxxxxxxxxx' SIM ICCID: 'xxxxxxxxxxxxxxxxxxxx' Ready info: 'none' Telephone numbers: (1) '+xxxxxxxxxxxxx' [/dev/cdc-wdm0] Session not closed: TRID: '3'
> Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 3)

This is good, your SIM is ready to be used.

> Querying registration state 'mbimcli -d /dev/cdc-wdm0 --query-registration-state --no-open=3 --no-close '...
> [/dev/cdc-wdm0] Registration status: Network error: 'unknown' Register state: 'home' Register mode: 'automatic' Available data classes: 'lte' Current cellular class: 'gsm' Provider ID: '26201' Provider name: 'Telekom.de' Roaming text: 'unknown' Registration flags: 'packet-service-automatic-attach' [/dev/cdc-wdm0] Session not closed: TRID: '4'
> Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 4)

This is good, you're already registered in your home network. What
does mbimcli --query-signal-state say about the access technology in
use?

> Attaching to packet service with 'mbimcli -d /dev/cdc-wdm0 --attach-packet-service --no-open=4 --no-close '...
> Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 5)
> Starting network with 'mbimcli -d /dev/cdc-wdm0 --connect=apn='internet.telekom',auth='PAP',username='telekom',password='telekom' --no-open=5 --no-close '...
> Network started successfully
> Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 7)

This is good, the network connection to the APN you specified is now
up. The only thing missing is setting up the network interface with
the required IP settings.

I truly don't remember whether your modem supports DHCP to setup the
network interface, because by default we don't do that in
ModemManager, given that not all MBIM modems have a DHCP server
running inside. Instead, what we do in MM, and what you should
probably do is use mbimcli --query-ip-configuration to retrieve what
are the IP settings to configure in the network interface.
mbim-network doesn't do that for you so far.

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list