Skip to content

Instantly share code, notes, and snippets.

@clouedoc
Last active January 31, 2026 12:39
Show Gist options
  • Select an option

  • Save clouedoc/14af89b947ddf7805e4b1765ba025cbf to your computer and use it in GitHub Desktop.

Select an option

Save clouedoc/14af89b947ddf7805e4b1765ba025cbf to your computer and use it in GitHub Desktop.

Quectel RM520N-GL 5G Modem Setup on Linux

This guide covers setting up the Quectel RM520N-GL 5G modem on Linux (tested on Arch Linux with kernel 6.18).

Hardware Info

Property Value
Model Quectel RM520N-GL
PCI Vendor:Device 1eac:1007
Capabilities 3G, 4G LTE, 5G NR
Driver mhi-pci-generic

Step 1: Verify Hardware Detection

Check if the modem is detected:

lspci | grep -i quectel

Expected output:

01:00.0 Unassigned class [ff00]: Quectel Wireless Solutions Co., Ltd. Device 1007

Verify driver is loaded:

lspci -v -s 01:00.0 | grep "Kernel driver"

Expected: Kernel driver in use: mhi-pci-generic

Step 2: Enable ModemManager

sudo systemctl enable --now ModemManager

Note: It can take 1-2 minutes for ModemManager to fully detect and initialize the modem. Be patient and poll periodically:

mmcli -L

If no modem is found, wait and try again.

Step 3: Insert SIM Card

If using a physical SIM card, insert it and check which slot it's in:

mmcli -m 0 | grep "sim slot"

If needed, switch to the correct slot (e.g., slot 1):

sudo mmcli -m 0 --set-primary-sim-slot=1

The modem will reinitialize. Wait ~10 seconds and run mmcli -L again.

Step 4: FCC Unlock

The RM520N-GL ships with FCC lock enabled. Check the lock state:

sudo mbimcli -p -d /dev/wwan0mbim0 --quectel-query-radio-state

If locked, unlock with:

sudo mbimcli -p -d /dev/wwan0mbim0 --quectel-set-radio-state=on

Step 5: Enable the Modem

sudo mmcli -m 0 --enable

Verify the modem is registered on the network:

mmcli -m 0 | grep -E "(state|operator|access tech|signal)"

Expected output should show:

  • state: registered
  • operator name: <your carrier>
  • access tech: lte or lte, 5gnr

Step 6: Create Network Connection

Create a NetworkManager GSM connection (replace YOUR_APN with your carrier's APN):

nmcli connection add type gsm ifname wwan0mbim0 con-name "Mobile" apn YOUR_APN
nmcli connection up "Mobile"

What is an APN?

APN (Access Point Name) is a gateway between your carrier's mobile network and the internet. Each carrier has its own APN settings.

How to find your APN:

  • Check your carrier's website or support pages
  • Search for "<carrier name> APN settings"
  • Call your carrier's support line
  • Check the SIM card packaging or documentation

Example: For Smart Axiata (Cambodia), the APN is smart.

Verify connectivity:

ip addr show wwan0
ping -c 3 8.8.8.8

Troubleshooting

Modem not detected by ModemManager

Restart ModemManager and wait:

sudo systemctl restart ModemManager
sleep 10
mmcli -L

"Invalid transition" errors

This usually means FCC lock is active. Follow Step 4.

Connection fails

Check modem state:

mmcli -m 0

If state: failed, check the failed reason field. Common issues:

  • esim-without-profiles: Switch to slot with physical SIM
  • sim-missing: SIM not inserted or wrong slot active

Check signal strength

mmcli -m 0 --signal-get

Useful Commands

# List modems
mmcli -L

# Full modem status
mmcli -m 0

# SIM info
mmcli -i 0

# Signal info
mmcli -m 0 --signal-get

# List bearers/connections
mmcli -m 0 | grep bearer

# Bearer details
mmcli -b 0

# Disconnect
nmcli connection down "Mobile"

# Disable modem
sudo mmcli -m 0 --disable

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment