Works with
Before you begin
Hardware
- Raspberry Pi 5 or 4The Raspberry Pi 5 with an active cooler.
- M.2 5G moduleFor example the Quectel RM520N-GL; another module must be compatible.
- Active SIM cardNano SIM. A Sixfab ProSIM uses 5G where the carrier network offers it and falls back to LTE elsewhere; SuperSIM does not support 5G.
Check module
Before you set up the network, check that the Raspberry Pi recognizes the module over USB.
-
List USB devices.
lsusbThe module is listed. With a Quectel module, for example:
Bus 001 Device 009: ID 2c7c:0800 Quectel Wireless Solutions Co., Ltd.The device ID depends on the module.
-
Check serial ports.
dmesg | grep ttyUSBThe driver has created several serial ports for AT commands, diagnostics and GNSS data:
[ 154.014341] usb 1-1.1.2: GSM modem (1-port) converter now attached to ttyUSB0 [ 154.015183] usb 1-1.1.2: GSM modem (1-port) converter now attached to ttyUSB1 [ 154.015632] usb 1-1.1.2: GSM modem (1-port) converter now attached to ttyUSB2 [ 154.015994] usb 1-1.1.2: GSM modem (1-port) converter now attached to ttyUSB3 -
Send AT commands.
Open the AT port with a serial tool such as
minicom,busybox microcomorpicocom, or withechoandcat; see Send AT commands. Check that the module answers:ATOKCheck that it detects the SIM card or the active eSIM:
AT+CPIN?+CPIN: READY OK
Check network registration
The examples use the Quectel RM520N-GL. The 3GPP commands (AT, AT+CPIN?, AT+CEREG?, AT+C5GREG?, AT+COPS?) work on most modems; AT+QENG="servingcell" is specific to Quectel. With another module, see its AT command manual.
-
Set APN.
Some carriers need the APN for the registration. Replace
internetwith your carrier’s APN:AT+CGDCONT=1,"IPV4V6","internet" -
Check serving cell.
AT+QENG="servingcell"+QENG: "servingcell","NOCONN","NR5G-SA","TDD",286,03,51D62006F,800,310F00,632640,78,3,-107,-12,8,1,21 OK- State:
NOCONN(idle) orCONNECT(connected).SEARCHorLIMSRV(limited service): the module is still scanning or is restricted. - Radio access technology: for example
NR5G-SA,NR5G-NSAorLTE. - RSRP: -80 dBm or more is excellent, -81 to -90 dBm good, -91 to -100 dBm fair; below -100 dBm is poor: check the antennas.
- SINR: higher is better, for example 15 dB; below 0 dB the signal is noisy.
- State:
-
Check registration.
For LTE:
AT+CEREG?+CEREG: 0,1 OKFor 5G NR:
AT+C5GREG?+C5GREG: 0,1 OKAnswer Status 0,1or0,5Registered, home network or roaming 0,2Searching for an operator 0,3Registration denied: SIM, APN or carrier account 0,0Not registered, not searching
Connect to internet
The connection method depends on the module’s chipset. Qualcomm-based modules such as the Quectel RM520N-GL use QMI or MBIM through the kernel’s qmi_wwan or cdc_mbim drivers, or NetworkManager. Other modules may use MBIM, ECM, RNDIS, PPP or the manufacturer’s own tools. For the RM520N-GL: