Quectel EC25A refusing to issue ipv4

Aleksander Morgado aleksander at aleksander.es
Tue Sep 4 12:15:02 UTC 2018


Hey,

> 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.
>

Ok.

> 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
>

Yes, but it will be disconnected right after the command returns
because the CID that was used for the command was released
automatically. You can prevent this using --client-no-release-cid, and
then you can re-use the CID in the next WDS commands you send with
--client-cid=CID.

> $ sudo dhclient -4 -v wwp0s29u1u1u4i4
>
> is the last step.
>
> This now fails. No ipv6, no nothing.
>

In this case, it's just because of the above, the modem is already
disconnected at this point as the CID was released.

> ------
>
> 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:
>

That's strange. If you're using a kernel >= 4.5 you shouldn't have had
any issue running --set-expected-data-format=raw-ip.

>     $ sudo dhclient -4 wwp0s29u1u1u4i4
>     fails.
>     $ sudo dhclient wwp0s29u1u1u4i4
>     ... eventually gives me an ipv6 address again ...
>
> This is where I was before.
>

I think you need to investigate a bit more why the kernel failed to
set raw-ip for the WWAN interface.
Also, please note that when an interface is in raw-ip mode, dhclient
will NOT work as it doesn't know how to set the interface up. There
are other DHCP clients out there that support that operation, just not
all.
Instead, you can run --wds-get-current-settings and manually apply the
settings on the interface and set up the default routes as you wish.
qmi-network only puts the modem in connected mode, it doesn't setup
the network interface.

If you need a solution that does all (modem connect, wwan iface setup
and default route management) then libqmi+ModemManager+NetworkManager
is the best solution.

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list