RM502Q-AE & RM520N-GL no internet PCIE MBIM

Hello,
I have these two 5g modules (RM502Q-AE & RM520N-GL) and I’ve managed to use them with an usb adapter to create a network with internet connection for my Jetson Orin AGX computer.

Now I’m trying to also have internet access through PCIE, I managed to install the pcie_mhi driver with MBIM enabled. I have a network interface listed, but no internet access.

Here are some useful additional information with what is happening for both modules.

PCI devices:

lspci -v

0005:01:00.0 Unassigned class [ff00]: Qualcomm Device 0306
	Subsystem: Qualcomm Device 5022
	Flags: bus master, fast devsel, latency 0, IRQ 317
	Memory at 2b28000000 (64-bit, non-prefetchable) [size=4K]
	Memory at 2b28001000 (64-bit, non-prefetchable) [size=4K]
	Capabilities: <access denied>
	Kernel driver in use: mhi_q
	Kernel modules: pcie_mhi

dmesg output:

sudo dmesg | grep mhi
[   11.599804] pcie_mhi: loading out-of-tree module taints kernel.
[   11.608257] pcie_mhi: module verification failed: signature and/or required key missing - tainting kernel
[   11.619845] mhi_init Quectel_Linux_PCIE_MHI_Driver_V1.3.7
[   11.626728] mhi_q 0005:01:00.0: Adding to iommu group 11
[   11.638255] mhi_pci_probe pci_dev->name = 0005:01:00.0, domain=5, bus=1, slot=0, vendor=17CB, device=0306
[   11.638472] [I][mhi0][mhi_arch_set_bus_request] Setting bus request to index 1
[   11.638481] mhi_q 0005:01:00.0: BAR 0: assigned [mem 0x2b28000000-0x2b28000fff 64bit]
[   11.638597] mhi_q 0005:01:00.0: enabling device (0000 -> 0002)
[   11.639642] [I][mhi0][mhi_init_pci_dev] msi_required = 4, msi_allocated = 4, msi_irq = 317
[   11.665116] [I][mhi0][mhi_power_up] dev_state:READY
[   11.665118] [I][mhi0][mhi_async_power_up] Requested to power on
[   11.665159] [I][mhi0][mhi_alloc_coherent] size = 98304, dma_handle = fffe0000
[   11.665161] [I][mhi0][mhi_init_dev_ctxt] mhi_ctxt->ctrl_seg = 00000000a82f3a40
[   11.665351] [I][mhi0][mhi_async_power_up] dev_state:READY ee:AMSS
[   11.665360] [I][mhi0][mhi_pm_st_worker] Transition to state:READY
[   11.665368] [I][mhi0][mhi_pm_st_worker] INVALID_EE -> AMSS
[   11.665370] [I][mhi0][mhi_ready_state_transition] Waiting to enter READY state
[   11.665376] [I][mhi0][mhi_ready_state_transition] Device in READY State
[   11.665378] [I][mhi0][mhi_tryset_pm_state] Transition to pm state from:POR to:POR
[   11.665381] [I][mhi0][mhi_init_mmio] Initializing MMIO
[   11.665385] [I][mhi0][mhi_init_mmio] CHDBOFF:0x300
[   11.665389] [I][mhi0][mhi_init_mmio] ERDBOFF:0x700
[   11.665390] [I][mhi0][mhi_init_mmio] Programming all MMIO values.
[   11.665461] [I][mhi0][mhi_async_power_up] Power on setup success
[   11.665546] [I][mhi0][mhi_pci_show_link] LnkCap:	Speed 16GT/s, Width x2
[   11.665548] [I][mhi0][mhi_pci_show_link] LnkSta:	Speed 8GT/s, Width x1
[   11.665549] [I][mhi0][mhi_pci_probe] Return successful
[   11.779637] [I][mhi0][mhi_dump_tre] carl_ev evt_state_change mhistate=2
[   11.779642] [I][mhi0][mhi_process_ctrl_ev_ring] MHI state change event to state:M0
[   11.779645] [I][mhi0][mhi_pm_m0_transition] Entered With State:READY PM_STATE:POR
[   11.779647] [I][mhi0][mhi_tryset_pm_state] Transition to pm state from:POR to:M0
[   11.781966] [I][mhi0][mhi_dump_tre] carl_ev evt_ee_state execenv=2
[   11.781970] [I][mhi0][mhi_process_ctrl_ev_ring] MHI EE received event:AMSS
[   11.781980] [I][mhi0][mhi_pm_st_worker] Transition to state:MISSION MODE
[   11.781988] [I][mhi0][mhi_pm_st_worker] INVALID_EE -> AMSS
[   11.781989] [I][mhi0][mhi_pm_mission_mode_transition] Processing Mission Mode Transition
[   11.782003] [I][mhi0][mhi_init_timesync] No timesync capability found
[   11.782004] [I][mhi0][mhi_pm_mission_mode_transition] Adding new devices
[   11.783448] [I][mhi0][mhi_dtr_probe] Enter for DTR control channel
[   11.783452] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:18
[   11.788844] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[   11.788860] [I][mhi0][__mhi_prepare_channel] Chan:18 successfully moved to start state
[   11.788861] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:19
[   11.794495] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[   11.798962] [I][mhi0][__mhi_prepare_channel] Chan:19 successfully moved to start state
[   11.799026] [I][mhi0][mhi_dtr_probe] Exit with ret:0
[   11.800231] [I][mhi_netdev_enable_iface] Prepare the channels for transfer
[   11.808161] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:100
[   11.819512] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[   11.819524] [I][mhi0][__mhi_prepare_channel] Chan:100 successfully moved to start state
[   11.819525] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:101
[   11.861073] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[   11.861085] [I][mhi0][__mhi_prepare_channel] Chan:101 successfully moved to start state
[   11.862951] [I][mhi_netdev_enable_iface] Exited.
[   11.868632] rmnet_vnd_register_device(rmnet_mhi0.1)=0
[   11.874545] [I][mhi0][mhi_pm_mission_mode_transition] Exit with ret:0
[  102.092378] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:12
[  102.101741] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[  102.101760] [I][mhi0][__mhi_prepare_channel] Chan:12 successfully moved to start state
[  102.101762] [I][mhi0][__mhi_prepare_channel] Entered: preparing channel:13
[  102.111234] [I][mhi0][mhi_dump_tre] carl_ev evt_cmd_comp code=1, type=33
[  102.111256] [I][mhi0][__mhi_prepare_channel] Chan:13 successfully moved to start state
[  102.803110] net rmnet_mhi0: link_state 0x0 -> 0x1
[  102.805558] [I][mhi_netdev_open] Opened net dev interface
[  222.961219] net rmnet_mhi0: link_state 0x1 -> 0x0
[  248.173178] net rmnet_mhi0: link_state 0x0 -> 0x1
[  248.176949] [I][mhi_netdev_open] Opened net dev interface
[  258.603376] net rmnet_mhi0: link_state 0x1 -> 0x0
[  454.598300] net rmnet_mhi0: link_state 0x0 -> 0x1
[  454.601611] [I][mhi_netdev_open] Opened net dev interface
[  650.463074] net rmnet_mhi0: link_state 0x1 -> 0x0

Interface list:

ip link show

4: rmnet_mhi0: <NOARP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/none 
5: rmnet_mhi0.1: <NOARP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether 02:50:f4:00:00:01 brd ff:ff:ff:ff:ff:ff

AT command interface:

RDY

+CFUN: 1

+CPIN: READY

+QUSIM: 1

+QIND: SMS DONE

+QIND: PB DONE
at
OK

at+qcfg="pcie/mode"
+QCFG: "pcie/mode",0

OK
at+qcfg="usbnet"

+QCFG: "usbnet",2

OK

at+qcfg="pcie_mbim"
+QCFG: "pcie_mbim",1

OK
at+qcfg="data_interface"
+QCFG: "data_interface",1,0

OK

Please try the quectel-CM to set up data connection.

Sorry, I meant to add that as well.

sudo ./quectel-CM &

[09-11_18:57:29:916] QConnectManager_Linux_V1.6.1
[09-11_18:57:29:916] network interface '' or qmidev '' is not exist
[09-11_18:57:29:916] netcard driver = pcie_mhi, driver version = V1.3.7
[09-11_18:57:29:916] mbim_qmap_mode = 1, vlan_id = 0x01, qmap_netcard = rmnet_mhi0.1
[09-11_18:57:29:916] Modem works in MBIM mode
[09-11_18:57:29:951] cdc_wdm_fd = 7
[09-11_18:57:29:951] mbim_open_device()
[09-11_18:57:30:440] mbim_device_caps_query()
[09-11_18:57:30:450] DeviceId:     867826050698000
[09-11_18:57:30:450] FirmwareInfo: RM502QAEAAR11A04M4G
[09-11_18:57:30:451] HardwareInfo: RM502Q-AE
[09-11_18:57:30:451] mbim_device_services_query()
[09-11_18:57:30:457] mbim_set_radio_state( 1 )
[09-11_18:57:30:460] HwRadioState: 1, SwRadioState: 1
[09-11_18:57:30:460] mbim_subscriber_status_query()
[09-11_18:57:30:478] SubscriberId: 268069658332134
[09-11_18:57:30:478] SimIccId:     89351060001005698382
[09-11_18:57:30:478] SubscriberReadyState NotInitialized -> Initialized 
[09-11_18:57:30:478] mbim_register_state_query()
[09-11_18:57:30:484] RegisterState Unknown -> Home 
[09-11_18:57:30:484] mbim_packet_service_query()
[09-11_18:57:30:489] PacketServiceState Unknown -> Attached 
[09-11_18:57:30:489] CurrentDataClass = 5G_NSA
[09-11_18:57:30:489] mbim_query_connect(sessionID=0)
[09-11_18:57:30:493] ActivationState Unknown -> Deactivated 
[09-11_18:57:30:493] ifconfig rmnet_mhi0 down
[09-11_18:57:30:497] ifconfig rmnet_mhi0.1 0.0.0.0
SIOCSIFFLAGS: Network is down
[09-11_18:57:30:500] ifconfig rmnet_mhi0.1 down
[09-11_18:57:30:502] mbim_set_connect(onoff=1, sessionID=0)
[09-11_18:57:30:557] ActivationState Deactivated -> Activated 
[09-11_18:57:30:557] mbim_ip_config(sessionID=0)
[09-11_18:57:30:561] < SessionId = 0
[09-11_18:57:30:561] < IPv4ConfigurationAvailable = 0xb
[09-11_18:57:30:561] < IPv6ConfigurationAvailable = 0x0
[09-11_18:57:30:561] < IPv4AddressCount = 0x1
[09-11_18:57:30:561] < IPv4AddressOffset = 0x3c
[09-11_18:57:30:561] < IPv6AddressCount = 0x0
[09-11_18:57:30:561] < IPv6AddressOffset = 0x0
[09-11_18:57:30:561] < IPv4 = 10.142.116.51/29
[09-11_18:57:30:561] < gw = 10.142.116.52
[09-11_18:57:30:561] < dns1 = 0.0.0.0
[09-11_18:57:30:561] < ipv4 mtu = 1500
[09-11_18:57:30:565] ifconfig rmnet_mhi0 up
[09-11_18:57:30:575] ifconfig rmnet_mhi0.1 up
[09-11_18:57:30:578] ip -4 address flush dev rmnet_mhi0.1
[09-11_18:57:30:581] ip -4 address add 10.142.116.51/29 dev rmnet_mhi0.1
[09-11_18:57:30:584] ip -4 route add default via 10.142.116.52 dev rmnet_mhi0.1

And after that:

ifconfig

rmnet_mhi0: flags=193<UP,RUNNING,NOARP>  mtu 1500
        inet6 fe80::9f72:2809:6e48:9bb6  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 49  bytes 5266 (5.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

rmnet_mhi0.1: flags=193<UP,RUNNING,NOARP>  mtu 1500
        inet 10.142.116.51  netmask 255.255.255.248
        inet6 fe80::50:f4ff:fe00:1  prefixlen 64  scopeid 0x20<link>
        ether 02:50:f4:00:00:01  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 49  bytes 4580 (4.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Still no internet.

From the log, the rmnet_mhi0.1 has got the IP address.
Please also show the

route -n

Please try
ping 8.8.8.8

Here you go:

sudo ./quectel-CM 
[sudo] password for jetson_m350: 
[09-12_13:29:52:806] QConnectManager_Linux_V1.6.1
[09-12_13:29:52:807] network interface '' or qmidev '' is not exist
[09-12_13:29:52:807] netcard driver = pcie_mhi, driver version = V1.3.7
[09-12_13:29:52:807] mbim_qmap_mode = 1, vlan_id = 0x01, qmap_netcard = rmnet_mhi0.1
[09-12_13:29:52:807] Modem works in MBIM mode
[09-12_13:29:52:820] cdc_wdm_fd = 7
[09-12_13:29:52:821] mbim_open_device()
[09-12_13:29:53:236] mbim_device_caps_query()
[09-12_13:29:53:243] DeviceId:     867826050698000
[09-12_13:29:53:244] FirmwareInfo: RM502QAEAAR11A04M4G
[09-12_13:29:53:244] HardwareInfo: RM502Q-AE
[09-12_13:29:53:244] mbim_device_services_query()
[09-12_13:29:53:250] mbim_set_radio_state( 1 )
[09-12_13:29:53:253] HwRadioState: 1, SwRadioState: 1
[09-12_13:29:53:253] mbim_subscriber_status_query()
[09-12_13:29:53:261] SubscriberId: 268069658332134
[09-12_13:29:53:261] SimIccId:     89351060001005698382
[09-12_13:29:53:261] SubscriberReadyState NotInitialized -> Initialized 
[09-12_13:29:53:261] mbim_register_state_query()
[09-12_13:29:53:265] RegisterState Unknown -> Home 
[09-12_13:29:53:265] mbim_packet_service_query()
[09-12_13:29:53:269] PacketServiceState Unknown -> Attached 
[09-12_13:29:53:270] CurrentDataClass = 5G_NSA
[09-12_13:29:53:270] mbim_query_connect(sessionID=0)
[09-12_13:29:53:272] ActivationState Unknown -> Deactivated 
[09-12_13:29:53:272] ifconfig rmnet_mhi0 down
[09-12_13:29:53:277] ifconfig rmnet_mhi0.1 0.0.0.0
SIOCSIFFLAGS: Network is down
[09-12_13:29:53:278] ifconfig rmnet_mhi0.1 down
[09-12_13:29:53:281] mbim_set_connect(onoff=1, sessionID=0)
[09-12_13:29:53:324] ActivationState Deactivated -> Activated 
[09-12_13:29:53:324] mbim_ip_config(sessionID=0)
[09-12_13:29:53:327] < SessionId = 0
[09-12_13:29:53:327] < IPv4ConfigurationAvailable = 0xb
[09-12_13:29:53:327] < IPv6ConfigurationAvailable = 0x0
[09-12_13:29:53:327] < IPv4AddressCount = 0x1
[09-12_13:29:53:327] < IPv4AddressOffset = 0x3c
[09-12_13:29:53:327] < IPv6AddressCount = 0x0
[09-12_13:29:53:327] < IPv6AddressOffset = 0x0
[09-12_13:29:53:327] < IPv4 = 10.154.95.59/29
[09-12_13:29:53:327] < gw = 10.154.95.60
[09-12_13:29:53:327] < dns1 = 0.0.0.0
[09-12_13:29:53:327] < ipv4 mtu = 1500
[09-12_13:29:53:330] ifconfig rmnet_mhi0 up
[09-12_13:29:53:338] ifconfig rmnet_mhi0.1 up
[09-12_13:29:53:341] ip -4 address flush dev rmnet_mhi0.1
[09-12_13:29:53:343] ip -4 address add 10.154.95.59/29 dev rmnet_mhi0.1
[09-12_13:29:53:347] ip -4 route add default via 10.154.95.60 dev rmnet_mhi0.1
[09-12_13:36:05:367] mbim_register_state_query()
[09-12_13:36:05:372] mbim_packet_service_query()
[09-12_13:36:05:377] CurrentDataClass = LTE
ping -I rmnet_mhi0.1 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.154.95.59 rmnet_mhi0.1: 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
16 packets transmitted, 0 received, 100% packet loss, time 15336ms
route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.154.95.60    0.0.0.0         UG    0      0        0 rmnet_mhi0.1
0.0.0.0         192.168.36.1    0.0.0.0         UG    600    0        0 wlan0
0.0.0.0         10.42.0.1       0.0.0.0         UG    20100  0        0 eth0
10.42.0.0       0.0.0.0         255.255.255.0   U     100    0        0 eth0
10.154.95.56    0.0.0.0         255.255.255.248 U     0      0        0 rmnet_mhi0.1
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.0.0     0.0.0.0         255.255.0.0     U     0      0        0 l4tbr0
192.168.0.0     0.0.0.0         255.255.0.0     U     600    0        0 wlan0

From the log of the quectel-CM it seems everything is fine. Except that the operator do not provide us the DNS.
Have you tried another Sim card?
If you run the quectel-CM ,you can add the APN and the quectel-CM like

quectel-CM -s internet

And you can check wether you can ping the 8.8.8.8 with AT commands.

AT+QIACT=1
AT+QPING=1,"8.8.8.8"

This worked!
How can I make this a permanent connection? Or do I need to run quectel-CM on every boot?

It is running the OS like Ubuntu. I think you can add the quectel-CM like systemd service.