API Reference
adafruit_ublox
CircuitPython Library for interfacing with u-blox GPS Modules
Author(s): Limor Fried/Ladyada
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_ublox.GPS_UBloxI2C(ddc: UBloxDDC, *, debug: bool = False)
GPS NMEA parsing for u-blox modules over I2C (DDC).
Subclasses
adafruit_gps.GPSto provide NMEA parsing, using aUBloxDDCinstance for I2C transport.
- class adafruit_ublox.UBloxDDC(i2c_bus: I2C, *, address: int = 0x42, timeout: float = 5.0)
I2C (DDC) transport for u-blox GPS modules.
- Parameters:
- class adafruit_ublox.UBloxUBX(stream, *, debug: bool = False)
UBX binary protocol engine for u-blox GPS modules.
- Parameters:
stream – Stream-like transport (UBloxDDC, busio.UART, or any object with
read(),write(), andin_waiting)debug (bool) – Enable debug output, default False
- property callback: Callable | None
Get/set callback for received UBX messages.
Callback signature:
callback(msg_class, msg_id, payload)where payload is a bytearray.
- check_messages() bool
Process available bytes through the UBX parser.
Reads bytes from the stream and feeds them through the state machine. Triggers the callback when a complete valid message is received.
- Returns:
True if a complete message was received
- Return type:
- send(msg_class: int, msg_id: int, payload: bytes = b'') bool
Send a UBX message.
Builds the complete frame with sync chars, header, payload, and checksum.
- send_with_ack(msg_class: int, msg_id: int, payload: bytes = b'', timeout: float = 0.5)
Send a UBX message and wait for ACK/NAK.
- set_nmea_output(enabled: set | None = None, *, timeout: float = 0.5)
Enable/disable individual NMEA sentences on the current port.