1.0 Adafruit Ultimate GPS featherwing Overview
An overview of the GPS featherwing can be found here.
2.0 Diagram of GPS sensor and Adafruit Feather M0 WiFi connection
An example of a GPS micro-controller connection to Feather M0 is shown below.
- connect both feather M0 and GPS sensor to power and ground
- connect TX of GPS to RX of Feather M0
- connect RX of GPS to TX of Feather M0
Include the config.h and UCW_GPS libraries
Edit the config.h library
The struct, cfg, allows the user to provide access token for authentication, server address and port number, indicate if connection mode is secured and specify server connection medium (REST_API or MQTT)
In this example, connection to the UCW server is via a WiFi network. WiFi credentials (SSID and password) are provided here
Provide data stream name and device ID
device ID and data stream are defined in the main file
Create object for UCW_GPS.h library
connect() method is used to connect the micro-controller to the WiFi network. This is called in the void setup () section of the arduino file
printNetworkInfo() is called to print the details of the WiFi network that the micro-controller is connected to
setupGPS() method Initialise the GPS module, sets the update rate to 1Hz, surpresses the output to only RMC and GGA NMEA statements and activates updates of the GPS antenna
sys() method ensures the connection to the UCW cloud/server is still valid/established. This method is called in the void loop() section
The readGPS() method extracts relevant information from the NMEA statements received from the GPS sensor and returns the type gpsParams.
In this example, the latitude, longitude date, and time are extracted from the struct and saved as a JSON string gpsData
Sending the data
The data is sent to the server using the sendData() method
The full example can be found here.