adafruit_gps
GPS parsing module. Can parse simple NMEA data sentences from serial GPS modules to read latitude, longitude, and more.
Author(s): Tony DiCola, James Carr
Implementation Notes
Hardware:
Adafruit Ultimate GPS Breakout
Adafruit Ultimate GPS FeatherWing
Software and Dependencies:
Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: https://github.com/adafruit/circuitpython/releases
- class adafruit_gps.GPS(uart: UART, debug: bool = False)[source]
GPS parsing module. Can parse simple NMEA data sentences from serial GPS modules to read latitude, longitude, and more.
- altitude_m
Antenna altitude relative to mean sea level
- property datetime: struct_time | None
Return struct_time object to feed rtc.set_time_source() function
- debug
Toggles debug mode. When True, prints the incoming data sentence to the console
- fix_quality
GPS quality indicator
0 - fix not available1 - GPS fix2 - Differential GPS fix (values above 2 are 2.3 features)3 - PPS fix4 - Real Time Kinematic5 - Float RTK6 - estimated (dead reckoning)7 - Manual input mode8 - Simulation mode
- fix_quality_3d
The type of fix for a reading
1 - no fix2 - 2D fix3 - 3D fix
- property has_3d_fix: bool
Returns true if there is a 3d fix available. use has_fix to determine if a 2d fix is available, passing it the same data
- hdop
Horizontal dilution of precision (GSA)
- height_geoid
Geoidal separation relative to WGS 84
- horizontal_dilution
Horizontal dilution of precision (GGA)
- isactivedata
Status Valid(A) or Invalid(V)
- latitude
Degrees latitude
- latitude_degrees
Degrees component of latitude measurement
- latitude_minutes
Minutes component of latitude measurement
- longitude
Degrees longitude
- longitude_degrees
Degrees component of longitude measurement
- longitude_minutes
Minutes component of longitude measurement
- mess_num
Message number
- property nmea_sentence: str | None
Return raw_sentence which is the raw NMEA sentence read from the GPS
- pdop
Dilution of precision
- read(num_bytes: int | None) bytes | None [source]
Read up to num_bytes of data from the GPS directly, without parsing. Returns a bytestring with up to num_bytes or None if nothing was read
- readline() bytes | None [source]
Returns a newline terminated bytestring, must have timeout set for the underlying UART or this will block forever!
- sat_prns
Satellite pseudorandom noise code
- satellites
The number of satellites in use, 0 - 12
- satellites_prev
The number of satellites in use from the previous data point, 0 - 12
- sats
Information from GSV messages
- sel_mode
Selection mode
‘M’ - manual‘A’ - automatic
- send_command(command: bytes, add_checksum: bool = True) None [source]
Send a command string to the GPS. If add_checksum is True (the default) a NMEA checksum will automatically be computed and added. Note you should NOT add the leading $ and trailing * to the command as they will automatically be added!
- speed_knots
Ground speed in knots
- timestamp_utc
Timestamp in UTC
- total_mess_num
Number of messages
- track_angle_deg
Track angle in degrees
- update() bool [source]
Check for updated data from the GPS module and process it accordingly. Returns True if new data was processed, and False if nothing new was received.
- vdop
Vertical dilution of precision
- write(bytestr: array | bytearray | bytes | memoryview | rgbmatrix.RGBMatrix | ulab.numpy.ndarray) int | None [source]
Write a bytestring data to the GPS directly, without parsing or checksums
- class adafruit_gps.GPS_GtopI2C(i2c_bus: I2C, *, address: int = 16, debug: bool = False, timeout: float = 5.0)[source]
GTop-compatible I2C GPS parsing module. Can parse simple NMEA data sentences from an I2C-capable GPS module to read latitude, longitude, and more.
- property in_waiting: Literal[16]
Returns number of bytes available in UART read buffer, always 16 since I2C does not have the ability to know how much data is available
- read(num_bytes: int = 1) bytearray [source]
Read up to num_bytes of data from the GPS directly, without parsing. Returns a bytearray with up to num_bytes or None if nothing was read
- readline() bytearray | None [source]
Returns a newline terminated bytearray, must have timeout set for the underlying UART or this will block forever!
- write(bytestr: array | bytearray | bytes | memoryview | rgbmatrix.RGBMatrix | ulab.numpy.ndarray) None [source]
Write a bytestring data to the GPS directly, without parsing or checksums