Working setup with libqmi but no internet access

I’m trying to set up an LTE hat with a Telit LE910C4 module and a Vodafone SIM on my Raspberry Pi 4. The system is a fresh install of RPi OS Buster, no changes to network, routing or similar components have been made.
I followed this tutorial to set up a QMI based connection.

The network seems to be up and I also get an IP

pi@raspberrypi:~ $ sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net=‘net-raw-ip|net-no-qos-header’ --wds-start-network=“apn=‘web.vodafone.de’,ip-type=4” --client-no-release-cid
[/dev/cdc-wdm0] Network started
Packet data handle: ‘2266904784’
[/dev/cdc-wdm0] Client ID not released:
Service: ‘wds’
CID: ‘20’

pi@raspberrypi:~ $ ifconfig wwan0
wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.126.48 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::e89b:fc0:d875:7387 prefixlen 64 scopeid 0x20
ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 258 bytes 60954 (59.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Everything seems to look good. However, I cannot get access to the internet. The DHCP request already doesn’t get an answer, so the interface assigns itself a link local address. Consequently, the ping example from the tutorial yields

pi@raspberrypi:~ $ ping -I wwan0 -c 5 sixfab.com
PING sixfab.com (172.66.40.115) from 169.254.126.48 wwan0: 56(84) bytes of data.
From raspberrypi.local (169.254.126.48) icmp_seq=1 Destination Host Unreachable
From raspberrypi.local (169.254.126.48) icmp_seq=2 Destination Host Unreachable
From raspberrypi.local (169.254.126.48) icmp_seq=3 Destination Host Unreachable
From raspberrypi.local (169.254.126.48) icmp_seq=4 Destination Host Unreachable
From raspberrypi.local (169.254.126.48) icmp_seq=5 Destination Host Unreachable

sixfab.com ping statistics —
5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 197ms

Here is an overview over my AT settings:

ATI
332

AT+CGMR
M0F.670010

AT+CPIN?
+CPIN: READY

AT+CPAS
+CPAS: 0

AT+CFUN?
+CFUN: 1

AT+COPS?
+COPS: 0,0,“vodafone.de”,7

AT#USBCFG?
#USBCFG: 0

AT#BND?
#BND: 0,15,80800C5

AT+CREG?
+CREG: 0,1

AT+CGDCONT?
+CGDCONT: 1,“IPV4V6”,"","",0,0,0,0
+CGDCONT: 2,“IPV4V6”,“ims”,"",0,0,0,0
+CGDCONT: 3,“IPV4V6”,“sos”,"",0,0,0,1

AT+CSQ
+CSQ: 18,4

AT+CGATT?
+CGATT: 1

AT+GMM
LE910C4-EU

AT#SWPKGV
25.21.670-P0F.671803
M0F.670010
P0F.671803
A0F.670010

And an excerpt from the syslog, regarding the wwan0 interface:

pi@raspberrypi:~ $ cat /var/log/syslog | grep wwan0
Apr 4 14:53:56 raspberrypi kernel: [ 5.769470] qmi_wwan 1-1.4:1.2 wwan0: register ‘qmi_wwan’ at usb-0000:01:00.0-1.4, WWAN/QMI device, 16:a4:42:45:81:f6
Apr 4 14:53:57 raspberrypi dhcpcd[381]: wwan0: waiting for carrier
Apr 4 14:53:57 raspberrypi dhcpcd[381]: wwan0: carrier acquired
Apr 4 14:53:57 raspberrypi dhcpcd[381]: wwan0: IAID 42:45:81:f6
Apr 4 14:53:57 raspberrypi dhcpcd[381]: wwan0: adding address fe80::2de:6cd3:3f12:243f
Apr 4 14:53:57 raspberrypi avahi-daemon[379]: Joining mDNS multicast group on interface wwan0.IPv6 with address fe80::2de:6cd3:3f12:243f.
Apr 4 14:53:57 raspberrypi avahi-daemon[379]: New relevant interface wwan0.IPv6 for mDNS.
Apr 4 14:53:57 raspberrypi avahi-daemon[379]: Registering new address record for fe80::2de:6cd3:3f12:243f on wwan0..
Apr 4 14:53:57 raspberrypi dhcpcd[381]: wwan0: soliciting an IPv6 router
Apr 4 14:53:57 raspberrypi dhcpcd[381]: wwan0: soliciting a DHCP lease
Apr 4 14:54:02 raspberrypi dhcpcd[381]: wwan0: probing for an IPv4LL address
Apr 4 14:54:08 raspberrypi dhcpcd[626]: wwan0: using IPv4LL address 169.254.244.185
Apr 4 14:54:08 raspberrypi avahi-daemon[379]: Joining mDNS multicast group on interface wwan0.IPv4 with address 169.254.244.185.
Apr 4 14:54:08 raspberrypi avahi-daemon[379]: New relevant interface wwan0.IPv4 for mDNS.
Apr 4 14:54:08 raspberrypi avahi-daemon[379]: Registering new address record for 169.254.244.185 on wwan0.IPv4.
Apr 4 14:54:08 raspberrypi dhcpcd[626]: wwan0: adding route to 169.254.0.0/16
Apr 4 14:54:11 raspberrypi dhcpcd[626]: wwan0: no IPv6 Routers available
Jul 19 14:16:59 raspberrypi kernel: [ 5.567980] qmi_wwan 1-1.4:1.2 wwan0: register ‘qmi_wwan’ at usb-0000:01:00.0-1.4, WWAN/QMI device, 7a:75:1f:4c:fe:08
Jul 19 14:17:00 raspberrypi dhcpcd[433]: wwan0: waiting for carrier
Jul 19 14:17:00 raspberrypi dhcpcd[433]: wwan0: carrier acquired
Jul 19 14:17:00 raspberrypi dhcpcd[433]: wwan0: IAID 1f:4c:fe:08
Jul 19 14:17:00 raspberrypi dhcpcd[433]: wwan0: adding address fe80::85b7:3cb2:43a0:813e
Jul 19 14:17:00 raspberrypi avahi-daemon[404]: Joining mDNS multicast group on interface wwan0.IPv6 with address fe80::85b7:3cb2:43a0:813e.
Jul 19 14:17:00 raspberrypi avahi-daemon[404]: New relevant interface wwan0.IPv6 for mDNS.
Jul 19 14:17:00 raspberrypi avahi-daemon[404]: Registering new address record for fe80::85b7:3cb2:43a0:813e on wwan0.
.
Jul 19 14:17:00 raspberrypi dhcpcd[433]: wwan0: soliciting an IPv6 router
Jul 19 14:17:00 raspberrypi dhcpcd[433]: wwan0: soliciting a DHCP lease
Jul 19 14:17:05 raspberrypi dhcpcd[433]: wwan0: probing for an IPv4LL address
Jul 19 14:17:10 raspberrypi dhcpcd[768]: wwan0: using IPv4LL address 169.254.69.169
Jul 19 14:17:10 raspberrypi avahi-daemon[404]: Joining mDNS multicast group on interface wwan0.IPv4 with address 169.254.69.169.
Jul 19 14:17:10 raspberrypi avahi-daemon[404]: New relevant interface wwan0.IPv4 for mDNS.
Jul 19 14:17:10 raspberrypi avahi-daemon[404]: Registering new address record for 169.254.69.169 on wwan0.IPv4.
Jul 19 14:17:10 raspberrypi dhcpcd[768]: wwan0: adding route to 169.254.0.0/16
Jul 19 14:17:14 raspberrypi dhcpcd[768]: wwan0: no IPv6 Routers available
Jul 19 14:19:03 raspberrypi dhcpcd[768]: wwan0: carrier lost
Jul 19 14:19:03 raspberrypi avahi-daemon[404]: Interface wwan0.IPv6 no longer relevant for mDNS.
Jul 19 14:19:03 raspberrypi avahi-daemon[404]: Leaving mDNS multicast group on interface wwan0.IPv6 with address fe80::85b7:3cb2:43a0:813e.
Jul 19 14:19:03 raspberrypi avahi-daemon[404]: Interface wwan0.IPv4 no longer relevant for mDNS.
Jul 19 14:19:03 raspberrypi avahi-daemon[404]: Leaving mDNS multicast group on interface wwan0.IPv4 with address 169.254.69.169.
Jul 19 14:19:03 raspberrypi avahi-daemon[404]: Withdrawing address record for fe80::85b7:3cb2:43a0:813e on wwan0.
Jul 19 14:19:03 raspberrypi avahi-daemon[404]: Withdrawing address record for 169.254.69.169 on wwan0.
Jul 19 14:19:03 raspberrypi dhcpcd[768]: wwan0: deleting address fe80::85b7:3cb2:43a0:813e
Jul 19 14:19:03 raspberrypi dhcpcd[768]: wwan0: deleting route to 169.254.0.0/16
Jul 19 14:19:16 raspberrypi dhcpcd[768]: wwan0: carrier acquired
Jul 19 14:19:16 raspberrypi dhcpcd[768]: wwan0: IAID 1f:4c:fe:08
Jul 19 14:19:16 raspberrypi dhcpcd[768]: wwan0: waiting for 3rd party to configure IP address
Jul 19 14:19:17 raspberrypi dhcpcd[768]: wwan0: soliciting an IPv6 router
Jul 19 14:30:34 raspberrypi kernel: [ 5.987467] qmi_wwan 1-1.4:1.2 wwan0: register ‘qmi_wwan’ at usb-0000:01:00.0-1.4, WWAN/QMI device, a2:31:17:f1:91:4b
Jul 19 14:30:40 raspberrypi dhcpcd[428]: wwan0: waiting for carrier
Jul 19 14:30:40 raspberrypi dhcpcd[428]: wwan0: carrier acquired
Jul 19 14:30:40 raspberrypi dhcpcd[428]: wwan0: IAID 17:f1:91:4b
Jul 19 14:30:40 raspberrypi dhcpcd[428]: wwan0: adding address fe80::3cc6:2005:9d11:5c14
Jul 19 14:30:40 raspberrypi avahi-daemon[385]: Joining mDNS multicast group on interface wwan0.IPv6 with address fe80::3cc6:2005:9d11:5c14.
Jul 19 14:30:40 raspberrypi avahi-daemon[385]: New relevant interface wwan0.IPv6 for mDNS.
Jul 19 14:30:40 raspberrypi avahi-daemon[385]: Registering new address record for fe80::3cc6:2005:9d11:5c14 on wwan0..
Jul 19 14:30:40 raspberrypi dhcpcd[428]: wwan0: soliciting an IPv6 router
Jul 19 14:30:40 raspberrypi dhcpcd[428]: wwan0: soliciting a DHCP lease
Jul 19 14:30:45 raspberrypi dhcpcd[428]: wwan0: probing for an IPv4LL address
Jul 19 14:30:50 raspberrypi dhcpcd[608]: wwan0: using IPv4LL address 169.254.99.25
Jul 19 14:30:50 raspberrypi dhcpcd[608]: wwan0: adding route to 169.254.0.0/16
Jul 19 14:30:50 raspberrypi avahi-daemon[385]: Joining mDNS multicast group on interface wwan0.IPv4 with address 169.254.99.25.
Jul 19 14:30:50 raspberrypi avahi-daemon[385]: New relevant interface wwan0.IPv4 for mDNS.
Jul 19 14:30:50 raspberrypi avahi-daemon[385]: Registering new address record for 169.254.99.25 on wwan0.IPv4.
Jul 19 14:30:53 raspberrypi dhcpcd[608]: wwan0: no IPv6 Routers available
Jul 19 14:32:40 raspberrypi avahi-daemon[385]: Withdrawing address record for 169.254.99.25 on wwan0.
Jul 19 14:32:40 raspberrypi dhcpcd[608]: wwan0: pid 761 deleted IP address 169.254.99.25/16
Jul 19 14:32:40 raspberrypi avahi-daemon[385]: Leaving mDNS multicast group on interface wwan0.IPv4 with address 169.254.99.25.
Jul 19 14:32:40 raspberrypi avahi-daemon[385]: Interface wwan0.IPv4 no longer relevant for mDNS.
Jul 19 14:32:40 raspberrypi dhcpcd[608]: wwan0: deleting route to 169.254.0.0/16
Jul 19 14:32:40 raspberrypi udhcpc[758]: wwan0: deconfigured
Jul 19 14:32:41 raspberrypi dhcpcd[608]: wwan0: probing for an IPv4LL address
Jul 19 14:32:47 raspberrypi dhcpcd[608]: wwan0: using IPv4LL address 169.254.126.48
Jul 19 14:32:47 raspberrypi dhcpcd[608]: wwan0: adding route to 169.254.0.0/16
Jul 19 14:32:47 raspberrypi avahi-daemon[385]: Joining mDNS multicast group on interface wwan0.IPv4 with address 169.254.126.48.
Jul 19 14:32:47 raspberrypi avahi-daemon[385]: New relevant interface wwan0.IPv4 for mDNS.
Jul 19 14:32:47 raspberrypi avahi-daemon[385]: Registering new address record for 169.254.126.48 on wwan0.IPv4.
Jul 19 14:32:50 raspberrypi udhcpc[758]: wwan0: configuration failed: leasefail:
Jul 19 14:46:04 raspberrypi dhcpcd[608]: wwan0: removing interface
Jul 19 14:47:51 raspberrypi avahi-daemon[385]: Withdrawing address record for 169.254.126.48 on wwan0.
Jul 19 14:47:51 raspberrypi avahi-daemon[385]: Leaving mDNS multicast group on interface wwan0.IPv4 with address 169.254.126.48.
Jul 19 14:47:51 raspberrypi avahi-daemon[385]: Interface wwan0.IPv4 no longer relevant for mDNS.
Jul 19 14:47:51 raspberrypi udhcpc[1016]: wwan0: deconfigured
Jul 19 14:48:04 raspberrypi avahi-daemon[385]: Leaving mDNS multicast group on interface wwan0.IPv6 with address fe80::3cc6:2005:9d11:5c14.
Jul 19 14:48:09 raspberrypi kernel: [ 5.704319] qmi_wwan 1-1.4:1.2 wwan0: register ‘qmi_wwan’ at usb-0000:01:00.0-1.4, WWAN/QMI device, b2:03:0f:30:52:d4
Jul 19 14:53:00 raspberrypi avahi-daemon[402]: Joining mDNS multicast group on interface wwan0.IPv6 with address fe80::b003:fff:fe30:52d4.
Jul 19 14:53:00 raspberrypi avahi-daemon[402]: New relevant interface wwan0.IPv6 for mDNS.
Jul 19 14:53:00 raspberrypi avahi-daemon[402]: Registering new address record for fe80::b003:fff:fe30:52d4 on wwan0.
.
Jul 19 14:56:50 raspberrypi udhcpc[730]: wwan0: deconfigured
Jul 19 14:56:59 raspberrypi udhcpc[730]: wwan0: configuration failed: leasefail:
Jul 19 14:57:29 raspberrypi udhcpc[730]: wwan0: configuration failed: leasefail:
Jul 19 14:57:58 raspberrypi udhcpc[730]: wwan0: configuration failed: leasefail:
Jul 19 15:00:44 raspberrypi kernel: [ 5.601400] qmi_wwan 1-1.4:1.2 wwan0: register ‘qmi_wwan’ at usb-0000:01:00.0-1.4, WWAN/QMI device, b2:03:0f:30:52:d4
Jul 19 15:00:45 raspberrypi dhcpcd[380]: wwan0: waiting for carrier
Jul 19 15:00:45 raspberrypi dhcpcd[380]: wwan0: carrier acquired
Jul 19 15:00:45 raspberrypi dhcpcd[380]: wwan0: IAID 0f:30:52:d4
Jul 19 15:00:45 raspberrypi dhcpcd[380]: wwan0: adding address fe80::323b:bac5:fc5f:7731
Jul 19 15:00:45 raspberrypi avahi-daemon[385]: Joining mDNS multicast group on interface wwan0.IPv6 with address fe80::323b:bac5:fc5f:7731.
Jul 19 15:00:45 raspberrypi avahi-daemon[385]: New relevant interface wwan0.IPv6 for mDNS.
Jul 19 15:00:45 raspberrypi avahi-daemon[385]: Registering new address record for fe80::323b:bac5:fc5f:7731 on wwan0.*.
Jul 19 15:00:46 raspberrypi dhcpcd[380]: wwan0: soliciting a DHCP lease
Jul 19 15:00:46 raspberrypi dhcpcd[380]: wwan0: soliciting an IPv6 router
Jul 19 15:00:51 raspberrypi dhcpcd[380]: wwan0: probing for an IPv4LL address
Jul 19 15:00:56 raspberrypi dhcpcd[601]: wwan0: using IPv4LL address 169.254.71.250
Jul 19 15:00:56 raspberrypi dhcpcd[601]: wwan0: adding route to 169.254.0.0/16
Jul 19 15:00:56 raspberrypi avahi-daemon[385]: Joining mDNS multicast group on interface wwan0.IPv4 with address 169.254.71.250.
Jul 19 15:00:56 raspberrypi avahi-daemon[385]: New relevant interface wwan0.IPv4 for mDNS.
Jul 19 15:00:56 raspberrypi avahi-daemon[385]: Registering new address record for 169.254.71.250 on wwan0.IPv4.
Jul 19 15:00:59 raspberrypi dhcpcd[601]: wwan0: no IPv6 Routers available

Let me know if there is any relevant information missing.

Thanks in advance

After this did you run the following command to configure the IP address? If yes, what is the output?
sudo udhcpc -q -f -i wwan0
Once you run this, open up a new terminal and check ifconfig wwan0 again.

Yes, I did

pi@raspberrypi:~ $ sudo udhcpc -q -f -i wwan0
udhcpc: started, v1.30.1
No resolv.conf for interface wwan0.udhcpc
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover

It just keeps sending discover messages without ever getting an answer until manually killed. The configuration with ifconfig wwan0 remains unchanged. I didn’t mention this command since I considered this not as the root of the problem but as a mere symptom. Of course, I might be wrong…

Meanwhile, I also tried this solution. Unfortunately, this stopped the wwan0 interface from obtaining an IP altogether. Seemingly, the default Raspberry Pi OS comes with only udhcpc as DHCP client, and disabling it disables DHCP entirely.

DHCP using sudo udhcpc -q -f -i wwan0 just worked and I can ping outside hosts …don’t ask :wink: I have absolutely no idea what happened.

I booted and repeated the usual procedure. First I set the SIM pin using the AT command AT+CPIN=<pin>, because the module keeps forgetting it with every restart. Then I ran the following commands in a script:

ip link set wwan0 down
echo ‘Y’ | tee /sys/class/net/wwan0/qmi/raw_ip
ip link set wwan0 up
qmicli -p -d /dev/cdc-wdm0 --device-open-net=‘net-raw-ip|net-no-qos-header’ --wds-start-network=“apn=‘web.vodafone.de’,ip-type=4” --client-no-release-cid

After this, DHCP apparently worked:

pi@raspberrypi:~ $ sudo udhcpc -q -f -i wwan0
udhcpc: started, v1.30.1
No resolv.conf for interface wwan0.udhcpc
udhcpc: sending discover
udhcpc: sending select for 100.71.140.72
udhcpc: lease of 100.71.140.72 obtained, lease time 7200
Too few arguments.
Too few arguments.

The only lead I have right now is that the protocol maybe wasn’t set to raw-IP. According to this blog, raw-IP might be reset at reboot, even if qmicli -d /dev/cdc-wdm0 --wda-get-data-format still displays it:

Even though sudo qmicli -d /dev/cdc-wdm0 --wda-get-data-format shows it’s in raw-ip mode, it seems you still have to stop the interface, force raw_ip, and start the interface, then you can connect and set up the IP and routing with udhcpc.

I did a lot of reboots in between and so might have lost the raw-IP setting without knowing it.

1 Like