Quectel EC25A refusing to issue ipv4

Chris McKenzie chris at waive.car
Tue Sep 4 00:19:30 UTC 2018


So here's where I am at now.  I'm using kernel  4.17.17. The relevant parts
of my .config are as follows:

    CONFIG_USB_NET_QMI_WWAN=m
    CONFIG_USB_SERIAL_WWAN=m


I apt purged debian's installs of libmbim and friends (libmm-glib0
libmbim-glib4 libmbim-glib-dev libmbim-utils )
 along with ModemManager. (This also removed NetworkManager as well, which
is fine for now). I got the following, probably benign warnings:

    Purging configuration files for network-manager (1.12.2-2) ...
    dpkg: warning: while removing network-manager, directory
'/etc/NetworkManager/system-connections' not empty so not removed
    Purging configuration files for geoclue-2.0 (2.4.12-2) ...
    dpkg: warning: while removing geoclue-2.0, directory '/var/lib/geoclue'
not empty so not removed


Then I git cloned modemmanager and libmbim.
I checked out the latest tags, did an ./autogen.sh && make && sudo make
install:

libmbim tag 1.16.2, 0.0.1-416-g8f885e3:

    libmbim 1.16.2
    ==============================================

    Build:
      compiler:             gcc
      cflags:               -Wall -std=gnu89 -g -O2 -Wmissing-declarations
-Wmissing-prototypes -Wdeclaration-after-statement -Wstrict-prototypes
-fno-strict-aliasing -Wno-deprecated-declarations -Wint-to-pointer-cast
-Wfloat-equal -Wno-unused-parameter -Wno-sign-compare
-Wunused-but-set-variable -Wundef -Wimplicit-function-declaration
-Wpointer-arith -Winit-self -Wshadow -Wmissing-include-dirs
-Waggregate-return -Wformat-security -Werror
      ldflags:
      Maintainer mode:      yes
      Documentation:        no

    System paths:
      prefix:               /usr/local
      udev base directory:  /lib/udev

    Features:
      udev support:         yes
      MBIM username:        no (root)


ModemManager tag 1.8.0, 0.7.990-2278-gc187c5fe:

    ModemManager 1.8.0
    ==============================================

    Build:
      compiler:                gcc
      cflags:                  -Wall -std=gnu89 -g -O2
-Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement
-Wstrict-prototypes -Wno-unused-parameter -Wno-sign-compare
-Wno-deprecated-declarations -Wno-unused-but-set-variable -Wformat-security
-Werror
      ldflags:
      maintainer mode:         yes

    System paths:
      prefix:                  /usr/local
      D-Bus system directory:  ${prefix}/etc/dbus-1/system.d
      udev base directory:     /lib/udev
      systemd unit directory:  /lib/systemd/system

    Features:
      udev:                    yes
      policykit:               no
      mbim:                    yes
      qmi:                     yes
      systemd suspend/resume:  no
      systemd journal:         no

    Miscellaneous:
      gobject introspection:   no
      vala bindings:           no
      documentation:           no
      code coverage:           no

----8<----

After I was done, just to confirm everything seems to be correct in our
brave new world:

    $ ldd `which mmcli`
     ...
     libmm-glib.so.0 => /usr/local/lib/libmm-glib.so.0 (0x00007fade30f9000)
     ...

I reran the compilation of libqmi, just to "clean room" everything. Just to
be clear, I'm running MASTER for libqmi (although I'll
 happily do whatever sha1 you want)

 libqmi 1.4.0-690-gde362e9

     libqmi (libqmi-glib, qmicli) 1.21.4
    ==============================================

    compiler:              gcc
    cflags:                -Wall -std=gnu89 -g -O2 -Wmissing-declarations
-Wmissing-prototypes -Wdeclaration-after-statement -Wstrict-prototypes
-fno-strict-aliasing -Wno-deprecated-declarations -Wint-to-pointer-cast
-Wfloat-equal -Wno-unused-parameter -Wno-sign-compare
-Wunused-but-set-variable -Wundef -Wimplicit-function-declaration
-Wpointer-arith -Winit-self -Wshadow -Wmissing-include-dirs
-Waggregate-return -Wformat-security -Wtype-limits -Werror
    Maintainer mode:       yes
    udev base directory:   /lib/udev
    Documentation:         no
    QMI username:          no (root)
    QMUX over MBIM:        no

    Built items:
      libqmi-glib:         yes
      qmicli:              yes
      qmi-firmware-update: yes
          with udev:             yes
          with MM runtime check: yes

----8<----

After my final make install, I do a full system reboot, although likely
unnecessary, I'm trying to remove any possibility of user error here.

To make sure, `pgrep Modem` returns empty and `sudo lsof /dev/cdc-wdm0` is
also empty.
We are ostensibly not using modem manager and don't need to worry about
resource conflicts.


So we start. First we query our data format:

    $ sudo qmicli -d /dev/cdc-wdm0 --wda-get-data-format
    [03 Sep 2018, 16:44:34] -Warning ** [/dev/cdc-wdm0] requested auto mode
but no MBIM QMUX support available
    [/dev/cdc-wdm0] Successfully got data format
               QoS flow header: no
               Link layer protocol: 'raw-ip'
      Uplink data aggregation protocol: 'disabled'
    Downlink data aggregation protocol: 'disabled'
                 NDP signature: '0'
      Uplink data aggregation max size: '0'
    Downlink data aggregation max size: '0'

We see the raw-ip there, which was the recommendation.

Before bringing up the network I further investigate:

    $ sudo qmicli -d /dev/cdc-wdm0 --wds-get-default-settings=3gpp
    [03 Sep 2018, 16:48:16] -Warning ** [/dev/cdc-wdm0] requested auto mode
but no MBIM QMUX support available
    Default settings retrieved:
        APN: 'fast.t-mobile.com'
        PDP type: 'ipv4-or-ipv6'
        Username: ''
        Password: ''
        Auth: 'none'

Furthermore, scanning with  --wds-get-profile-list=3gpp shows that all the
PDP's are "ipv4-or-ipv6" which looks good.

So we try the forcing of ipv4 again:

# qmicli -d /dev/cdc-wdm0 --wds-set-ip-family=4 --client-no-release-cid -v

    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Opening device with
flags 'auto'...
    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] loaded driver of
cdc-wdm port: qmi_wwan
    [03 Sep 2018, 16:52:16] -Warning ** [/dev/cdc-wdm0] requested auto mode
but no MBIM QMUX support available
    [03 Sep 2018, 16:52:16] [Debug] QMI Device at '/dev/cdc-wdm0' ready
    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Assuming service 'wds'
is supported...
    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Allocating new client
ID...
    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent message...
    <<<<<< RAW:
    <<<<<<   length = 16
    <<<<<<   data   = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:01

    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent generic request
(translated)...
    <<<<<< QMUX:
    <<<<<<   length  = 15
    <<<<<<   flags   = 0x00
    <<<<<<   service = "ctl"
    <<<<<<   client  = 0
    <<<<<< QMI:
    <<<<<<   flags       = "none"
    <<<<<<   transaction = 1
    <<<<<<   tlv_length  = 4
    <<<<<<   message     = "Allocate CID" (0x0022)
    <<<<<< TLV:
    <<<<<<   type       = "Service" (0x01)
    <<<<<<   length     = 1
    <<<<<<   value      = 01
    <<<<<<   translated = wds

    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received message...
    <<<<<< RAW:
    <<<<<<   length = 24
    <<<<<<   data   =
01:17:00:80:00:00:01:01:22:00:0C:00:02:04:00:00:00:00:00:01:02:00:01:16

    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received generic
response (translated)...
    <<<<<< QMUX:
    <<<<<<   length  = 23
    <<<<<<   flags   = 0x80
    <<<<<<   service = "ctl"
    <<<<<<   client  = 0
    <<<<<< QMI:
    <<<<<<   flags       = "response"
    <<<<<<   transaction = 1
    <<<<<<   tlv_length  = 12
    <<<<<<   message     = "Allocate CID" (0x0022)
    <<<<<< TLV:
    <<<<<<   type       = "Result" (0x02)
    <<<<<<   length     = 4
    <<<<<<   value      = 00:00:00:00
    <<<<<<   translated = SUCCESS
    <<<<<< TLV:
    <<<<<<   type       = "Allocation Info" (0x01)
    <<<<<<   length     = 2
    <<<<<<   value      = 01:16
    <<<<<<   translated = [ service = 'wds' cid = '22' ]

    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Registered 'wds'
(version unknown) client with ID '22'
    [03 Sep 2018, 16:52:16] [Debug] Asynchronously set IP family...
    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent message...
    <<<<<< RAW:
    <<<<<<   length = 17
    <<<<<<   data   = 01:10:00:00:01:16:00:01:00:4D:00:04:00:01:01:00:04

    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent generic request
(translated)...
    <<<<<< QMUX:
    <<<<<<   length  = 16
    <<<<<<   flags   = 0x00
    <<<<<<   service = "wds"
    <<<<<<   client  = 22
    <<<<<< QMI:
    <<<<<<   flags       = "none"
    <<<<<<   transaction = 1
    <<<<<<   tlv_length  = 4
    <<<<<<   message     = "Set IP Family" (0x004D)
    <<<<<< TLV:
    <<<<<<   type       = "Preference" (0x01)
    <<<<<<   length     = 1
    <<<<<<   value      = 04
    <<<<<<   translated = ipv4

    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received message...
    <<<<<< RAW:
    <<<<<<   length = 20
    <<<<<<   data   =
01:13:00:80:01:16:02:01:00:4D:00:07:00:02:04:00:00:00:00:00

    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received generic
response (translated)...
    <<<<<< QMUX:
    <<<<<<   length  = 19
    <<<<<<   flags   = 0x80
    <<<<<<   service = "wds"
    <<<<<<   client  = 22
    <<<<<< QMI:
    <<<<<<   flags       = "response"
    <<<<<<   transaction = 1
    <<<<<<   tlv_length  = 7
    <<<<<<   message     = "Set IP Family" (0x004D)
    <<<<<< TLV:
    <<<<<<   type       = "Result" (0x02)
    <<<<<<   length     = 4
    <<<<<<   value      = 00:00:00:00
    <<<<<<   translated = SUCCESS

    [/dev/cdc-wdm0] Client ID not released:
        Service: 'wds'
            CID: '22'
    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Releasing 'wds' client
with flags 'none'...
    [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Unregistered 'wds'
client with ID '22'
    [03 Sep 2018, 16:52:16] [Debug] Client released
    [03 Sep 2018, 16:52:16] [Debug] Closed

Now I try to pull the network up:
$ sudo qmicli -d /dev/cdc-wdm0 --wds-start-network="APN=fast.t-mobile.com
,ip-type=4"

Which succeeds

$ sudo dhclient -4 -v wwp0s29u1u1u4i4

is the last step.

This now fails. No ipv6, no nothing.

------

Alright that failed. Let's try qmi-network instead, which relies on
/etc/qmi-network.conf, which I will start by leaving unmodified
from my last email, since it seemed to have worked.

    $ sudo pkill dhclient
    $ sudo qmi-network /dev/cdc-wdm0 start
        Loading profile at /etc/qmi-network.conf...
        /usr/local/bin/qmi-network: 2: /etc/qmi-network.conf: ip-type=4:
not found
            APN: internet
            APN user: unset
            APN password: unset
            qmi-proxy: no
        Checking data format with 'qmicli -d /dev/cdc-wdm0
--wda-get-data-format '...
        [03 Sep 2018, 17:03:53] -Warning ** [/dev/cdc-wdm0] requested auto
mode but no MBIM QMUX support available
        Device link layer protocol retrieved: raw-ip
        Getting expected data format with 'qmicli -d /dev/cdc-wdm0
--get-expected-data-format'...
        [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested auto
mode but no MBIM QMUX support available
        Expected link layer protocol retrieved: 802-3
        Updating kernel link layer protocol with 'qmicli -d /dev/cdc-wdm0
--set-expected-data-format=raw-ip'...
        [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested auto
mode but no MBIM QMUX support available
        error: cannot set expected data format: Expected data format not
updated properly to 'raw-ip': got '802-3' instead
        Error updating kernel link layer protocol
        Starting network with 'qmicli -d /dev/cdc-wdm0
--wds-start-network=apn='internet'  --client-no-release-cid '...
        [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested auto
mode but no MBIM QMUX support available
        Saving state at /tmp/qmi-network-state-cdc-wdm0... (CID: 23)
        Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH: 2267620704)
        Network started successfully

None of these things look good. Whatever, I'll try it anyway:

    $ sudo dhclient -4 wwp0s29u1u1u4i4
    fails.
    $ sudo dhclient wwp0s29u1u1u4i4
    ... eventually gives me an ipv6 address again ...

This is where I was before.

Now I'll try and put simply `APN=fast.t-mobile.com` into the
/etc/qmi-network.conf file and try the dhclient -4 again. This
doesn't seem to work.

---

I think, based on what you said before, getting this device to be in
"raw-ip" mode is key to my success here and it doesn't seem to
want to be there.

I'll update you further on my investigation, but this is the documentation
up to this point.

Outcome: Continued failure.



On Mon, Sep 3, 2018 at 12:51 AM, Aleksander Morgado <
aleksander at aleksander.es> wrote:

> Hey,
>
> >
> > My current setup includes libmbim-glib-dev 1.16.0-1 from debian/testing
> and
> > I'm using 1.4.0-690-gde362e9
> >
>
> That combination is very very very old, I would definitely suggest you
> use MM 1.8, which is 100% compatible API wise with 1.4.x.
>
> > mmcli says the IP supported is "ipv4, ipv6, ipv4v6".  I've tried the
> > --wds-set-ip-family=4 option that was recently added like so:
> >
> > # qmicli -d /dev/cdc-wdm0 --wds-set-ip-family=4 --client-no-release-cid
> -v
> > [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] Opening device with flags
> > 'auto'...
> > [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] loaded driver of cdc-wdm
> > port: qmi_wwan
> > [01 Sep 2018, 21:10:03] -Warning ** [/dev/cdc-wdm0] requested auto mode
> but
> > no MBIM QMUX support available
> > [01 Sep 2018, 21:10:03] [Debug] QMI Device at '/dev/cdc-wdm0' ready
> > [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] Assuming service 'wds' is
> > supported...
> > [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] Allocating new client
> ID...
> > [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] sent message...
> > <<<<<< RAW:
> > <<<<<<   length = 16
> > <<<<<<   data   = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:01
> >
> > [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] sent generic request
> > (translated)...
> > <<<<<< QMUX:
> > <<<<<<   length  = 15
> > <<<<<<   flags   = 0x00
> > <<<<<<   service = "ctl"
> > <<<<<<   client  = 0
> > <<<<<< QMI:
> > <<<<<<   flags       = "none"
> > <<<<<<   transaction = 1
> > <<<<<<   tlv_length  = 4
> > <<<<<<   message     = "Allocate CID" (0x0022)
> > <<<<<< TLV:
> > <<<<<<   type       = "Service" (0x01)
> > <<<<<<   length     = 1
> > <<<<<<   value      = 01
> > <<<<<<   translated = wds
> >
> > [01 Sep 2018, 21:10:06] [Debug] [/dev/cdc-wdm0] received message...
> > <<<<<< RAW:
> > <<<<<<   length = 25
> > <<<<<<   data   =
> > 01:18:00:80:03:03:02:AA:0C:20:00:0C:00:02:04:00:00:00:00:00:
> 01:02:00:C8:08
> >
> > [01 Sep 2018, 21:10:06] [Debug] [/dev/cdc-wdm0] received generic response
> > (translated)...
> > <<<<<< QMUX:
> > <<<<<<   length  = 24
> > <<<<<<   flags   = 0x80
> > <<<<<<   service = "nas"
> > <<<<<<   client  = 3
> > <<<<<< QMI:
> > <<<<<<   flags       = "response"
> > <<<<<<   transaction = 3242
> > <<<<<<   tlv_length  = 12
> > <<<<<<   message     = "Get Signal Strength" (0x0020)
> > <<<<<< TLV:
> > <<<<<<   type       = "Result" (0x02)
> > <<<<<<   length     = 4
> > <<<<<<   value      = 00:00:00:00
> > <<<<<<   translated = SUCCESS
> > <<<<<< TLV:
> > <<<<<<   type       = "Signal Strength" (0x01)
> > <<<<<<   length     = 2
> > <<<<<<   value      = C8:08
> > <<<<<<   translated = [ strength = '-56' radio_interface = 'lte' ]
> >
> > [01 Sep 2018, 21:10:06] [Debug] [/dev/cdc-wdm0] No transaction matched in
> > received message
> >
> > error: couldn't create client for the 'wds' service: CID allocation
> failed
> > in the CTL client: Transaction timed out
>
> You're hijacking the cdc-wdm port as MM is also running and trying to
> use it through the qmi-proxy. You should use the "-p" option always
> when running qmicli ccommands.
> Also, anyway, you should decide how you want to setup the connection:
>  * MM
>  * qmi-network
>  * qmicli manually
>
> And make sure you stick to one of those methods only, otherwise you
> may be interfering with the others.
>
> >
> > ----->8----
> >
> > I've separately tried addressing this through /etc/qmi-network.conf by
> > making the content as follows:
> >
> > APN=network
> > IP-TYPE=4
> >
> > Then I tried to start the network (with and without the ip-type=4 line).
> > With the ip-type=4 line I get the following:
> >
> > loading profile at /etc/qmi-network.conf...
> > /usr/local/bin/qmi-network: 2: /etc/qmi-network.conf: ip-type=4: not
> found
> >     APN: internet
> >     APN user: unset
> >     APN password: unset
> >     qmi-proxy: no
> > Checking data format with 'qmicli -d /dev/cdc-wdm0 --wda-get-data-format
> > '...
> > [01 Sep 2018, 21:24:01] -Warning ** [/dev/cdc-wdm0] requested auto mode
> but
> > no MBIM QMUX support available
> > Device link layer protocol retrieved: raw-ip
> > Getting expected data format with 'qmicli -d /dev/cdc-wdm0
> > --get-expected-data-format'...
> > [01 Sep 2018, 21:24:01] -Warning ** [/dev/cdc-wdm0] requested auto mode
> but
> > no MBIM QMUX support available
> > Expected link layer protocol retrieved: raw-ip
> > Device and kernel link layer protocol match: raw-ip
> > Starting network with 'qmicli -d /dev/cdc-wdm0
> > --wds-start-network=apn='internet'  --client-no-release-cid '...
> > [01 Sep 2018, 21:24:01] -Warning ** [/dev/cdc-wdm0] requested auto mode
> but
> > no MBIM QMUX support available
> > Saving state at /tmp/qmi-network-state-cdc-wdm0... (CID: 24)
> > Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH: 2267257648)
> > Network started successfully
> >
>
> That's good.
>
> >
> > Then I do something like
> >
> >
> > dhclient -4 wwp0s29u1u1u4i4
> >
> >
> > which returns immediately
> >
> > Then I do an ip addr show and see I have, much to my dismay only an ipv6
> > address.
> >
>
> I'm tempted to say that this could be due to the device requiring
> raw-ip in the network interface and your network interface still
> configured for 802.3 frames.
> IIRC the Quectel devices were too strict with the raw-ip/802.3
> requirement and they do require raw-ip explicitly.
>
> You have raw-ip support in kernels >= 4.5, although the corresponding
> patches are easily backport-able if needed.
>
> > We have a few thousand of these quectels on order which are going to be
> in
> > embedded devices so I guess I could have some massive ipv6to4 bridge
> running
> > but I'd rather not and I'd much rather have an ipv6 AND ipv4 address
> like I
> > can get on windows - I'd also be ok with only an ipv4 address. I'm
> probably
> > not ok however, with exclusively an ipv6.
> >
> > Any clues on how I can get this device to register an ipv4 address?  The
> > carrier is T-Mobile btw, if that makes a difference.
> >
>
> I would definitely try with a newer stack: Linux >= 4.5, libqmi 1.20,
> MM 1.8.0 and NM 1.10/1.12.
>
> --
> Aleksander
> https://aleksander.es
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20180903/6cf7a82a/attachment-0001.html>


More information about the libqmi-devel mailing list