The GpsReader provides a small hardware I/O interface for receiving GPS data from gpsd.
The module does not open a USB serial device directly. gpsd owns the physical GPS device, such as /dev/ttyACM0, and GpsReader connects to the gpsd service over TCP at 127.0.0.1:2947 by default.
This keeps USB device discovery and serial protocol handling outside the Python reader.
GpsData contains:
The has_fix property is true when gpsd reports either a 2D or 3D fix.
The reader only reports hardware data received from gpsd. Application-specific interpretation and behavior belong in higher-level components.
On Debian, Ubuntu, or Raspberry Pi OS:
Attach the USB GPS receiver to the Linux VM. Confirm that Linux created a serial device:
For the currently tested receiver, the device appears as:
The exact name is not guaranteed. Some receivers appear as /dev/ttyUSB0, and the number can change when devices are unplugged or reconnected.
Check which group owns the device:
If the device belongs to the dialout group and your user cannot read it:
Log out and back in after changing group membership.
A component-test helper launches gpsd in the foreground without changing the system-wide gpsd configuration.
From the project root:
The device argument is optional. It defaults to /dev/ttyACM0:
Keep this terminal open while testing. Press Ctrl+C to stop gpsd.
The deployed OpenRoadCode systemd unit also uses scripts/runtime/start_gpsd.sh, with the GPS device supplied through service configuration.
In another terminal, verify that gpsd is producing reports:
For a graphical or terminal client, depending on the installed package:
Seeing reports without a position is normal before the receiver acquires a fix. For the first fix, place the antenna where it has a clear view of the sky. A fix may take several minutes, and indoor testing is frequently an exercise in watching expensive silence.
With gpsd running, start the Python CLI from the project root:
Before a fix is available, the CLI reports that it is waiting and shows the visible and used satellite counts when gpsd provides them:
After a fix is acquired, the CLI prints the position and fix type:
Press Ctrl+C to stop the reader.
If the operating system's gpsd service is already configured for the GPS receiver, do not run the component-test launcher. Confirm the existing service instead:
Then verify its output: