Adapters
Serial / GPS

Serial / GPS

Read GPS data from serial UART devices. The GPS sensor driver parses NMEA sentences into structured metrics.

Install

pip install plexus-agent[serial]

Quick Start

The GPS sensor is auto-detected when plexus start or plexus run scans serial ports:

plexus start --key plx_xxxxx

Or use it programmatically:

from plexus.sensors import GPS, SensorHub
from plexus import Plexus
 
hub = SensorHub()
hub.add(GPS(port="/dev/ttyUSB0", baud=9600))
hub.run(Plexus())

GPS Metrics

The driver parses GGA and RMC NMEA sentences and produces:

MetricTypeDescription
gps_latitudefloatLatitude in decimal degrees
gps_longitudefloatLongitude in decimal degrees
gps_altitudefloatAltitude above sea level (meters)
gps_speed_knotsfloatGround speed in knots
gps_satellitesintNumber of satellites in use
gps_hdopfloatHorizontal dilution of precision

NMEA Protocol

The driver supports the standard NMEA 0183 protocol over serial UART. Most USB GPS receivers (u-blox, GlobalSat, etc.) output NMEA by default.

Supported Sentences

SentenceData
$GPGGAPosition fix, altitude, satellite count, HDOP
$GPRMCRecommended minimum — position, speed, course, date

Other sentences are silently ignored.

Common Serial Ports

DevicePort
USB GPS receiver (Linux)/dev/ttyUSB0 or /dev/ttyACM0
Raspberry Pi UART pins/dev/ttyAMA0 or /dev/serial0
USB GPS receiver (macOS)/dev/tty.usbserial-*

Baud Rate

Most GPS modules default to 9600 baud. Some high-update-rate modules (u-blox NEO-M8, M9) can be configured for 38400 or 115200.

Wiring (Raspberry Pi)

For a GPS module connected to the Pi's UART pins:

GPS ModulePi Pin
TXGPIO 15 (RXD)
RXGPIO 14 (TXD)
VCC3.3V
GNDGND

Enable the serial port:

sudo raspi-config
# → Interface Options → Serial Port
# → Login shell: No
# → Serial hardware: Yes

Troubleshooting

No data received:

  • Check the port exists: ls /dev/tty*
  • Verify output: cat /dev/ttyUSB0 (you should see NMEA sentences)
  • Check permissions: sudo usermod -aG dialout $USER
  • Ensure baud rate matches your module

Position reads as 0.0:

  • GPS needs a clear sky view for initial fix (cold start can take 30-60 seconds)
  • Check gps_satellites — you need at least 4 for a 3D fix

Next Steps

  • System Metrics -- Monitor CPU, memory, and disk usage
  • Camera -- Stream video from USB and CSI cameras