OpenWrt and QMI mode LTE QUECTEL EC25-E RAW-IP

Hello,

I tried 3 days long to solve my problem, but no way, so you are my last chance !! :slight_smile:

I followed this openWRT documentation : https://openwrt.org/docs/guide-user/network/wan/wwan/ltedongle

When I look the logs, I can see that thee is a permission denied. I found out that my module is RAW_IP only (not 802.3). The raw_Ip seems to be detected, but when the driver try to change the data mode, permission is denied (file : /sys/class/net/wwan0/qmi/raw_ip).

I tried manually :
ifconfig wwan0 down
echo Y > /sys/class/net/wwan0/qmi/raw_ip

but failed, with : ash: write error: Resource busy
Probably because ifconfig wwan0 down doesn't work. Something is probably locking wwan0 up.

Do somebody have an idea ??

Thank you so much for reading.

mathojojo

This is what I get in the kernel log

[ 520.841419] qmi_wwan 1-1.1.3:1.4: cdc-wdm0: USB WDM device
[ 520.848914] qmi_wwan 1-1.1.3:1.4 wwan0: register 'qmi_wwan' at usb-3f980000.usb-1.1.3, WWAN/QMI device, 7a:72:ae:0f:8a:3a
[ 521.222434] qmi_wwan 1-1.1.3:1.4 wwan0: Cannot change a running device
[ 1629.850061] qmi_wwan 1-1.1.3:1.4 wwan0: Cannot change a running device

Which USB LTE stick are you using?

that question is answered in the subject and not very relevant...

The error message comes from the driver . I regret putting that restriction there, but done is done...

Doing

ifconfig wwan0 down

before trying to change the device is the correct solution. I don't understand why that didn't work. Maybe there is something running and constantly trying to bring up the device? Try to remove any reference to the device from the network config and see if

ifconfig wwan0 down; echo Y > /sys/class/net/wwan0/qmi/raw_ip

works then.

Hardware :

  • My Modem is the Quectel EC25-E, mounted on a Sixfab 3G/4G Raspberry HAT.
  • My Modem is in QMI mode (AT+QCFG="usbnet",0)
  • Everything mounted on a Raspberry Pi 3b+ with OpenWRT 21.02 RC1

Software :

  • First I installed all needed packages for qmi (tools, and drivers)
  • I could then add the qmi-modem interface (set with qmi-cellular, apn, no PIN, No Auth, IPv6/IPv4)
  • Then I added the wwan interface (set with dhcp-client, bring up on boot, on wwan0 device and WAN Firewall Zone)

All is configured with luci-gui.

Then when I reboot, I got the message:

qmi_wwan 1-1.1.3:1.4 wwan0: Cannot change a running device

As I said, the command :

ifconfig wwan0 down

or

echo "Y" > /sys/class/net/wwan0/qmi/raw_ip

failed.

To make it work, i have to :

  • First : remove my wwan interface (again I do it in LUCI-gui)
  • Then : echo "Y" > /sys/class/net/$ifname/qmi/raw_ip --> working fine, not bocked anymore
  • Then I add a new wwan interface on wwan0 device (dhcp-client).

And now finally, if i do a

uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect

, everything is working fine...

I have to make all steps again if I restart the raspberry, of course. So it's just a workaround.

In my mind, i think that wwan interface is launched too early, making the raw_ip file busy when it must be accessed to set it to Y instead of N.
If it is true, the solution would be to put a timer somewhere, no ???

Thank you for all your support.

Uhm, I have a doubt now :

Is it correct to create the wwan interface with wwan0 device myself ?
Or should I just create the qmi-modem interface, and wwan0 interface will appear automatically because it's done by a driver??

In the second case, my manually added wwan interface is maybe the problem !

That sounds likely. Try it

Hello

Ok, I tried to remove my manually created wwan interface (doing so, I'm not completing the OpenWRT tutorial, whitch clearly explain that we have to create it).

I then rebooted OpenWRT, and as expected, there is no wwan0 interface to connect. So, it seems to be required to create the wwan interface as dhcp client !
So, I return to my initial problem, and if I want to use my modem I have to make 3-4 steps at every reboot ! Not especially sexy...

I found another way, finally much easier : modemmanager package. I installed it, configured a new interface in LUCI GUI, with my apn, no PIN, IPv4 , no Authentification....
I rebooted, and everything went fine as it should !!!

To conclude : there is a problem with the standard way to get QMI working on OpenWRT 21.02 RC1. It may work with ISO 802.3 modems, but as soon as the mode must be changed to RAW_IP, there will be access restrictions problems.
Using Modemmanager seems to be the easiest way actually, as a practical workaround.

I'm still interested with ideas. It may help other user of Quectel EC25 (or of RAW_IP modems).
Maybe a bug should be reported ? but I don't know what is faulty.. the driver ? the qmi.sh script ? the wwan.sh script ? or something else ?
Thank you for reading.

Yes, that is definitely easiest.

The uqmi proto stuff should be fixed, though. Problem is that it needs someone with enough interest...

Yes, it should be, and it's probably easy to fix for developers. But as you said, it needs interest, and time.