MC7700 with a Pi/NetworkManager - Destination Host Unreachable

Hey everyone. This is probably something simple, but it’s been killing me for the last few days.
I’m using an OpenM2M sim, and I’ve been able to connect to the internet on this sim using qmicli, but now I’m using Network Manager as the qmicli setup on boot wasn’t reliable.

I am able to connect to the network, but am not able to communicate via that interface.

cdc-wdm0: connected to GSM connection
        "cdc-wdm0"
        gsm (qmi_wwan, qcserial), hw, iface wwan0, mtu 1500
        ip4 default
        inet4 10.91.7.155/29
        inet4 169.254.211.44/16
        route4 10.91.7.152/29
        route4 169.254.0.0/16
        route4 0.0.0.0/0

user@thing:~ $ ping -I wwan0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.91.7.176 wwan0: 56(84) bytes of data.
From 10.91.7.176 icmp_seq=1 Destination Host Unreachable
wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.91.9.145  netmask 255.255.255.248  broadcast 10.91.9.149
        ether 02:b6:a2:a5:fc:37  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 729  bytes 72856 (71.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And this is the result from mmcli --modem=0

--------------------------------
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: 4ea7fabd431188ab67494ff520339edefa928b83
  --------------------------------
  Hardware |         manufacturer: Sierra Wireless, Incorporated
           |                model: MC7700
           |    firmware revision: SWI9200X_03.05.10.02AP R4684 CARMD-EN-10527 2012/02/25 11:58:38
           |         h/w revision: 10
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 359469040223855
  --------------------------------
  System   |               device: /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3
           |              drivers: qmi_wwan, qcserial
           |               plugin: sierra
           |         primary port: cdc-wdm0
           |                ports: cdc-wdm0 (qmi), ttyUSB0 (qcdm), ttyUSB2 (at), wwan0 (net)
  --------------------------------
  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
           |                state: registered
           |          power state: on
           |          access tech: umts
           |       signal quality: 38% (recent)
  --------------------------------
  Modes    |            supported: allowed: 2g; preferred: none
           |                       allowed: 3g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 2g, 3g; preferred: 3g
           |                       allowed: 2g, 3g; preferred: 2g
           |                       allowed: 2g, 4g; preferred: 4g
           |                       allowed: 2g, 4g; preferred: 2g
           |                       allowed: 3g, 4g; preferred: 4g
           |                       allowed: 3g, 4g; preferred: 3g
           |                       allowed: 2g, 3g, 4g; preferred: 4g
           |                       allowed: 2g, 3g, 4g; preferred: 3g
           |                       allowed: 2g, 3g, 4g; preferred: 2g
           |              current: allowed: 2g, 3g, 4g; preferred: none
  --------------------------------
  Bands    |            supported: egsm, dcs, pcs, g850, utran-1, utran-6, utran-5, utran-2, 
           |                       eutran-1, eutran-4, eutran-17
           |              current: egsm, dcs, pcs, g850, utran-1, utran-6, utran-5, utran-2, 
           |                       eutran-1, eutran-4, eutran-17
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 359469040223855
           |        enabled locks: fixed-dialing
           |          operator id: 53024
           |        operator name: 2degrees
           |         registration: roaming
  --------------------------------
  3GPP EPS | ue mode of operation: ps-1
  --------------------------------
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0
  --------------------------------
  Bearer   |            dbus path: /org/freedesktop/ModemManager1/Bearer/0

@ergs

In NetworkManager in the ipv6 tab is it set to “automatic”
Your wwan0 interface is not showing an ipv6 address.
I’m very green at cellular stuff myself,but many years of good ole ethernet thrashing.
In 4G LTE speak,almost certain you should be seeing an ipv6 in your ‘ip a’ output of your wwan0 interface.
You should at least be able to get a ping response from 8.8.8.8 even if you are not getting dns coming in correctly which can be another ball of worms,until it works.
Have a look at NetworkManager Gui IPV6 tab == automatic.
what does ‘dig google.com’ give
‘nslookup google.com
also do a ‘sudo resolvectl status’
‘sudo resolvectl dns’
, you should see bothe ipv4 & ipv6 dns ip numbers on your wwan0 interface from last two commands

Good Luck

That should have said “connected”, otherwise the modem is not in connected state.
Check the output of mmcli -b 0 to see the status reported by the bearer object.

What bothers me here is the NetworkManager output. If it was NetworkManager the one triggering the connection, it should report the connection as down, not up. There’s something wrong here.

Could also be that the connection is connected, then quickly disconnected. Would be interesting to see the MM+NM debug logs, as explained in Debugging | ModemManager

Right so I figured out what was going on!

Two things, the cable was affecting the connection. My heavy duty usb cable was worse at powering the gsm device. Switched to a shorter but lightweight cable and the connection and registration time is better for some reason.

The other thing is the raw_ip setting. I thought that this wouldn’t be needed, but it seems to be.
The ModemManager package available for Raspian 11 is 1.14, and it looks like 1.18 is the version that automatically handles this.

I’ve now added a script on a cronjob that checks for the file, and updates if incorrect.

FILE=/sys/class/net/wwan0/qmi/raw_ip
NMCLI_DEVICE_NAME=cdc-wdm0
IFCONFIG_DEVICE_NAME=wwan0
 
 
# If file isn't there, then the gsm device isn't connected
if test -f "$FILE"; then
# Check to see if raw_ip is set to Y
    if grep -q N "$FILE"; then
        echo "$FILE exists, but is set to N - Changing to Y"
        # down the interface, set raw ip, then bring it up again
        nmcli device disconnect $NMCLI_DEVICE_NAME
        ip link set $IFCONFIG_DEVICE_NAME down
        echo 'Y' | tee $FILE
        sudo ip link set $IFCONFIG_DEVICE_NAME up
        nmcli device connect $NMCLI_DEVICE_NAME
        echo "Completed change to Y"
    fi
fi

If anyone is using Network manager on Pi, they will also have to disable the built in wifi configuration Installing Network Manager on Raspbian 2020-02-05 · GitHub

The link layer handling in MM 1.14 would:

  • if the interface is configured as 802.3, use 802.3.
  • if the interface is configured as raw-ip, use raw-ip.

In MM 1.18 this was changed, so that we always attempt raw-ip first, and we only fallback to 802.3 if raw-ip is not supported (as with some very old devices). The reason for this change is that 1.18 implements multi-PDN/APN support through the new “multiplex” setting, and in order for it to work, we require the net interface to be configured in raw-ip mode.

If you do require raw-ip for some reason, and you don’t want to upgrade to a newer MM (you should!), then please note you can also change the link layer protocol in the kernel using qmicli as follows (which just changes the same sysfs file you changed anyway):

$ qmicli -d /dev/cdc-wdm0 --set-expected-data-format="raw-ip"

See qmicli --help-qmiwwan on a recent libqmi.

Update: It’s working now, somehow, in the original way.
No raw_ip setting needed.

Not sure what happened, but this is what I did:

  • installed Raspian Lite 32bit
  • connected to Wifi using wpa_supplicant (important to do this first)
  • uninstalled wpa_supplicant
  • apt installed network-manager (and maybe modemmanager)
  • added “deny wlan0” to the end of /etc/dhcpcd.conf
  • set managed to true in /etc/NetworkManager/NetworkManager.conf
  • connected the wifi up with nmcli nmcli dev wifi connect [ssid] password [password]

$ nmcli c add type gsm ifname con-name apn <operator_apn>
$ nmcli r wwan on


You can edit the config either via the nmcli connection edit command, or directly in 
`/etc/NetworkManager/syste-connections`

4G: If you have only one aerial attached (to main) then 4G will not work (from what I read). You need two aerials attached (Main + Aux). mmcli -m [index] --set-allowed-modes=3G seems to help with scanning using one aerial.

USB PCI adapters: I ordered two different ones from AliExpress and they both worked fine.

Updated version

# Installed Raspian Debian Bullseye Lite 32bit
# setup your wifi via raspi-config
sudo raspi-config 
sudo apt update
sudo apt upgrade 
sudo apt install network-manager 
sudo wpa_cli -i wlan0 DISCONNECT
sudo wpa_cli -i wlan0 LIST_NETWORKS
sudo wpa_cli -i wlan0 REMOVE_NETWORK 0 # Probably is 0 but can check using LIST_NETWORKS
sudo nmcli dev wifi connect [ssid] password [password]

# added “deny wlan0” to the end of /etc/dhcpcd.conf
# set managed to true in /etc/NetworkManager/NetworkManager.conf

# this is for an openm2m SIM
 sudo nmcli connection add con-name openm2m type gsm
# Edited the connection directly using the config below
sudo nano /etc/NetworkManager/system-connections/openm2m.nmconnection
sudo nmcli radio wwan on
sudo nmcli device connect cdc-wdm0

sudo mmcli -L # List your modems
sudo mmcli -m 0 # If your modem is at index 0, then this will display it's info

# if you only have one  antenna attached
sudo mmcli -m [index]  --set-allowed-modes=3G

# if you want to use GPS 

sudo mmcli -m [Modem index] --location-get-gps-raw
sudo mmcli -m [index] --location-get -J # J is for JSON
sudo mmcli -m [index] --location-disable-gps-raw

sudo reboot # for fun

# then be patient - it can take a while for a new sim card to sign in

[connection]
id=openm2m
uuid=081216de-1c46-41fe-8ffa-04a5c8205ac9
type=gsm
 
[gsm]
apn=iotapn.net
password=openm2m
username=openm2m
 
[serial]
 
[ppp]
 
[ipv4]
dns-priority=120
method=auto
route-metric=1050
 
[ipv6]
addr-gen-mode=stable-privacy
method=auto
 
[proxy]

Should have been

 denyinterfaces wlan0

and not “deny wlan0”