Skip to content

GPS

HaLOS Marine variants include gpsd, a GPS service daemon that provides location data to applications. gpsd multiplexes GPS data from one or more receivers to multiple clients, and is required by ubxtool for configuring u-blox GNSS receivers.

How it works

gpsd listens for GPS data from configured serial devices and USB receivers, and makes it available to clients via a TCP socket on port 2947. Applications connect to this socket using gpsd's JSON-based protocol.

By default, HaLOS Marine configures gpsd with:

  • No fixed serial devices — only USB auto-detection is enabled
  • USB auto-detection (USBAUTO=true) — USB GPS receivers are detected and added automatically when plugged in

On HALPI2, gpsd is additionally configured to use the GNSS HAT serial port (/dev/ttyAMA0). Any GNSS receiver HAT on this port will work. For u-blox receivers, HaLOS auto-configures the module for marine use on every boot (10 Hz update rate, Sea dynamic model, 115200 bps). This reconfiguration is necessary because ROM-based u-blox modules (such as the MAX-M8Q) have no flash memory — settings are stored in battery-backed RAM and may be lost on power cycles. The process is transparent and adds a few seconds to gpsd startup. See the HALPI2 GNSS documentation for details.

Accessing GPS data

Signal K connects to gpsd automatically and makes position data available through its API. No additional configuration is needed.

Command-line tools are available for diagnostics:

# Monitor GPS data in real-time (JSON)
gpsmon

# Output raw NMEA sentences
gpspipe -r

# Show current fix status
gpspipe -w | head -20

Note

gpsd uses its own JSON protocol, not raw NMEA. Use gpspipe -r if you need raw NMEA 0183 sentences.

Configuration

gpsd configuration is stored in /etc/default/gpsd. To add a serial GPS device:

# Edit gpsd defaults
sudo nano /etc/default/gpsd

# Change DEVICES to include your serial port, e.g.:
# DEVICES="/dev/ttyUSB0"

# Restart gpsd
sudo systemctl restart gpsd

USB GPS receivers

USB GPS receivers are detected automatically when plugged in, thanks to the USBAUTO=true setting. No configuration is needed — gpsd will start reading data from the receiver immediately.