gps - wolfen351/public-micropython-iot-platform GitHub Wiki

Overview

The GPS module provides functionality to parse GPS data from NMEA sentences, display telemetry, and interact with a map interface. It uses the MicropyGPS library for parsing and processes data through UART communication.

Features

  • Parses NMEA sentences (e.g., GPRMC, GPGGA, GPGLL, etc.) for GPS data.
  • Provides telemetry such as latitude, longitude, altitude, speed, course, and satellite information.
  • Displays GPS data on a web interface.
  • Includes a map interface to visualize the current location.
  • Supports logging of GPS data.

UI Panel

The GPS module includes a web-based UI panel defined in gps_index.html. This panel displays real-time GPS telemetry data and provides a button to access the map interface.

Panel Layout

  • Latitude: Displays the current latitude in decimal degrees.
  • Longitude: Displays the current longitude in decimal degrees.
  • Altitude: Displays the current altitude in meters.
  • Date/Time: Displays the current GPS date and time.
  • Satellites: Displays the number of satellites in use.
  • Speed: Displays the current speed in kilometers per hour and the course in degrees.
  • Accuracy: Displays the positional accuracy (PDOP).
  • Map Button: A button labeled "Map" that redirects to the /map route to display the current location on a map.

Map Interface

The map interface is defined in map.html and uses Google Maps to display the current GPS location. The map updates every second with the latest telemetry data fetched from the /telemetry endpoint.

Additional Information

  • The map interface is accessible via the /map route and displays the current location using Google Maps.
  • The GPS module is implemented in gps_control.py and uses the MicropyGPS library for parsing GPS data.
  • The web interface for telemetry is defined in gps_index.html, and the map interface is defined in map.html.

Hardware / Pinout Configuration

  • RX Pin: Configurable via gps.rxPin (default: 18).
  • TX Pin: Configurable via gps.txPin (default: 18).
  • UART communication is initialized at 9600 baud.

Telemetry Provided

  • latitude: Latitude in decimal degrees.
  • longitude: Longitude in decimal degrees.
  • altitude: Altitude in meters.
  • gpsdate: Current date in DD/MM/YYYY format.
  • gpstime: Current time in HH:MM:SS format.
  • satellites: Number of satellites in use.
  • course: Current course in degrees.
  • speed: Speed in kilometers per hour.
  • gpsaccuracy: Positional accuracy (PDOP).

Telemetry Consumed

None.

Commands Provided

None.

Commands Consumed

None.

Additional Information

  • The map interface is accessible via the /map route and displays the current location using Google Maps.
  • The GPS module is implemented in gps_control.py and uses the MicropyGPS library for parsing GPS data.
  • The web interface for telemetry is defined in gps_index.html, and the map interface is defined in map.html.
⚠️ **GitHub.com Fallback** ⚠️