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:

Software and Dependencies:

class adafruit_gps.GPS(uart, debug=False)[source]

GPS parsing module. Can parse simple NMEA data sentences from serial GPS modules to read latitude, longitude, and more.

datetime

Return struct_time object to feed rtc.set_time_source() function

has_3d_fix

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

has_fix

True if a current fix for location information is available.

in_waiting

Returns number of bytes available in UART read buffer

nmea_sentence

Return raw_sentence which is the raw NMEA sentence read from the GPS

read(num_bytes)[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()[source]

Returns a newline terminated bytearray, must have timeout set for the underlying UART or this will block forever!

send_command(command, add_checksum=True)[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!

update()[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.

write(bytestr)[source]

Write a bytestring data to the GPS directly, without parsing or checksums

class adafruit_gps.GPS_GtopI2C(i2c_bus, *, address=16, debug=False, timeout=5)[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.

in_waiting

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=1)[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()[source]

Returns a newline terminated bytearray, must have timeout set for the underlying UART or this will block forever!

write(bytestr)[source]

Write a bytestring data to the GPS directly, without parsing or checksums