Quectel UC20: Correct way to get it up and running on embedded?

Einar Jón tolvupostur at gmail.com
Mon Apr 3 11:02:28 UTC 2017


Hi again.

This is still a mess...

On 28 March 2017 at 22:45, Aleksander Morgado <aleksander at aleksander.es> wrote:
> On Tue, Mar 28, 2017 at 8:39 PM, Dan Williams <dcbw at redhat.com> wrote:
>>> > > RE PolicyMismatch: we're not quite sure what that error
>>> > > represents;
>>> > > we've determined that in some cases it means IPv4 vs. IPv6
>>> > > mismatch and
>>> > > profiles in the modem, but that doesn't seem to always be the
>>> > > case.
>>> >
>>> > I'm not sure what is causing it, but it's quite easy to reproduce
>>> > by
>>> > messing with the kernel module (e.g. reloading it):
>>> > $ sudo rmmod qmi_wwan
>>> > $ sudo modprobe qmi_wwan
>>>
>>> My best guess is that you experience some mismatch between an
>>> auto-connected bearer and the bearer you try to connect.  But it's a
>>> wild guess.  Try messing with the preconfigured profiles, changing
>>> between IP, IPV6 and IPV4V6 contexts and see if you can prevent the
>>> issue that way.

I'm not sure how to do that. mmcli -m 0 returns:
  IP       |      supported: 'ipv4, ipv6, ipv4v6'

I can easily trigger the mismatch with an usbreset, like Bjørn
suggested - it does not fix the broken state, but it gets me into
it... :(
I think it might be related to the changing modem ID.
# on startup:
Mar 29 13:29:59 ubuntu12 modemmonitor[1508]: Setup modem:
/org/freedesktop/ModemManager1/Modem/0
Mar 29 13:29:59 ubuntu12 modemmonitor[1508]: Sim:
/org/freedesktop/ModemManager1/SIM/0
# do rmmod/modprobe qmi_wwan or usbreset (like Björn recommeded)
Mar 29 13:33:55 ubuntu12 modemmonitor[1508]: Setup modem:
/org/freedesktop/ModemManager1/Modem/1
Mar 29 13:33:55 ubuntu12 modemmonitor[1508]: Sim:
/org/freedesktop/ModemManager1/SIM/1
# do rmmod/modprobe qmi_wwan or usbreset again
Mar 29 13:40:41 ubuntu12 modemmonitor[1508]: Setup modem:
/org/freedesktop/ModemManager1/Modem/2
Mar 29 13:40:41 ubuntu12 modemmonitor[1508]: Sim:
/org/freedesktop/ModemManager1/SIM/2

Each time I do a rmmod/modprobe qmi_wwan or usbreset the ID of the
Modem/SIM is increased by 1.
After the first one I get the error on bearer connect:
Bearer connect failed (attempt 4):
org.freedesktop.libqmi.Error.Protocol.PolicyMismatch: QMI protocol
error (79): 'PolicyMismatch'
Killing ModemManager and restarting it does not help.

I think I have to reset the modem, but the only proper way to do that
seems to be sending an AT+QRST=1,0 command to the modem. That can be
done with a tool like minicom (minicom -b 115200  /dev/ttyUSB3)
I recompiled the kernel with Qualcomm additions to add
/dev/ttyUSB[0-3] devices, but now it seems like ModemManager is
hogging ttyUSB3:
$ sudo lsof /dev/ttyUSB3
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
ModemMana 5024 root   11u   CHR  188,3      0t0 476554 /dev/ttyUSB3

$ mmcli  -m 1
  System   |         device:
'/sys/devices/pci0000:00/0000:00:17.0/0000:01:00.0/0000:02:08.3/usb2/2-3'
           |        drivers: 'qmi_wwan, option1'
           |         plugin: 'Generic'
           |   primary port: 'cdc-wdm0'
           |          ports: 'ttyUSB0 (qcdm), ttyUSB2 (at), ttyUSB3
(at), wwan0 (net), cdc-wdm0 (qmi)'

If I stop the modemmanager service I can connect to the  /dev/ttyUSB3.

Why/how is ModemManager using the serial port?
Can I send a serial command via the python interface of ModemManager?
Basically this, in python, and not only allowed in debug mode...
$ mmcli -m 0 --command="AT+QRST=1,0"
error: command failed:
'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unauthorized:
Cannot send AT command to modem: operation only allowed in debug mode'

>>
>> Are the QMI "autoconnect" settings actually the EPS Default Bearer, or
>> are they different?  Maybe
>>
>> qmicli --wds-set-autoconnect-settings=disabled
>>
>> would do the trick, but I don't know for sure.
>
> I don't think the auto-connection in QMI relates to the EPS Default
> Bearer, although also, not sure :)

I'm not sure if this is helpful, but my qmicli is old (ubuntu 12) so
there are no
--wds-set-* commands available.
I did try
sudo qmicli -d /dev/cdc-wdm0 --wds-reset -p -v
and that succeeded, but my modem still gets the PolicyMismatch error.

$ qmicli -V

qmicli 1.12.6
Copyright (C) 2015 Aleksander Morgado
License GPLv2+: GNU GPL version 2 or later
<http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ qmicli --help-wds
Usage:
  qmicli [OPTION...] - Control QMI devices

WDS options
  --wds-start-network=[(APN),(PAP|CHAP|BOTH),(Username),(Password)]
                 Start network (Authentication, Username and Password
are optional)
  --wds-follow-network
                 Follow the network status until disconnected. Use
with `--wds-start-network'
  --wds-stop-network=[Packet data handle]
                 Stop network
  --wds-get-packet-service-status
                 Get packet service status
  --wds-get-packet-statistics
                 Get packet statistics
  --wds-get-data-bearer-technology
                 Get data bearer technology
  --wds-get-current-data-bearer-technology
                 Get current data bearer technology
  --wds-get-profile-list=[3gpp|3gpp2]
                 Get profile list
  --wds-get-default-settings=[3gpp|3gpp2]
                 Get default settings
  --wds-reset
                 Reset the service state
  --wds-noop
                 Just allocate or release a WDS client. Use with
`--client-no-release-cid' and/or `--client-cid'

Thanks for the help so far,
Einar Jón


More information about the ModemManager-devel mailing list