Guide to Real-Time Telemetry over 4G: Connecting a Raspberry Pi Zero W Companion Computer to a Drone

Real‑Time Telemetry over 4G: Connecting a Raspberry Pi Zero W Companion Computer to a Drone

Real‑Time Telemetry over 4G: Connecting a Raspberry Pi Zero W Companion Computer to a Drone

Modern drone operators demand low‑latency, long‑range telemetry that works beyond the range of traditional 2.4 GHz radio links. Using a Raspberry Pi Zero W as a companion computer and a 4G LTE modem gives you exactly that – real‑time MAVLink telemetry streamed over the cellular network.

What You’ll Learn

  • Hardware needed for a 4G telemetry bridge.
  • Step‑by‑step software installation on Raspberry Pi Zero W.
  • Configuring mavproxy / mavlink-router for bidirectional MAVLink.
  • Testing connectivity and troubleshooting common issues.

1️⃣ Hardware Overview

The following components are required for a robust 4G telemetry setup.

ComponentRecommended ModelWhy?
Companion ComputerRaspberry Pi Zero WCompact, 802.11 n Wi‑Fi, GPIO access.
4G LTE ModemHuawei E8372h / Quectel EC25 Mini PCIe (via USB‑adapter)USB‑OTG friendly, supports LTE‑Cat 4 + 5G fallback.
SIM CardData‑only plan (M2M)Low‑latency, reliable packet data.
Power Supply5 V 2 A Li‑Po with UBECEnsures stable voltage under cellular bursts.
ConnectorJST‑GH for Pi‑Zero UART, or TELEM‑2 for flight controllerSecure TX/RX wiring.

All parts fit into a 3‑inch drone‑mounted case that you can 3‑D print. Keep the antenna clear of metal to avoid signal attenuation.

2️⃣ Install the Operating System

We recommend Raspberry Pi OS Lite (64‑bit) for its small footprint.

  1. Download the image and flash it with balenaEtcher.
  2. Create an empty ssh file on the boot partition to enable SSH.
  3. Insert the micro‑SD card, power the Pi, and connect via ssh pi@raspberrypi.local (default password raspberry).

Once logged in, update packages:

sudo apt update && sudo apt full-upgrade -y
sudo reboot

3️⃣ Configure the 4G LTE Modem

Plug the USB modem into the Pi’s OTG port (use a powered USB hub if you need extra devices).

3.1 Install required tools

sudo apt install -y usb-modeswitch ppp usbutils minicom

3.2 Verify the modem is recognized

lsusb
# Example output: Bus 001 Device 005: ID 12d1:1f01 Huawei Technologies Co., Ltd. E8372h 4G LTE Modem

3.3 Create a qmi connection (recommended)

sudo apt install -y libqmi-utils
sudo qmicli -d /dev/cdc-wdm0 --connect-open
# Create a persistent systemd service
cat <<'EOF' | sudo tee /etc/systemd/system/qmi-4g.service
[Unit]
Description=QMI 4G LTE connection
After=network.target

[Service]
ExecStart=/usr/bin/qmicli -d /dev/cdc-wdm0 --connect --apn your_apn
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now qmi-4g.service

Replace your_apn with the APN provided by your carrier.

3.4 Test the data link

ping -c 3 8.8.8.8
curl https://api.ipify.org

You should see a public IP address assigned by the LTE network.

5️⃣ Ground‑Station Setup (Remote)

Your remote computer must listen on the public IP and port you defined (14560 in the example). A simple listener using mavlink-router or QGroundControl works.

5.1 Using QGroundControl (QGC)

  1. Open QGC → Settings → General → Comm Links.
  2. Add a new UDP link with IP: your_4g_public_ip and Port: 14560.
  3. Enable “Allow inbound traffic” on your router/firewall if you sit behind NAT.

5.2 Verify the stream

nc -ul 14560
# You should start seeing binary MAVLink traffic.

In QGC you’ll see the drone’s heartbeat, GPS, attitude, and live video (if you pipe the video feed separately).

6️⃣ End‑to‑End Test

Run the following checklist while the drone is on the ground (props removed).

  1. Check LTE signal strength: sudo qmicli -d /dev/cdc-wdm0 --get-signal-strength.
  2. Confirm mavlink-router is active: systemctl status mavlink-router.
  3. On the ground station, verify heartbeat: mavlink_console -i udp:0.0.0.0:14560 or via QGC.
  4. Send a command (e.g., arm) from the ground station and watch the telemetry LED on the flight controller.

If any step fails, consult the Callout Box below.

⚠️ Common Issues & Quick Fixes

  • No LTE connection: Ensure the SIM is activated, APN is correct, and the modem is not in “Mass Storage” mode (run usb_modeswitch).
  • High latency (>300 ms): Use a carrier with low‑latency M2M plan; avoid 3G fallback.
  • UART communication drops: Verify DeviceSpeed in /boot/config.txt matches the flight controller’s baud rate and enable the UART overlay: dtoverlay=uart0,txd0_pin=14,rxd0_pin=15.
  • Port blocked by firewall: Open UDP 14560 in both the Pi’s iptables (sudo iptables -A INPUT -p udp --dport 14560 -j ACCEPT) and any external router.

7️⃣ Performance Optimizations

The Pi Zero W has a 1 GHz ARM11 CPU and 512 MiB RAM. Keep the telemetry stack lightweight:

  • Disable HDMI (/boot/config.txt → hdmi_blanking=2) to free RAM.
  • Run mavlink-router in –no‑forward‑stats mode if not needed.
  • Use a static IP for the LTE interface to avoid DHCP delays on reconnection.

Conclusion

By following this guide, you transform a tiny Raspberry Pi Zero W into a powerful 4G telemetry bridge that streams real‑time MAVLink data over the cellular network. The setup is scalable, low‑cost, and compatible with any MAVLink‑based flight controller, giving you extended range, reliable command & control, and the foundation for future edge‑computing missions.

Ready to fly further? Explore adding RTK GNSS corrections over the same 4G link or integrate AI inference on the Pi for autonomous vision tasks.

Happy flying and stay connected!

Comments

Popular posts from this blog

Guide to Custom Ground Control Station: Building a Vanilla JS Dashboard to Graph Drone Sensor Data via WebSerial

Guide to Designing an ESP32-S3 Powered WiFi-Streaming Pocket Drone with Minimalist Code and Hardware