How the cellular path connects to Raspberry Pi 5
The CELLULAR LTE/5G slot is an M.2 Key-B socket on the board’s internal USB 3.0 hub, which also carries the NVMe slot. The hub reaches the Raspberry Pi 5 through the USB Bridge, not through the pogo pins or the PCIe cable:
- Modem: M.2 Key-B LTE · e.g. Quectel EM05-G
- Slot: CELLULAR LTE/5G · M.2 Key-B · USB lanes
- Hub: Internal USB hub · USB 3.0 · 5 Gbps
- Bridge: USB Bridge · USB-A connection
- Host: Raspberry Pi 5 · USB 3.0 port
The modem is a standard USB cellular device. The drivers that ship with Raspberry Pi OS (qmi_wwan, option, usbserial) handle it; you configure only the modem and the connection manager. The modem and the NVMe SSD are independent USB devices and can transfer data at the same time; AI inference runs on the separate PCIe link.
What you need
Hardware
- M.2 Key-B LTE modemThe Quectel EM05-G (LTE Cat 4, 150 Mbps down, 50 Mbps up) is the validated module. Any Quectel M.2 Key-B module with QMI mode works with this procedure.
- Nano SIM or nano eUICCOne nano SIM slot; no onboard eSIM. Nano eUICC cards work in the same slot. The SIM must be activated and not PIN-locked.
- AntennasNot included. The EM05-G has three U.FL ports: Main, Diversity, and GNSS.
Network
- Carrier APN
superfor Sixfab SIMs; for other operators, see the SIM documentation. A few plans also need a username and password.
Antenna connectors depend on module
The RF connectors are on the modem, not on the board. The EM05-G and the EC25/EG25 series use U.FL; many 5G modules use MHF4 with four ports for sub-6 MIMO. Check the module datasheet before ordering pigtails or antennas.
Install modem
Use the CELLULAR LTE/5G slot. Attach the antenna pigtails before seating the module: the RF connectors face up and are hard to reach once it is screwed down.
Power off before installing or removing modem
The board is not hot-pluggable. Disconnect the USB-C supply from the board before inserting or removing any M.2 module; hot-plugging can damage the modem, the SIM, the SIM slot, and the board.
-
Insert nano SIM card
Locate the nano SIM slot on the Expansion Board (push-pull tray on the side of the cellular M.2 slot). Insert the nano SIM with the contacts facing down and the chamfered corner aligned with the slot marking. Push until it clicks; the slot is spring-loaded.
nano eUICC cards work in the same slot. There is no electrical difference, only firmware-level profile management. If you are using a Sixfab eUICC card, profile provisioning happens after the connection is up.
-
Attach antenna pigtails to modem
With the modem held by its edges, snap the antenna pigtails onto the modem’s RF connectors. The Quectel EM05-G exposes three U.FL antenna interfaces: Main, Diversity, and GNSS. Attach the Main and Diversity pigtails for cellular operation, and optionally the GNSS pigtail if positioning is required.
Press straight down on each pigtail until you hear or feel a faint click. Do not rock or twist the connector. U.FL connectors are fragile and rated for a small number of mating cycles. If a connector fails to seat with light pressure, reposition rather than forcing it.
-
Seat modem in M.2 Key-B slot
Insert the modem into the
CELLULAR LTE/5Gslot at a 30-degree angle. The gold contacts on the modem edge must seat fully into the M.2 connector. The notch in the modem edge aligns with the Key-B key in the slot, which physically prevents installing the wrong-key module. -
Secure modem with M2 flat-head screw
Press the modem flat against the board. Drive a single M2 flat-head screw through the mounting hole on the free end of the modem into the board’s threaded standoff. Hand-tight is the spec; no power driver. The module should sit parallel to the board, locked in place, with the antenna pigtails routed away from the M.2 slots above.
-
Route antennas out of enclosure
Route the antenna pigtails clear of the heatsink, the Raspberry Pi 5 active cooler fan, and the M.2 modules above the cellular slot. Connect the external antennas (or the SMA bulkheads, if you are using a panel-mount setup) to the free ends of the pigtails. Power the Raspberry Pi 5 back on once the antennas are physically attached and the SIM is fully seated.
Never power modem without antennas attached
Operating the modem with no antenna (or with only one antenna on a multi-port modem) can damage the RF front end over time and registers as a high VSWR fault on some modules. Always attach antennas before powering up, and remove power before unseating an antenna pigtail.
Verify modem enumerates on USB
With the Raspberry Pi 5 back on, check that the modem is on USB before configuring anything. Quectel’s USB vendor ID is 2c7c:
lsusb | grep 2c7c
The product ID identifies the module:
| Module | USB ID |
|---|---|
| Quectel EM05-G | 2c7c:030a |
| Quectel EC25 | 2c7c:0125 |
| Quectel EG25-G | 2c7c:0125 |
The product ID can change with the USB mode set in the next step; that is expected.
If lsusb shows no Quectel device
Check, in order:
- The USB Bridge is firmly seated. It carries both the modem and the NVMe data: if the SSD is also missing, the bridge is the likely cause.
- The modem is fully seated in the slot and its M2 screw is tightened.
- The supply is at least 27 W. Modems draw peak current during registration; under-voltage disconnects USB devices.
Configure modem for QMI mode
quectel-cm talks to the modem over QMI (Qualcomm MSM Interface). QMI is the default mode shipped from the Quectel factory on most modules, so this step is often a verification only. If the module has been reconfigured previously, for example, to ECM or MBIM, you must switch it back before quectel-cm will work.
Open a serial console to the modem’s AT-command interface. Raspberry Pi OS auto-creates one or more /dev/ttyUSB nodes for the modem; the AT port is typically /dev/ttyUSB2 or /dev/ttyUSB3. Use any serial terminal you like; minicom is shown below at 115200 baud.
# Install minicom if you don't already have a serial terminal
sudo apt install -y minicom
# Open the modem's AT-command port (adjust ttyUSB number for your module)
sudo minicom -D /dev/ttyUSB2 -b 115200
Once the terminal is open, send the two AT commands below. The first sets the USB network composition to QMI (usbnet=0); the second is a full-functionality reset (CFUN=1,1) that reboots the modem so the new mode takes effect.
AT+QCFG="usbnet",0
AT+CFUN=1,1
The AT+QCFG="usbnet" parameter is supported on the Quectel EM05-G as well as the broader EC25/EG25 and RM502Q series, which are the families Sixfab currently stocks and tests. quectel-cm supports most Quectel modules that implement the QMI protocol; USB network configuration and AT-command behaviour may vary across module families, so consult the official Quectel QConnectManager user guide for advanced or unusual modules.
The modem will reboot automatically after AT+CFUN=1,1. Wait roughly 10 to 15 seconds for it to come back, then close the serial terminal and verify the QMI device node exists on the Raspberry Pi 5:
# Confirm the QMI character device is present
ls /dev/cdc-wdm*
/dev/cdc-wdm0
If /dev/cdc-wdm0 is missing, check the following:
- The USB Bridge cable between the Expansion Board and the Raspberry Pi 5 is securely connected.
- The modem powered up; re-run
lsusband confirm the Quectel device is still listed. - The
qmi_wwankernel driver is loaded:lsmod | grep qmi_wwan. - The QMI mode switch actually applied; re-open the AT console and run
AT+QCFG="usbnet"with no argument; the response should be+QCFG: "usbnet",0.
Build Quectel CM Tool
quectel-cm is Quectel’s official connection-manager utility for QMI modules. It handles network registration, IP-address acquisition over DHCP, DNS setup, and routing. The tool ships as source; Sixfab mirrors the canonical package from Quectel’s QConnectManager release on sixfab.com.
Install the build prerequisites first. Raspberry Pi OS Bookworm and Trixie both work; any modern Debian-based distribution with Linux kernel 3.4 or newer is fine.
# 1. Refresh package lists and install build tools
sudo apt update
sudo apt install -y build-essential wget unzip
Then download the QConnectManager source, unzip it, rename the directory for clarity, and compile quectel-cm with make. The build is short and has no external dependencies beyond build-essential.
# 2. Move into your home directory
cd ~
# 3. Download QConnectManager source from Sixfab's mirror
wget https://sixfab.com/wp-content/uploads/2023/09/Quectel_QConnectManager_Linux_V1.6.5.zip
# 4. Unzip and rename for convenience
unzip -q Quectel_QConnectManager_Linux_V1.6.5.zip
mv Quectel_QConnectManager_Linux_V1.6.5 quectel-cm
cd quectel-cm
# 5. Build the quectel-cm binary
make
The build produces a single executable, quectel-cm, in the current directory. There is no make install step; the binary runs from wherever you built it. Many users keep it in ~/quectel-cm/; if you want it on the system PATH, copy it to /usr/local/bin/.
What about the default.script file?
The release tarball includes a default.script file alongside the binary. It is used by quectel-cm‘s built-in DHCP client to configure the WAN interface with the IP, DNS servers, and default route that the carrier assigns. Keep it in the same directory as the binary; no manual editing is needed for standard deployments.
Connect to network
With the modem in QMI mode and quectel-cm built, bring up the data connection.
-
Find your APN
Without the right APN the modem registers on the network but cannot open a data session.
Sixfab SIM
No username or password required. Works out of the box with the
-s superflag onquectel-cm.- APN
- super
Other carriers
Consult the SIM documentation or contact the carrier. Some plans also require a username and password; most do not.
- APN
- Operator-specific
-
Start connection
Run
quectel-cmwith-sand your APN;&runs it in the background:sudo ./quectel-cm -s super &It queries the modem, waits for registration, opens a QMI data session, and requests an address over DHCP. Within a few seconds it reports an IP address on
wwan0. -
Check WAN interface
# Inspect the wwan0 interface ip a show wwan04: wwan0: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 02:50:f4:00:00:00 brd ff:ff:ff:ff:ff:ff inet 10.x.x.x/30 brd 10.x.x.x scope global dynamic noprefixroute wwan0 valid_lft 7172sec preferred_lft 7172secinet 10.x.x.xis the address the carrier assigned: the modem registered, the APN was accepted, and the data session is open. Carrier addresses are usually private (CGNAT, often10.x.x.xor100.64.x.x) and not reachable from the internet unless the plan includes a public IP. -
Test connection
-I wwan0sends the ping through the cellular link even if Wi-Fi or Ethernet is up:# Send three pings out the cellular interface ping -I wwan0 -c 3 8.8.8.8PING 8.8.8.8 (8.8.8.8) from 10.x.x.x wwan0: 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=42.3 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=58 time=38.1 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=58 time=39.7 ms --- 8.8.8.8 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 38.1/40.0/42.3/1.7 msThree replies with 0 % packet loss mean the link reaches the internet. LTE latency to a well-peered host is typically 30 to 80 ms (5G NR sub-6: 15 to 40 ms). Spikes above 200 ms or lost packets usually mean weak signal, the cell edge, or congestion.
Stop connection
Stop quectel-cm; it closes the data session and releases the interface:
# Stop the connection manager and drop the data session
sudo killall quectel-cm
Run quectel-cm as systemd service
On a headless device the link must come up at boot and recover from drops. A systemd unit starts quectel-cm once the QMI device exists, restarts it when it exits, and logs to the journal.
Copy the binary and its DHCP script to a system location:
sudo cp ~/quectel-cm/quectel-cm /usr/local/bin/
sudo cp ~/quectel-cm/default.script /usr/local/bin/
sudo chmod +x /usr/local/bin/quectel-cm /usr/local/bin/default.script
Create the unit file:
sudo nano /etc/systemd/system/quectel-cm.service
Paste this unit, with your APN in ExecStart, and save:
[Unit]
Description=Quectel CM cellular connection manager
After=network-online.target dev-cdc--wdm0.device
Wants=network-online.target
StartLimitIntervalSec=0
[Service]
Type=simple
WorkingDirectory=/usr/local/bin
ExecStart=/usr/local/bin/quectel-cm -s super
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target
Enable and start it, then check its status and log:
sudo systemctl daemon-reload
sudo systemctl enable --now quectel-cm.service
sudo systemctl status quectel-cm.service
sudo journalctl -u quectel-cm.service -f
How the recipe behaves
The After=dev-cdc--wdm0.device dependency makes systemd wait until the QMI character device exists before launching quectel-cm. That avoids the race where the unit starts before the kernel has finished probing the modem on cold boot. Restart=on-failure with a 10-second delay handles modem reboots, signal loss, and transient carrier failures without flooding the journal.
Signal quality and band locking
Once the link is up, the two most useful pieces of telemetry are the radio-link quality (RSRP, RSRQ, SINR, RSSI) and the band the modem chose. Both come out of the modem over the AT-command interface; the link itself stays up while you query.
Read signal quality with AT+QENG
Reopen the AT port (typically /dev/ttyUSB2) and issue AT+QENG="servingcell". The reply enumerates the serving cell along with the four canonical LTE quality metrics.
AT+QENG="servingcell"
+QENG: "servingcell","NOCONN","LTE","FDD",286,01,1A2B3C4,123,1850,3,4,4,B2D9,-95,-11,-65,14,-
OK
The four metrics that matter, read left-to-right from the trailing block: RSRP, RSRQ, RSSI, SINR. The example shows RSRP -95 dBm, RSRQ -11 dB, RSSI -65 dBm, SINR 14 dB. The position field 3 is the LTE band number; field 286,01 is the MCC/MNC of the serving network.
| Excellent | Good | Fair | Poor | |
|---|---|---|---|---|
| RSRP (dBm) | ≥ -80 | -80 to -90 | -90 to -100 | ≤ -100 |
| RSRQ (dB) | ≥ -10 | -10 to -15 | -15 to -20 | ≤ -20 |
| SINR (dB) | ≥ 20 | 13 to 20 | 0 to 13 | ≤ 0 |
| RSSI (dBm) | ≥ -65 | -65 to -75 | -75 to -85 | ≤ -85 |
Poll signal quality from script
For monitoring loops, drive the AT port through a one-shot pipe rather than holding a long-running terminal. The snippet below opens /dev/ttyUSB2 at 115200 baud, sends the query, and waits 1 second for the response.
# One-shot AT query, returns the +QENG line for parsing
sudo stty -F /dev/ttyUSB2 115200 cs8 -cstopb -parenb raw
echo -e 'AT+QENG="servingcell"\r' | sudo tee /dev/ttyUSB2 >/dev/null
sudo timeout 1 cat /dev/ttyUSB2
Lock to specific network mode or band
The EM05-G is an LTE Cat 4 module. Locking it to one radio access technology saves the time spent on fallback handovers in poor coverage. The AT command depends on the module family: AT+QCFG="nwscanmode" on EM05, EC25, and EG25; AT+QNWPREFCFG="mode_pref" on 5G modules such as the RM5xx series.
AT+QCFG="nwscanmode",3,1 // 0=auto, 1=GSM, 2=WCDMA, 3=LTE only
AT+QCFG="nwscanseq",030201,1 // search order: LTE, WCDMA, GSM
To lock to a specific LTE band, set the band mask. The mask is a hex bitfield: bit 0 = B1, bit 1 = B2, bit 2 = B3, and so on. The example below locks the EM05-G to LTE Band 3 (B3) and Band 7 (B7), the two dominant European LTE bands.
AT+QCFG="band",0,44,0,1 // GSM=0, LTE=0x44 (B3|B7), WCDMA=0, effective=immediate
Band lock can leave you with no service
Band locks persist across modem reboots. If the device moves to a region where the locked bands are not deployed, the modem registers nowhere and looks “dead”. Always confirm the carrier and region bands before locking, and keep AT+QCFG="band",0,0,0,1 handy to clear the mask back to “all bands enabled”.
GPS/GNSS positioning with EM05-G
The Quectel EM05-G includes a dedicated GNSS receiver covering GPS, GLONASS, Galileo, and BeiDou. The receiver shares the modem’s RF stage with the cellular path, so it can run concurrently with a data session. Position fixes come out over the same AT port as plain NMEA sentences or via a dedicated AT-command query. The GNSS antenna attaches to the third (Aux/GNSS) U.FL connector on the module.
Enable GNSS
GNSS is off by default to save power. Turn it on with AT+QGPS=1; this powers the receiver and starts acquisition. Time to first fix (TTFF) is typically 30 to 45 seconds cold-start with a clear sky, dropping to 1 to 5 seconds for a hot-start once almanac data has been cached.
AT+QGPSCFG="gnssconfig",1 // 1=GPS+BeiDou+Galileo+QZSS, 0=GPS only
AT+QGPSCFG="outport","usbnmea" // stream NMEA on /dev/ttyUSB1
AT+QGPS=1 // power on the GNSS receiver
With outport=usbnmea, the modem creates an additional USB serial node (commonly /dev/ttyUSB1) that emits standard NMEA-0183 sentences continuously. Any GPS-aware library on the Raspberry Pi 5 can read this directly.
# Stream raw NMEA from the GNSS output port
sudo stty -F /dev/ttyUSB1 9600 raw
sudo cat /dev/ttyUSB1
One-shot position query
To pull a single fix without streaming NMEA, use AT+QGPSLOC=2 on the AT port. The format flag 2 returns latitude and longitude as decimal degrees (versus the default DMS).
AT+QGPSLOC=2
+QGPSLOC: 153045.0,41.012345,28.987654,1.2,87.5,3,0.00,0.0,0.0,150526,11
OK
The response fields, in order: UTC time (153045.0), latitude (41.012345°), longitude (28.987654°), HDOP (1.2), altitude in metres (87.5), fix type (3 = 3D fix), course, speed in km/h, speed in knots, UTC date (150526 = 15-May-26), and number of satellites in view (11). An HDOP under 2.0 and at least 7 satellites is typical for a clean fix.
To stop the receiver and save power, run AT+QGPSEND.
Concurrent cellular and GNSS
The EM05-G can run cellular data and GNSS simultaneously. The two share the modem’s RF front end; the GNSS antenna is the dedicated third U.FL port. There is no need to bring the data session down to read a position fix.
Failover and data-usage monitoring
For production deployments, cellular usually sits behind a primary link (Wi-Fi or Ethernet) and steps in when the primary fails. Two pieces matter: a routing policy that prefers the primary, and a guard that watches cellular byte counters so a runaway process does not eat the data plan.
Wi-Fi or Ethernet to cellular failover
The simplest mechanism is routing-metric priority. Linux picks the default route with the lowest metric, so as long as Ethernet (eth0) carries a lower metric than cellular (wwan0), packets exit Ethernet whenever it is up. When Ethernet drops, the next-lowest-metric route (cellular) takes over automatically.
# Inspect current default routes and their metrics
ip route show default
# Set Ethernet as primary (metric 100), cellular as backup (metric 700)
sudo ip route replace default via 192.168.1.1 dev eth0 metric 100
sudo ip route replace default dev wwan0 metric 700
For persistence across reboots, configure metrics in /etc/dhcpcd.conf with the metric directive per interface. For automatic dead-link detection (not just interface-down), add a short shell script driven by cron or a systemd timer that pings a known target through eth0 and rewrites the metric when the ping fails three times in a row. This is the standard Linux pattern and works equally well with NetworkManager when its connection.autoconnect-priority setting is used in place of raw metrics.
Watch cellular byte counters
The kernel keeps per-interface RX/TX counters in /sys/class/net/<iface>/statistics. A small vnstat install is the canonical way to roll these up into hourly, daily, and monthly totals on Raspberry Pi OS.
# Install vnstat and add the cellular interface
sudo apt install -y vnstat
sudo systemctl enable --now vnstat
# Show daily and monthly totals on wwan0
vnstat -i wwan0 -d
vnstat -i wwan0 -m
For ad-hoc inspection without vnstat, the raw counters are always available:
# Raw cumulative byte counters since interface came up
cat /sys/class/net/wwan0/statistics/rx_bytes
cat /sys/class/net/wwan0/statistics/tx_bytes
Diagnose registration and data-session issues
Two failure modes account for almost every “cellular doesn’t work” report once the hardware is confirmed: the modem registers on the network but no data flows, or the modem is detected on USB but never registers. The diagnostics for each are distinct.
Modem detected but cannot register on a network
Symptom: lsusb shows the Quectel device, /dev/cdc-wdm0 exists, but quectel-cm hangs waiting for registration. The fault is in the radio layer or the SIM.
Check registration status with AT+CREG? on the AT port. The reply is +CREG: <n>,<stat> where stat is the answer:
| 0 | Not registered, not searching | Modem is idle. Check AT+CFUN?; if it returns 0, send AT+CFUN=1 to wake the radio. |
| 1 | Registered, home network | Healthy. Radio attached to the home PLMN. Move on to data-session troubleshooting. |
| 2 | Not registered, searching | Coverage issue or band lock. Check the antennas are seated, then clear any band mask with AT+QCFG="band",0,0,0,1. |
| 3 | Registration denied | SIM rejected by the network. Confirm SIM activation status and that the carrier has whitelisted the modem’s IMEI for this APN/plan. |
| 4 | Unknown | Modem is in a transient state, typically right after power-on or a CFUN reset. Retry the query after 30 seconds. |
| 5 | Registered, roaming | Healthy on a partner network. Confirm the data plan includes roaming, otherwise data may be billed at premium rates or blocked entirely. |
Confirm the SIM is seen and unlocked with AT+CPIN?. The healthy reply is +CPIN: READY. Any other response means the SIM is missing, PIN-locked, or permanently failed.
AT+CPIN? // SIM presence and PIN state
AT+CREG? // 2G/3G registration status
AT+CEREG? // LTE/EPS registration status
AT+COPS? // currently selected operator
AT+CSQ // RSSI and BER summary
Registered but no data flows
Symptom: AT+CREG? returns 1 or 5 (registered), but quectel-cm fails to bring wwan0 up or assigns an IP yet pings fail. The fault is at the PDN/APN layer.
First confirm the active APN matches the carrier’s expectation. Read it with AT+CGDCONT?; the response lists each PDP context, one per line. Context 1 is the default data context.
AT+CGDCONT? // list current PDP contexts
AT+CGDCONT=1,"IP","super" // set context 1 to APN "super" (Sixfab SIMs)
AT+CGACT? // active PDP contexts (1=active, 0=inactive)
AT+CGACT=1,1 // bring context 1 up
AT+CGPADDR=1 // IP address assigned to context 1
If AT+CGPADDR=1 returns an empty address despite an active context, the carrier rejected the data session. The two common causes are an incorrect APN and a SIM that is provisioned for voice/SMS but not data. Both are carrier-side issues and require contacting the operator.
Quick triage decision tree
On a fresh “it doesn’t work” report, run these five commands in order. The first one to return an unexpected value points at the layer to debug.
# 1. Is the modem on USB? → if no, USB Bridge cable / power
lsusb | grep 2c7c
# 2. Does QMI exist? → if no, AT+QCFG="usbnet",0 + AT+CFUN=1,1
ls /dev/cdc-wdm*
# 3. SIM ready? → AT+CPIN? must be READY
# 4. Registered? → AT+CREG? and AT+CEREG? must be 1 or 5
# 5. Data session up? → ip a show wwan0 must show inet
Concurrent operation with NVMe and AI inference
The NPU, the NVMe SSD, and the modem can run at the same time without a measurable drop in AI throughput. Sixfab validated continuous YOLO inference on the NPU, frame storage on the SSD, and an LTE uplink together. The modem and the SSD share the 5 Gbps USB bus; the NPU has its own PCIe link.
Two limits when all three run:
- USB current. All Raspberry Pi 5 USB ports share a 1.6 A budget. The modem draws most while transmitting, and the SSD draws its own current. Use at least a 27 W supply (45 W recommended) to avoid under-voltage under load.
- Antenna placement. At the edge of coverage the modem raises its transmit power, which adds heat and current. Keep the antennas away from the Raspberry Pi 5 heatsink and conductive enclosure surfaces.