Unable to get 5G connection with Quectel RM521F-GL

Hi!

I have just bought a RM521F-GL 5G modem, that manages to connect briefly before failing. I have it set to QMI mode, and am trying to use ModemManager but am failing to get a connection.

root@OpenWrt:~# ls -l /dev/cdc-wdm0
crw-------    1 root     root      180, 176 Dec 16 13:44 /dev/cdc-wdm0
root@OpenWrt:~# cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 6.01
S:  Manufacturer=Linux 6.1.67 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=xhci-hcd.1.auto
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 6.01
S:  Manufacturer=Linux 6.1.67 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=xhci-hcd.1.auto
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=2c7c ProdID=0801 Rev= 5.04
S:  Manufacturer=Quectel
S:  Product=RM521F-GL
S:  SerialNumber=3a53bd9
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E:  Ad=88(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms

I'm at my wits end - anyone have any ideas?

Logread:

Sat Dec 16 14:03:11 2023 daemon.info [2389]: <inf> [modem4] tty/ttyUSB2: at (primary)
Sat Dec 16 14:03:11 2023 daemon.info [2389]: <inf> [modem4] tty/ttyUSB3: at (secondary)
Sat Dec 16 14:03:11 2023 daemon.info [2389]: <inf> [modem4] tty/ttyUSB2: at (data primary)
Sat Dec 16 14:03:11 2023 daemon.info [2389]: <inf> [modem4] net/wwan0: net (data)
Sat Dec 16 14:03:11 2023 daemon.info [2389]: <inf> [modem4] usbmisc/cdc-wdm0: qmi
Sat Dec 16 14:03:14 2023 daemon.info [2389]: <inf> [modem4] SIM hot swap setup succeeded
Sat Dec 16 14:03:14 2023 daemon.info [2389]: <inf> [modem4] SIM is ready, and no need for the after SIM unlock step...
Sat Dec 16 14:03:14 2023 daemon.info [2389]: <inf> [modem4/sim3] loaded IMSI: ###
Sat Dec 16 14:03:14 2023 daemon.info [2389]: <inf> [modem4/sim3] loaded operator identifier: 23420
Sat Dec 16 14:03:17 2023 daemon.info [2389]: <inf> [modem3] retrying (5/7) unlock required check
Sat Dec 16 14:03:18 2023 daemon.warn [2389]: <wrn> [modem4] port ttyUSB2 timed out 2 consecutive times
Sat Dec 16 14:03:21 2023 daemon.warn [2389]: <wrn> [modem4] port ttyUSB2 timed out 3 consecutive times
Sat Dec 16 14:03:23 2023 daemon.info [2389]: <inf> [modem3] skipping SIM error in non 3GPP-capable device, assuming no lock is needed
Sat Dec 16 14:03:23 2023 daemon.info [2389]: <inf> [modem3] SIM is ready, and no need for the after SIM unlock step...
Sat Dec 16 14:03:23 2023 daemon.warn [2389]: <wrn> [modem3/sim4] couldn't load SIM identifier: Couldn't peek QMI port
Sat Dec 16 14:03:23 2023 daemon.warn [2389]: <wrn> [modem3] error initializing: Operation was cancelled
Sat Dec 16 14:03:24 2023 daemon.warn [2389]: <wrn> [modem4] port ttyUSB2 timed out 4 consecutive times
Sat Dec 16 14:03:24 2023 daemon.info [2389]: <inf> [modem4/sim3] loaded list of preferred networks:
Sat Dec 16 14:03:24 2023 daemon.info [2389]: <inf> [modem4/sim3] loaded GID1: 0303
Sat Dec 16 14:03:35 2023 daemon.warn [2389]: <wrn> [modem4] couldn't load supported assistance data types: Failed to receive indication with the predicted orbits data source
Sat Dec 16 14:03:35 2023 daemon.notice [2389]: <msg> [modem4] state changed (unknown -> disabled)
Sat Dec 16 14:05:14 2023 daemon.info dnsmasq[1]: read /etc/hosts - 12 names
Sat Dec 16 14:05:14 2023 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 4 names
Sat Dec 16 14:05:14 2023 daemon.info dnsmasq[1]: read /tmp/hosts/odhcpd - 2 names
Sat Dec 16 14:05:14 2023 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Sat Dec 16 14:05:15 2023 daemon.warn odhcpd[2121]: No default route present, overriding ra_lifetime!
Sat Dec 16 14:06:05 2023 daemon.notice netifd: Interface 'wan' is setting up now
Sat Dec 16 14:06:05 2023 daemon.notice netifd: wan (7343): modem available at /org/freedesktop/ModemManager1/Modem/4
Sat Dec 16 14:06:05 2023 daemon.info [2389]: <inf> [modem4] processing user request to enable modem...
Sat Dec 16 14:06:05 2023 daemon.notice [2389]: <msg> [modem4] state changed (disabled -> enabling)
Sat Dec 16 14:06:05 2023 daemon.notice [2389]: <msg> [modem4] power state updated: on
Sat Dec 16 14:06:05 2023 daemon.info [2389]: <inf> [modem4] checking if SIM was swapped...
Sat Dec 16 14:06:05 2023 daemon.info [2389]: <inf> [modem4] SIM identifier has not changed: ###
Sat Dec 16 14:06:05 2023 daemon.info [2389]: <inf> [modem4] SIM imsi has not changed: ###
Sat Dec 16 14:06:05 2023 daemon.notice [2389]: <msg> [modem4] 3GPP registration state changed (unknown -> searching)
Sat Dec 16 14:06:05 2023 daemon.info [2389]: <inf> [modem4] consolidated registration state: cs 'searching', ps 'searching', eps 'searching', 5gs 'emergency-only' --> 'searching'
Sat Dec 16 14:06:05 2023 daemon.notice [2389]: <msg> [modem4] 3GPP packet service state changed (unknown -> detached)
Sat Dec 16 14:06:11 2023 daemon.warn [2389]: <wrn> [modem4] port ttyUSB3 timed out 2 consecutive times
Sat Dec 16 14:06:11 2023 daemon.info [2389]: <inf> [modem4] enabled modem
Sat Dec 16 14:06:11 2023 daemon.notice [2389]: <msg> [modem4] state changed (enabling -> searching)
Sat Dec 16 14:06:11 2023 daemon.notice netifd: wan (7343): successfully enabled the modem
Sat Dec 16 14:06:11 2023 daemon.notice netifd: wan (7343): starting connection with apn 'three.co.uk'...
Sat Dec 16 14:06:11 2023 daemon.info [2389]: <inf> [modem4] processing user request to connect modem...
Sat Dec 16 14:06:11 2023 daemon.info [2389]: <inf> [modem4]   apn: three.co.uk
Sat Dec 16 14:06:11 2023 daemon.info [2389]: <inf> [modem4]   ip type: ipv4
Sat Dec 16 14:06:11 2023 daemon.info [2389]: <inf> [modem4]   allowed auth: unknown
Sat Dec 16 14:06:11 2023 daemon.info [2389]: <inf> [modem4]   allow roaming: yes
Sat Dec 16 14:06:11 2023 daemon.notice [2389]: <msg> [modem4] simple connect started...
Sat Dec 16 14:06:11 2023 daemon.notice [2389]: <msg> [modem4] simple connect state (4/10): wait to get fully enabled
Sat Dec 16 14:06:11 2023 daemon.notice [2389]: <msg> [modem4] simple connect state (5/10): wait after enabled
Sat Dec 16 14:06:12 2023 daemon.notice [2389]: <msg> [modem4] simple connect state (6/10): register
Sat Dec 16 14:06:12 2023 daemon.info [2389]: <inf> [modem4] launching automatic network registration...
Sat Dec 16 14:07:12 2023 daemon.info [2389]: <inf> [modem4] 3GPP registration check timed out
Sat Dec 16 14:07:12 2023 daemon.notice [2389]: <msg> [modem4] 3GPP registration state changed (searching -> idle)
Sat Dec 16 14:07:12 2023 daemon.info [2389]: <inf> [modem4] consolidated registration state: cs 'idle', ps 'idle', eps 'idle', 5gs 'idle' --> 'idle'
Sat Dec 16 14:07:12 2023 daemon.notice [2389]: <msg> [modem4] state changed (searching -> enabled)
Sat Dec 16 14:07:12 2023 daemon.warn [2389]: <wrn> [modem4] registration in network failed: Network timeout
Sat Dec 16 14:07:12 2023 daemon.notice netifd: wan (7343): error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.NetworkTimeout: Network timeout'
Sat Dec 16 14:07:12 2023 daemon.notice netifd: wan (7444): stopping network
Sat Dec 16 14:07:12 2023 daemon.notice netifd: wan (7444): couldn't load bearer path: disconnecting anyway
Sat Dec 16 14:07:12 2023 daemon.info [2389]: <inf> [modem4] processing user request to disconnect modem: all bearers
Sat Dec 16 14:07:12 2023 daemon.info [2389]: <inf> [modem4] all requested bearers disconnected
Sat Dec 16 14:07:12 2023 daemon.notice netifd: Interface 'wan' is now down
Sat Dec 16 14:07:13 2023 daemon.warn odhcpd[2121]: No default route present, overriding ra_lifetime!
Sat Dec 16 14:08:33 2023 daemon.notice [2389]: <msg> [modem4] 3GPP registration state changed (idle -> searching)
Sat Dec 16 14:08:33 2023 daemon.info [2389]: <inf> [modem4] consolidated registration state: cs 'searching', ps 'searching', eps 'searching', 5gs 'emergency-only' --> 'searching'
Sat Dec 16 14:08:33 2023 daemon.notice [2389]: <msg> [modem4] state changed (enabled -> searching)

Oh, I soo want to do this!
How do you have it connected?
To what router?

1 Like

Currently to a Linksys MX4200v1 using this PR https://github.com/openwrt/openwrt/pull/13432. Of course, built with all the necessary kernel modules etc.

Edit; forgot to mention, connected via USB although there is the option via Ethernet.

It is acting like the signal from the cell site is quite weak. Do you have proper antennas attached? Can you test by moving closer to the cell tower?

Yes, quite hefty antennas! Here is the specific device.

I’m also in central London, in between quite a few towers and without much obstructing them. My phone hits 200M down, with a Snapdragon X60

You don't need to use USB for data with this device.
All you need on OpenWrt side is an Ethernet port with DHCP. There is no need to use ModemManager.
Treat this device as a black box that behaves like a router or a bridge.
You can use USB connection for configuration, so make sure you have a terminal app like picocom installed.
Modem configuration examples for Ethernet mode are available at Quectel forum. I suggest asking a question there.

I thought so as well - my first route was to follow this guide to configure the modem via USB and use Ethernet for the actual connection to WAN (plug and play, almost?) but WAN was being assigned an odd IP address and I couldn’t get an internet connection through it.

I was hoping I could use QMI and OpenWrt instead.

Which one?

I'm a bit confused here...
You have BOTH USB/IP AND Ethernet?
What is the device the modem is in?
Some type of modem 'sled'?
This is interesting to me...

According to the log, the modem just fell off the USB bus. This is common when the power supplied by the USB port is insufficient. Please insert a powered USB3 hub between OpenWrt and the modem.

192.168.225.150. I tried pinging 192.168.225.1 but got no response, which I would’ve expected.

@buggz device is linked above :slight_smile:

@patrakov thanks for that! There’s a power supply provided, will try and run that simultaneously and see if it’ll keep it running.

1 Like

I suppose it was 192.168.225.150. This is probably the "internal LAN" of the modem which in turn acts as a NAT router.

Yes, sorry! That's correct.