GPS & Magnetometer
Table of contents
- How GPS and Compass Work on VOXL 2
- No GPS Data: The Triage Ladder
- GPS Runs But No Lock
- Verifying the Receiver Directly with u-center
- Interference and EMI
- Compass Problems
- Third-Party GPS Units
How GPS and Compass Work on VOXL 2
- VOXL 2 has no onboard magnetometer. The compass arrives with the GPS module (the M0094 GPS/Mag/RC kit, Holybro-sourced), connected to J19.
- PX4 on VOXL 2 is split between the applications processor (Linux) and the sensors DSP. The GPS and magnetometer drivers run on the DSP — interact with them via
px4-qshell(e.g.px4-qshell gps status), and read their topics withpx4-listener. - Driver start lines live in
/usr/bin/voxl-px4-start— effectively the reference documentation for GPS/mag bring-up. At boot, PX4 probes several magnetometer drivers (qmc5883l, ist8310, and others) expecting most to fail — “failed to start” messages for absent mags are normal. - The J19 UART map: port 6 is GPS, port 7 is RC, and the same cable carries the I2C bus (
-b 1) used by the mag and LED.
The red status LED is a general PX4 preflight indicator, not a GPS light. If it’s blinking red, run
voxl-px4in the foreground or check QGC’s arming message to see which preflight check is failing.
No GPS Data: The Triage Ladder
px4-listener sensor_gps— if it prints “never published”, the driver isn’t talking to the receiver at all; keep going down this list. If data flows but there’s no fix, skip to No Lock.px4-qshell gps status— driver state from the DSP side.- Full startup log:
journalctl --no-pager -b -u voxl-px4 > /tmp/log.txtand read the GPS section. - Run PX4 in the foreground for everything:
systemctl stop voxl-px4, thenvoxl-px4 -d. - Check the start line. On old SDKs
/etc/modalai/voxl-px4.configshippedqshell gps start -d 7 -b 115200— those arguments were wrong (port 7 is RC, and-dwasn’t parsed) and removing them was the standard fix. Current SDKs ship a plainqshell gps start. Don’t execute the config file directly; edit it and reboot. - Suspect the cable. Intermittent serial is the classic symptom of a marginal cable/connector — press on the connector while PX4 starts and watch whether behavior changes.
i2c probe failederrors alongside GPS trouble point at the same cable (it carries both). - Still nothing? Verify the receiver independently (below), and if the unit is dead, RMA.
GPS Runs But No Lock
- Be outside with clear sky view — indoors near a window rarely locks.
- The receiver acquires its fix independently of PX4: a lock (or lack of one) says nothing about the VOXL connection, and VIO/EKF parameters have no effect on acquisition.
- Distinguish “never locks anywhere” (suspect the unit or interference) from “locks slowly / poor accuracy at this location” (environment). A second known-good receiver is the fastest arbiter.
- Standard L1 GPS accuracy is roughly 3-5 m — don’t benchmark against a modern phone, which augments with dual-band and WiFi positioning.
EKF2_GPS_CHECK 1relaxes EKF gating to satellite count only (EKF2_REQ_NSATS, default 6) — useful for bench work, not a fix for a weak signal.
Verifying the Receiver Directly with u-center
The gold-standard isolation test: drone powered off, connect the GPS unit to a laptop with a USB-serial adapter (5V supply, 3.3V logic) and watch it in u-blox u-center.
Wiring for the 6-pin connector (see the pinout; directions given explicitly to avoid the usual confusion):
pin 1: 5V power from USB adapter to GPS
pin 2: TX out of USB adapter -> RX into GPS
pin 3: RX into USB adapter <- TX out of GPS
pin 6: GND
Bump the receiver’s baud to 115200+ first — the default 9600 overflows once satellite data flows.
What healthy looks like: under open sky, the majority of satellites at 40-45 dB SNR. Averages around 33 dB are ~10 dB low; 20-30 dB means something is actively wrong. The killer test: watch SNR live while powering the drone on — a ~10 dB drop across all satellites the moment the platform powers up is confirmed self-interference, and you likely can’t fly GPS reliably even with a “lock”.
On the vehicle, enable per-satellite SNR with param set GPS_SAT_INFO 1 (restart PX4, read px4-listener satellite_info) — and current voxl-portal displays GPS SNR directly.
Interference and EMI
GPS self-interference is the root cause behind most “poor fix on the bench” reports. Known sources, strongest first:
- Your RC transmitter — a 900 MHz handset within ~2 m of the drone can cost up to 10 dB SNR. Stand back before takeoff; don’t hold the TX above the GPS antenna.
- The platform itself — cameras, the 5G modem, and USB WiFi dongles all radiate. Isolate by switching subsystems off one at a time:
systemctl stop voxl-camera-server(powers down cameras), power the 5G modem off viavoxl-gpio -m 1 out; voxl-gpio -w 1 0, relocate a WiFi dongle off the board with a cable (M0151 breakout) instead of the direct M0141. - Layout — antennas beside power electronics wreck both GPS and the radio link. On a bench build, mimic the physical separation a production drone has.
- Physical antenna damage: deep scratches through the patch antenna’s plane detune it (the two factory notches are tuning cuts, not damage).
Full guidance lives on EMI Mitigation for GNSS and the consolidated GNSS EMI mitigation guidelines forum post. For Starling 2 Max, ModalAI’s GPS mast kit (raising the unit ~11 cm with a ground plane underneath) recovers signal to near-reference levels.
If you relocate the GPS unit (mast or otherwise): the magnetometer moved with it, so recalibrate the compass, and update the
EKF2_GPS_POS_*position offsets to match the new location.
Compass Problems
- “Compass Sensor 0 missing” / compass red in QGC: on VOXL 2 this almost always means the GPS/mag unit isn’t connected or its I2C isn’t alive (same cable as GPS — see the triage ladder). There is no fallback onboard mag. On Flight Core V2, the internal mag exists but is deliberately disabled — the mag in play is still the GPS unit’s.
- Mounting orientation: the mag driver’s
-Rrotation in the start line must match how the unit is mounted. For the standard Holybro unit:-R 10with the arrow pointing forward,-R 14if it points backward. - Heading stuck at north / QGC always shows north: the classic IMU-vs-mag rotation mismatch. Trace with
px4-listener sensor_mag→px4-listener vehicle_magnetometer→ QGC’sGLOBAL_POSITION_INT(hdgfield). Set rotation on the IMU driver line orSENS_BOARD_ROT— never both.
Changing any rotation option or parameter invalidates existing sensor calibrations — recalibrate everything (mag, gyro, accel, level) after a rotation change, or old calibration data will corrupt the fixed setup.
Flying Without GPS or Compass
For pure indoor/VIO flight: set GPS=NONE in /etc/modalai/voxl-px4.conf, then SYS_HAS_GPS 0, SYS_HAS_MAG 0, EKF2_MAG_TYPE 5, EKF2_GPS_CTRL 0, and reboot. Two cautions from the field:
- Only do this with healthy VIO — do the hand-held VIO test before flying position mode.
- On some setups the external-vision timeout needs headroom:
EKF2_NOAID_TOUT 8000000. If the log shows repeated “yaw estimate error”, check that the yaw bit ofEKF2_EV_CTRLis enabled.
The indoor (VIO) and outdoor (GPS) parameter sets in voxl-px4-params are maintained as mutually exclusive configurations — pick the one matching your flight environment and PX4 version.
Third-Party GPS Units
- Known-good external receiver: the u-blox MAX-M10S (verified on both PX4 and ArduPilot).
- Magnetometers supported out of the box: qmc5883l and ist8310. Units with other mags (e.g. lis3mdl) will have working GPS but a dead compass unless you build the driver into voxl-px4 yourself.
- A silent unit can be scoped: M10-class receivers emit NMEA at 9600 baud from power-on, visible on the TX line.
- RTK modules and dual-GPS configurations are not supported or tested.
Under ArduPilot,
voxl-inspect-gpscurrently prints nothing even when GPS works — use QGC’s MAVLink Inspector (GPS_RAW_INT) instead.