<div dir="ltr"><div dir="ltr"><br>So here's where I am at now. I'm using kernel 4.17.17. The relevant parts of my .config are as follows:<br><br> CONFIG_USB_NET_QMI_WWAN=m<br> CONFIG_USB_SERIAL_WWAN=m<br><br><br>I apt purged debian's installs of libmbim and friends (libmm-glib0 libmbim-glib4 libmbim-glib-dev libmbim-utils )<br> along with ModemManager. (This also removed NetworkManager as well, which is fine for now). I got the following, probably benign warnings:<br> <br> Purging configuration files for network-manager (1.12.2-2) ...<br> dpkg: warning: while removing network-manager, directory '/etc/NetworkManager/system-connections' not empty so not removed<br> Purging configuration files for geoclue-2.0 (2.4.12-2) ...<br> dpkg: warning: while removing geoclue-2.0, directory '/var/lib/geoclue' not empty so not removed<br><br><br>Then I git cloned modemmanager and libmbim. <br>I checked out the latest tags, did an ./autogen.sh && make && sudo make install:<br><br>libmbim tag 1.16.2, 0.0.1-416-g8f885e3:<br><br> libmbim 1.16.2<br> ==============================================<br><br> Build:<br> compiler: gcc<br> 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<br> ldflags: <br> Maintainer mode: yes<br> Documentation: no<br><br> System paths:<br> prefix: /usr/local<br> udev base directory: /lib/udev<br><br> Features:<br> udev support: yes<br> MBIM username: no (root)<br><br><br>ModemManager tag 1.8.0, 0.7.990-2278-gc187c5fe:<br><br> ModemManager 1.8.0<br> ==============================================<br><br> Build:<br> compiler: gcc<br> 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<br> ldflags: <br> maintainer mode: yes<br><br> System paths:<br> prefix: /usr/local<br> D-Bus system directory: ${prefix}/etc/dbus-1/system.d<br> udev base directory: /lib/udev<br> systemd unit directory: /lib/systemd/system<br><br> Features:<br> udev: yes<br> policykit: no<br> mbim: yes<br> qmi: yes<br> systemd suspend/resume: no<br> systemd journal: no<br><br> Miscellaneous:<br> gobject introspection: no<br> vala bindings: no<br> documentation: no<br> code coverage: no<br><br>----8<----<br><br>After I was done, just to confirm everything seems to be correct in our brave new world:<br><br> $ ldd `which mmcli`<br> ...<br> libmm-glib.so.0 => /usr/local/lib/libmm-glib.so.0 (0x00007fade30f9000)<br> ...<br> <br>I reran the compilation of libqmi, just to "clean room" everything. Just to be clear, I'm running MASTER for libqmi (although I'll<br> happily do whatever sha1 you want)<br> <br> libqmi 1.4.0-690-gde362e9<br> <br> libqmi (libqmi-glib, qmicli) 1.21.4<br> ==============================================<br><br> compiler: gcc<br> 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<br> Maintainer mode: yes<br> udev base directory: /lib/udev<br> Documentation: no<br> QMI username: no (root)<br> QMUX over MBIM: no<br><br> Built items:<br> libqmi-glib: yes<br> qmicli: yes<br> qmi-firmware-update: yes<br> with udev: yes<br> with MM runtime check: yes<br> <br>----8<----<br><br>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.<br><br>To make sure, `pgrep Modem` returns empty and `sudo lsof /dev/cdc-wdm0` is also empty. <br>We are ostensibly not using modem manager and don't need to worry about resource conflicts.<br><br><br>So we start. First we query our data format:<br><br> $ sudo qmicli -d /dev/cdc-wdm0 --wda-get-data-format<br> [03 Sep 2018, 16:44:34] -Warning ** [/dev/cdc-wdm0] requested auto mode but no MBIM QMUX support available<br> [/dev/cdc-wdm0] Successfully got data format<br> QoS flow header: no<br> Link layer protocol: 'raw-ip'<br> Uplink data aggregation protocol: 'disabled'<br> Downlink data aggregation protocol: 'disabled'<br> NDP signature: '0'<br> Uplink data aggregation max size: '0'<br> Downlink data aggregation max size: '0'<br><br>We see the raw-ip there, which was the recommendation.<br><br>Before bringing up the network I further investigate:<br><br> $ sudo qmicli -d /dev/cdc-wdm0 --wds-get-default-settings=3gpp<br> [03 Sep 2018, 16:48:16] -Warning ** [/dev/cdc-wdm0] requested auto mode but no MBIM QMUX support available<br> Default settings retrieved:<br> APN: '<a href="http://fast.t-mobile.com">fast.t-mobile.com</a>'<br> PDP type: 'ipv4-or-ipv6'<br> Username: ''<br> Password: ''<br> Auth: 'none'<br><br>Furthermore, scanning with --wds-get-profile-list=3gpp shows that all the PDP's are "ipv4-or-ipv6" which looks good.<br><br>So we try the forcing of ipv4 again:<br><br># qmicli -d /dev/cdc-wdm0 --wds-set-ip-family=4 --client-no-release-cid -v<br><br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Opening device with flags 'auto'...<br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] loaded driver of cdc-wdm port: qmi_wwan<br> [03 Sep 2018, 16:52:16] -Warning ** [/dev/cdc-wdm0] requested auto mode but no MBIM QMUX support available<br> [03 Sep 2018, 16:52:16] [Debug] QMI Device at '/dev/cdc-wdm0' ready<br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Assuming service 'wds' is supported...<br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Allocating new client ID...<br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent message...<br> <<<<<< RAW:<br> <<<<<< length = 16<br> <<<<<< data = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:01<br><br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent generic request (translated)...<br> <<<<<< QMUX:<br> <<<<<< length = 15<br> <<<<<< flags = 0x00<br> <<<<<< service = "ctl"<br> <<<<<< client = 0<br> <<<<<< QMI:<br> <<<<<< flags = "none"<br> <<<<<< transaction = 1<br> <<<<<< tlv_length = 4<br> <<<<<< message = "Allocate CID" (0x0022)<br> <<<<<< TLV:<br> <<<<<< type = "Service" (0x01)<br> <<<<<< length = 1<br> <<<<<< value = 01<br> <<<<<< translated = wds<br><br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received message...<br> <<<<<< RAW:<br> <<<<<< length = 24<br> <<<<<< 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<br><br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received generic response (translated)...<br> <<<<<< QMUX:<br> <<<<<< length = 23<br> <<<<<< flags = 0x80<br> <<<<<< service = "ctl"<br> <<<<<< client = 0<br> <<<<<< QMI:<br> <<<<<< flags = "response"<br> <<<<<< transaction = 1<br> <<<<<< tlv_length = 12<br> <<<<<< message = "Allocate CID" (0x0022)<br> <<<<<< TLV:<br> <<<<<< type = "Result" (0x02)<br> <<<<<< length = 4<br> <<<<<< value = 00:00:00:00<br> <<<<<< translated = SUCCESS<br> <<<<<< TLV:<br> <<<<<< type = "Allocation Info" (0x01)<br> <<<<<< length = 2<br> <<<<<< value = 01:16<br> <<<<<< translated = [ service = 'wds' cid = '22' ]<br><br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Registered 'wds' (version unknown) client with ID '22'<br> [03 Sep 2018, 16:52:16] [Debug] Asynchronously set IP family...<br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent message...<br> <<<<<< RAW:<br> <<<<<< length = 17<br> <<<<<< data = 01:10:00:00:01:16:00:01:00:4D:00:04:00:01:01:00:04<br><br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent generic request (translated)...<br> <<<<<< QMUX:<br> <<<<<< length = 16<br> <<<<<< flags = 0x00<br> <<<<<< service = "wds"<br> <<<<<< client = 22<br> <<<<<< QMI:<br> <<<<<< flags = "none"<br> <<<<<< transaction = 1<br> <<<<<< tlv_length = 4<br> <<<<<< message = "Set IP Family" (0x004D)<br> <<<<<< TLV:<br> <<<<<< type = "Preference" (0x01)<br> <<<<<< length = 1<br> <<<<<< value = 04<br> <<<<<< translated = ipv4<br><br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received message...<br> <<<<<< RAW:<br> <<<<<< length = 20<br> <<<<<< data = 01:13:00:80:01:16:02:01:00:4D:00:07:00:02:04:00:00:00:00:00<br><br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received generic response (translated)...<br> <<<<<< QMUX:<br> <<<<<< length = 19<br> <<<<<< flags = 0x80<br> <<<<<< service = "wds"<br> <<<<<< client = 22<br> <<<<<< QMI:<br> <<<<<< flags = "response"<br> <<<<<< transaction = 1<br> <<<<<< tlv_length = 7<br> <<<<<< message = "Set IP Family" (0x004D)<br> <<<<<< TLV:<br> <<<<<< type = "Result" (0x02)<br> <<<<<< length = 4<br> <<<<<< value = 00:00:00:00<br> <<<<<< translated = SUCCESS<br><br> [/dev/cdc-wdm0] Client ID not released:<br> Service: 'wds'<br> CID: '22'<br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Releasing 'wds' client with flags 'none'...<br> [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Unregistered 'wds' client with ID '22'<br> [03 Sep 2018, 16:52:16] [Debug] Client released<br> [03 Sep 2018, 16:52:16] [Debug] Closed<br><br>Now I try to pull the network up:<br>$ sudo qmicli -d /dev/cdc-wdm0 --wds-start-network="APN=<a href="http://fast.t-mobile.com">fast.t-mobile.com</a>,ip-type=4"<br><br>Which succeeds<br><br>$ sudo dhclient -4 -v wwp0s29u1u1u4i4<br><br>is the last step.<br><br>This now fails. No ipv6, no nothing.<br><br>------<br><br>Alright that failed. Let's try qmi-network instead, which relies on /etc/qmi-network.conf, which I will start by leaving unmodified<br>from my last email, since it seemed to have worked.<br><br> $ sudo pkill dhclient<br> $ sudo qmi-network /dev/cdc-wdm0 start<br> Loading profile at /etc/qmi-network.conf...<br> /usr/local/bin/qmi-network: 2: /etc/qmi-network.conf: ip-type=4: not found<br> APN: internet<br> APN user: unset<br> APN password: unset<br> qmi-proxy: no<br> Checking data format with 'qmicli -d /dev/cdc-wdm0 --wda-get-data-format '...<br> [03 Sep 2018, 17:03:53] -Warning ** [/dev/cdc-wdm0] requested auto mode but no MBIM QMUX support available<br> Device link layer protocol retrieved: raw-ip<br> Getting expected data format with 'qmicli -d /dev/cdc-wdm0 --get-expected-data-format'...<br> [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested auto mode but no MBIM QMUX support available<br> Expected link layer protocol retrieved: 802-3<br> Updating kernel link layer protocol with 'qmicli -d /dev/cdc-wdm0 --set-expected-data-format=raw-ip'...<br> [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested auto mode but no MBIM QMUX support available<br> error: cannot set expected data format: Expected data format not updated properly to 'raw-ip': got '802-3' instead<br> Error updating kernel link layer protocol <br> Starting network with 'qmicli -d /dev/cdc-wdm0 --wds-start-network=apn='internet' --client-no-release-cid '...<br> [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested auto mode but no MBIM QMUX support available<br> Saving state at /tmp/qmi-network-state-cdc-wdm0... (CID: 23)<br> Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH: 2267620704)<br> Network started successfully<br> <br>None of these things look good. Whatever, I'll try it anyway:<br><br> $ sudo dhclient -4 wwp0s29u1u1u4i4<br> fails.<br> $ sudo dhclient wwp0s29u1u1u4i4<br> ... eventually gives me an ipv6 address again ...<br> <br>This is where I was before.<br><br>Now I'll try and put simply `APN=<a href="http://fast.t-mobile.com">fast.t-mobile.com</a>` into the /etc/qmi-network.conf file and try the dhclient -4 again. This<br>doesn't seem to work.<br><br>---<br><br>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 <br>want to be there.<br><br>I'll update you further on my investigation, but this is the documentation up to this point. <br><br>Outcome: Continued failure.<br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 3, 2018 at 12:51 AM, Aleksander Morgado <span dir="ltr"><<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br>
<span class=""><br>
><br>
> My current setup includes libmbim-glib-dev 1.16.0-1 from debian/testing and<br>
> I'm using 1.4.0-690-gde362e9<br>
><br>
<br>
</span>That combination is very very very old, I would definitely suggest you<br>
use MM 1.8, which is 100% compatible API wise with 1.4.x.<br>
<div><div class="h5"><br>
> mmcli says the IP supported is "ipv4, ipv6, ipv4v6". I've tried the<br>
> --wds-set-ip-family=4 option that was recently added like so:<br>
><br>
> # qmicli -d /dev/cdc-wdm0 --wds-set-ip-family=4 --client-no-release-cid -v<br>
> [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] Opening device with flags<br>
> 'auto'...<br>
> [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] loaded driver of cdc-wdm<br>
> port: qmi_wwan<br>
> [01 Sep 2018, 21:10:03] -Warning ** [/dev/cdc-wdm0] requested auto mode but<br>
> no MBIM QMUX support available<br>
> [01 Sep 2018, 21:10:03] [Debug] QMI Device at '/dev/cdc-wdm0' ready<br>
> [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] Assuming service 'wds' is<br>
> supported...<br>
> [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] Allocating new client ID...<br>
> [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] sent message...<br>
> <<<<<< RAW:<br>
> <<<<<< length = 16<br>
> <<<<<< data = 01:0F:00:00:00:00:00:01:22:00:<wbr>04:00:01:01:00:01<br>
><br>
> [01 Sep 2018, 21:10:03] [Debug] [/dev/cdc-wdm0] sent generic request<br>
> (translated)...<br>
> <<<<<< QMUX:<br>
> <<<<<< length = 15<br>
> <<<<<< flags = 0x00<br>
> <<<<<< service = "ctl"<br>
> <<<<<< client = 0<br>
> <<<<<< QMI:<br>
> <<<<<< flags = "none"<br>
> <<<<<< transaction = 1<br>
> <<<<<< tlv_length = 4<br>
> <<<<<< message = "Allocate CID" (0x0022)<br>
> <<<<<< TLV:<br>
> <<<<<< type = "Service" (0x01)<br>
> <<<<<< length = 1<br>
> <<<<<< value = 01<br>
> <<<<<< translated = wds<br>
><br>
> [01 Sep 2018, 21:10:06] [Debug] [/dev/cdc-wdm0] received message...<br>
> <<<<<< RAW:<br>
> <<<<<< length = 25<br>
> <<<<<< data =<br>
> 01:18:00:80:03:03:02:AA:0C:20:<wbr>00:0C:00:02:04:00:00:00:00:00:<wbr>01:02:00:C8:08<br>
><br>
> [01 Sep 2018, 21:10:06] [Debug] [/dev/cdc-wdm0] received generic response<br>
> (translated)...<br>
> <<<<<< QMUX:<br>
> <<<<<< length = 24<br>
> <<<<<< flags = 0x80<br>
> <<<<<< service = "nas"<br>
> <<<<<< client = 3<br>
> <<<<<< QMI:<br>
> <<<<<< flags = "response"<br>
> <<<<<< transaction = 3242<br>
> <<<<<< tlv_length = 12<br>
> <<<<<< message = "Get Signal Strength" (0x0020)<br>
> <<<<<< TLV:<br>
> <<<<<< type = "Result" (0x02)<br>
> <<<<<< length = 4<br>
> <<<<<< value = 00:00:00:00<br>
> <<<<<< translated = SUCCESS<br>
> <<<<<< TLV:<br>
> <<<<<< type = "Signal Strength" (0x01)<br>
> <<<<<< length = 2<br>
> <<<<<< value = C8:08<br>
> <<<<<< translated = [ strength = '-56' radio_interface = 'lte' ]<br>
><br>
> [01 Sep 2018, 21:10:06] [Debug] [/dev/cdc-wdm0] No transaction matched in<br>
> received message<br>
><br>
> error: couldn't create client for the 'wds' service: CID allocation failed<br>
> in the CTL client: Transaction timed out<br>
<br>
</div></div>You're hijacking the cdc-wdm port as MM is also running and trying to<br>
use it through the qmi-proxy. You should use the "-p" option always<br>
when running qmicli ccommands.<br>
Also, anyway, you should decide how you want to setup the connection:<br>
* MM<br>
* qmi-network<br>
* qmicli manually<br>
<br>
And make sure you stick to one of those methods only, otherwise you<br>
may be interfering with the others.<br>
<div><div class="h5"><br>
><br>
> ----->8----<br>
><br>
> I've separately tried addressing this through /etc/qmi-network.conf by<br>
> making the content as follows:<br>
><br>
> APN=network<br>
> IP-TYPE=4<br>
><br>
> Then I tried to start the network (with and without the ip-type=4 line).<br>
> With the ip-type=4 line I get the following:<br>
><br>
> loading profile at /etc/qmi-network.conf...<br>
> /usr/local/bin/qmi-network: 2: /etc/qmi-network.conf: ip-type=4: not found<br>
> APN: internet<br>
> APN user: unset<br>
> APN password: unset<br>
> qmi-proxy: no<br>
> Checking data format with 'qmicli -d /dev/cdc-wdm0 --wda-get-data-format<br>
> '...<br>
> [01 Sep 2018, 21:24:01] -Warning ** [/dev/cdc-wdm0] requested auto mode but<br>
> no MBIM QMUX support available<br>
> Device link layer protocol retrieved: raw-ip<br>
> Getting expected data format with 'qmicli -d /dev/cdc-wdm0<br>
> --get-expected-data-format'...<br>
> [01 Sep 2018, 21:24:01] -Warning ** [/dev/cdc-wdm0] requested auto mode but<br>
> no MBIM QMUX support available<br>
> Expected link layer protocol retrieved: raw-ip<br>
> Device and kernel link layer protocol match: raw-ip<br>
> Starting network with 'qmicli -d /dev/cdc-wdm0<br>
> --wds-start-network=apn='<wbr>internet' --client-no-release-cid '...<br>
> [01 Sep 2018, 21:24:01] -Warning ** [/dev/cdc-wdm0] requested auto mode but<br>
> no MBIM QMUX support available<br>
> Saving state at /tmp/qmi-network-state-cdc-<wbr>wdm0... (CID: 24)<br>
> Saving state at /tmp/qmi-network-state-cdc-<wbr>wdm0... (PDH: 2267257648)<br>
> Network started successfully<br>
><br>
<br>
</div></div>That's good.<br>
<span class=""><br>
><br>
> Then I do something like<br>
><br>
><br>
> dhclient -4 wwp0s29u1u1u4i4<br>
><br>
><br>
> which returns immediately<br>
><br>
> Then I do an ip addr show and see I have, much to my dismay only an ipv6<br>
> address.<br>
><br>
<br>
</span>I'm tempted to say that this could be due to the device requiring<br>
raw-ip in the network interface and your network interface still<br>
configured for 802.3 frames.<br>
IIRC the Quectel devices were too strict with the raw-ip/802.3<br>
requirement and they do require raw-ip explicitly.<br>
<br>
You have raw-ip support in kernels >= 4.5, although the corresponding<br>
patches are easily backport-able if needed.<br>
<span class=""><br>
> We have a few thousand of these quectels on order which are going to be in<br>
> embedded devices so I guess I could have some massive ipv6to4 bridge running<br>
> but I'd rather not and I'd much rather have an ipv6 AND ipv4 address like I<br>
> can get on windows - I'd also be ok with only an ipv4 address. I'm probably<br>
> not ok however, with exclusively an ipv6.<br>
><br>
> Any clues on how I can get this device to register an ipv4 address? The<br>
> carrier is T-Mobile btw, if that makes a difference.<br>
><br>
<br>
</span>I would definitely try with a newer stack: Linux >= 4.5, libqmi 1.20,<br>
MM 1.8.0 and NM 1.10/1.12.<br>
<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Aleksander<br>
<a href="https://aleksander.es" rel="noreferrer" target="_blank">https://aleksander.es</a><br>
</font></span></blockquote></div><br></div>