Wrong QMI data format in effect on RPi
I've been using ModemManager for connection setup on Raspberry Pi 3B+ with Quectel EG25 modem; the system is running Raspbian Buster, with ModemManager 1.10.0 and Linux kernel 4.19.97.
EG25 uses the QMI protocol and static IP bearer configuration; even though I've configured IP settings correctly and data call setup works fine, data TX/RX does not work. After troubleshooting, I found out that the reason is that the QMI data format on the modem is raw-ip, but on the host it's 802-3.
According to log:
Feb 20 14:55:33 raspberrypi ModemManager[1299]: <debug> [1582203333.933839] Checking data format: kernel 802-3, device raw-ip
Feb 20 14:55:33 raspberrypi ModemManager[1299]: <debug> [1582203333.933940] Updating kernel data format: raw-ip
Feb 20 14:55:33 raspberrypi ModemManager[1299]: [/dev/cdc-wdm0] Writing expected data format to: /sys/class/net/wwan0/qmi/raw_ip
Feb 20 14:55:33 raspberrypi ModemManager[1299]: [/dev/cdc-wdm0] Reading expected data format from: /sys/class/net/wwan0/qmi/raw_ip
Feb 20 14:55:33 raspberrypi ModemManager[1299]: <debug> [1582203333.935438] QMI port open operation finished
Feb 20 14:55:33 raspberrypi ModemManager[1299]: <debug> [1582203333.936553] Opening QMI device...
Feb 20 14:55:33 raspberrypi ModemManager[1299]: <debug> [1582203333.936690] Checking if QMI device already opening...
Feb 20 14:55:33 raspberrypi kernel: [ 904.142280] qmi_wwan 1-1.3:1.4 wwan0: Cannot change a running device
It seems that ModemManager attempts to set the raw_ip
sysfs value, but this fails as the interface is already in running state. Checking /sys/class/net/wwan0/qmi/raw_ip confirms that it remains in state N.
Data starts working if I manually shutdown the interface, switch raw_ip
to Y and establish a new connection. Perhaps this is some kind of a race condition, as RPi is somewhat slower than most PC machines?
Full MM/syslog after modem hot-plug here: mm4.log