### PUBX.ino Example (ublox Configuration) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md An example for ublox devices, likely focusing on configuring the device using specific PUBX messages or settings. It's a good starting point before using the binary protocol. ```arduino // PUBX.ino // This example is for ublox devices and focuses on configuration via PUBX messages. #include NMEAGPS gps; void setup() { Serial.begin(9600); Serial.println("NeoGPS PUBX.ino Example (ublox Configuration)"); } void loop() { // Process GPS data and potentially send configuration commands // if (gps.encode(gps_serial.read())) { // // Handle data or send PUBX commands // } } ``` -------------------------------- ### NMEAorder.ino Example Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md An example to verify device behavior, potentially related to the order of NMEA sentences or data processing. Recommended after verifying the base NMEA.ino example. ```arduino // NMEAorder.ino // This example is used to verify device behavior, possibly related to sentence ordering. // It builds upon the functionality of NMEA.ino. #include NMEAGPS gps; void setup() { Serial.begin(9600); Serial.println("NeoGPS NMEAorder Example"); } void loop() { // Process GPS data similar to NMEA.ino // if (gps.encode(gps_serial.read())) { // // Handle data // } } ``` -------------------------------- ### NMEA.ino Example Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md The primary NMEA example to verify GPS device connection and build process. It serves as a baseline for further testing and development. ```arduino // NMEA.ino // This is a placeholder for the actual NMEA.ino code. // It demonstrates basic NMEA sentence parsing and GPS data retrieval. #include #include // Define GPS serial port (e.g., SoftwareSerial or HardwareSerial) // NeoSWSerial gps_serial(rx_pin, tx_pin); NMEAGPS gps; void setup() { Serial.begin(9600); // gps_serial.begin(9600); Serial.println("NeoGPS NMEA Example"); } void loop() { // while (gps_serial.available() > 0) { // if (gps.encode(gps_serial.read())) { // displayInfo(); // } // } } // void displayInfo() { // if (gps.fix) { // Serial.print("Lat: "); Serial.print(gps.location.lat(), 6); // Serial.print(", Lon: "); Serial.println(gps.location.lng(), 6); // Serial.print("Altitude: "); Serial.print(gps.altitude.meters()); // Serial.println(" m"); // } // } ``` -------------------------------- ### ublox.ino Example (ublox Binary) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md An example for devices using the ublox binary protocol, offering specific ublox capabilities. This is recommended if standard NMEA parsing is insufficient. ```arduino // ublox.ino // This example demonstrates using the ublox binary protocol for enhanced device capabilities. #include #include // NeoSWSerial gps_serial(rx_pin, tx_pin); NMEAGPS gps; void setup() { Serial.begin(9600); // gps_serial.begin(9600); Serial.println("NeoGPS ublox.ino Example (Binary Protocol)"); } void loop() { // Process GPS data using ublox protocol encoding // if (gps.encode(gps_serial.read())) { // // Handle ublox specific data or standard NMEA data if available // } } ``` -------------------------------- ### NMEA.ino Example Output Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Sample output from the NMEA.ino example sketch after successful GPS device connection and data parsing. It shows status, UTC time, latitude, longitude, speed, and satellite information. ```text NMEA.INO: started fix object size = 31 gps object size = 84 Looking for GPS device on Serial1 GPS quiet time is assumed to begin after a RMC sentence is received. You should confirm this with NMEAorder.ino Status,UTC Date/Time,Lat,Lon,Hdg,Spd,Alt,Sats,Rx ok,Rx err,Rx chars, 3,2016-05-24 01:21:29.00,472852332,85652650,,138,,,1,0,66, 3,2016-05-24 01:21:30.00,472852311,85652653,,220,24040,7,9,0,557, 3,2016-05-24 01:21:31.00,472852315,85652647,,449,24080,7,17,0,1048, ``` -------------------------------- ### NMEAtimezone.ino Example Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Shows how to adjust the GPS time to your local time zone. This involves handling time zone offsets and potentially daylight saving time. ```arduino // NMEAtimezone.ino // This example demonstrates how to adjust GPS time to a local time zone. #include NMEAGPS gps; void setup() { Serial.begin(9600); Serial.println("NeoGPS NMEAtimezone Example"); } void loop() { // Process GPS data // if (gps.encode(gps_serial.read())) { // if (gps.date.isValid() && gps.time.isValid()) { // // Get UTC time // // Apply timezone offset and DST if needed // // Print local time // } // } } ``` -------------------------------- ### NeoGPS Library Manual Installation Structure Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Details the expected directory structure when manually installing the NeoGPS library by downloading the master ZIP file. This structure is crucial for the Arduino IDE to recognize the library correctly. ```text extras examples src library.properties LICENSE README.md ``` -------------------------------- ### NMEAloc.ino Example Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Demonstrates using only the location fields (latitude and longitude) from a GPS fix. This is useful for applications that primarily need positional data. ```arduino // NMEAloc.ino // This example focuses on extracting and using only the location (latitude, longitude) from GPS fixes. #include NMEAGPS gps; void setup() { Serial.begin(9600); Serial.println("NeoGPS NMEAloc Example"); } void loop() { // Process GPS data // if (gps.encode(gps_serial.read())) { // if (gps.fix) { // Serial.print("Current Location: Lat "); // Serial.print(gps.location.lat(), 6); // Serial.print(", Lon "); // Serial.println(gps.location.lng(), 6); // } // } } ``` -------------------------------- ### Custom GPSport.h for Serial Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Example configuration for GPSport.h to use the built-in 'Serial' port for both GPS communication and debug messages. This is a common and recommended setup. ```cpp #ifndef GPSport_h #define GPSport_h #define gpsPort Serial #define GPS_PORT_NAME "Serial" #define DEBUG_PORT Serial #endif ``` -------------------------------- ### Custom GPSport.h for AltSoftSerial Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Example configuration for GPSport.h to use 'AltSoftSerial' for GPS communication and 'Serial' for debug messages. This requires including the AltSoftSerial library. ```cpp #ifndef GPSport_h #define GPSport_h #include AltSoftSerial gpsPort; #define GPS_PORT_NAME "AltSoftSerial" #define DEBUG_PORT Serial #endif ``` -------------------------------- ### Default GPSport.h Includes Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Shows the default serial port library include options in GPSport.h. Users can uncomment one to select a specific serial port library for GPS communication. ```cpp #include // NeoSerial or NeoSerial1 for INTERRUPT_PROCESSING #include // <-- DEFAULT. Two specific pins required (see docs) #include // AltSoftSerial with Interrupt-style processing #include // Any pins, only @ 9600, 19200 or 38400 baud #include // NOT RECOMMENDED! ``` -------------------------------- ### NMEA_isr.ino Example (Interrupt Driven) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md An interrupt-driven version of NMEA.ino, designed for handling GPS characters during the RX character interrupt. Requires NeoHWSerial library for efficient interrupt handling. ```arduino // NMEA_isr.ino // This example uses interrupt handling for GPS data reception. // Requires NeoHWSerial library. #include #include // Use NeoHWSerial for interrupt-driven serial communication // NeoHWSerial gps_serial(rx_pin, tx_pin, 115200); NMEAGPS gps; void setup() { Serial.begin(9600); // gps_serial.begin(9600); Serial.println("NeoGPS NMEA_isr Example (Interrupt Driven)"); } void loop() { // The GPS data is processed in the ISR, so loop can be minimal. // You can check gps.fix or other flags here. // if (gps.fix) { // Serial.print("Lat: "); Serial.print(gps.location.lat(), 6); // Serial.print(", Lon: "); Serial.println(gps.location.lng(), 6); // } } // The GPS data encoding is typically handled within the NeoHWSerial ISR. // The NMEAGPS library automatically registers its handler. ``` -------------------------------- ### Serial Port Options for GPS Connection Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Summarizes the recommended serial port configurations for connecting GPS devices to Arduino boards, detailing the advantages and disadvantages of each option, including HardwareSerial, AltSoftSerial, NeoICSerial, and NeoSWSerial. ```text HardwareSerial (Serial, Serial1, Serial2, Serial3): BEST for speed and reliability. Requires disconnecting GPS TX from Arduino RX (pin 0) during uploads if using Serial. AltSoftSerial / NeoICSerial: 2nd Best option. Requires specific pins (e.g., 8 & 9 on UNO). Efficient, uses hardware TIMERs, may conflict with TIMER/PWM libraries. NeoSWSerial: 3rd Best option. Efficient, avoids SoftwareSerial timing issues. Does not need an extra TIMER, can be used with most libraries. Uses Pin Change Interrupts; coordination option available. Can be used alongside AltSoftSerial. SoftwareSerial: WORST option. Disables interrupts for long periods. Cannot transmit and receive simultaneously. Only one instance can receive at a time. ``` -------------------------------- ### NMEAblink Example (Sync, RMC) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md A minimal synchronous example that processes a single NMEA RMC sentence and blinks an LED. It serves as a basic entry point for library usage. ```arduino // Code for NMEAblink.ino would go here // This example focuses on sync, single fix, standard NMEA (RMC only), minimal. ``` -------------------------------- ### NeoSWSerial Pin Definitions Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Installing.md Defines the RX and TX pins for the NeoSWSerial library when it is uncommented in GPSport.h. These pins are used for GPS communication if NeoSWSerial is selected. ```cpp #define RX_PIN 4 #define TX_PIN 3 ``` -------------------------------- ### PUBX Example (Sync, NMEA + UBX) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Demonstrates synchronous operation with both standard NMEA sentences and proprietary ublox UBX binary protocol messages. It allows for more detailed device configuration and data. ```arduino // Code for PUBX.ino would go here // This example focuses on sync, coherent fix, standard NMEA + ublox proprietary NMEA. ``` -------------------------------- ### NMEAtimezone Example (Sync, RMC) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md This synchronous example, based on NMEAloc.ino, displays the local time instead of UTC (GMT). It requires accurate time data from the GPS. ```arduino // Code for NMEAtimezone.ino would go here // This example focuses on sync, single fix, displaying local time instead of UTC. ``` -------------------------------- ### ublox Example (Sync/Async, UBX) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Supports both synchronous and asynchronous operation using the ublox binary UBX protocol. This provides a coherent fix and access to advanced ublox features. ```arduino // Code for ublox.ino would go here // This example focuses on sync or async, coherent fix, ublox binary protocol UBX. ``` -------------------------------- ### NMEAlocDMS Example (Sync, RMC) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Similar to NMEAloc.ino, this synchronous example displays location data but formats it in Degrees, Minutes, and Seconds (DMS). ```arduino // Code for NMEAlocDMS.ino would go here // This example focuses on sync, single fix, displaying location in Degrees, Minutes, Seconds. ``` -------------------------------- ### NMEASDlog Example (Async, Buffered, RMC) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md An asynchronous example that buffers GPS fixes and logs them to an SD card. It's suitable for data logging applications where continuous recording is needed. ```arduino // Code for NMEASDlog.ino would go here // This example focuses on async, buffered fixes, standard NMEA (RMC only), logging to SD card. ``` -------------------------------- ### NMEAloc Example (Sync, RMC) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md A minimal synchronous example using only the standard NMEA RMC sentence to display location data. It's a straightforward demonstration of location retrieval. ```arduino // Code for NMEAloc.ino would go here // This example focuses on sync, single fix, minimal, using standard NMEA RMC. ``` -------------------------------- ### NMEA Example (Sync, RMC) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Demonstrates synchronous operation with single NMEA RMC sentence processing. This example is minimal and focuses on basic NMEA functionality. ```arduino // Code for NMEA.ino would go here // This example focuses on sync, single fix, standard NMEA (RMC only). ``` -------------------------------- ### NMEAaverage Example (Sync, RMC) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md This synchronous example demonstrates averaging high-accuracy location data over time. It's useful for applications requiring more stable position readings. ```arduino // Code for NMEAaverage.ino would go here // This example focuses on sync, single fix, averaging location over time. ``` -------------------------------- ### NMEAdiagnostic Output with LAST_SENTENCE_IN_INTERVAL Warning Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Example output from the NMEAdiagnostic sketch showing received NMEA sentences and a critical warning if the configured LAST_SENTENCE_IN_INTERVAL is not detected. This helps identify incorrect configuration. ```text NMEAdiagnostic.INO: started Looking for GPS device on Serial1 ____________________________ Checking 9600 baud... Received GSV Received GSV Received GLL Received RMC Received VTG Received GGA Received GSA Received GSV Received GSV Received GSV Received GLL Received RMC Received VTG Received GGA Received GSA Received GSV Received GSV Received GSV Received GLL Received RMC Received VTG **** NMEA sentence(s) detected! **** Received data: 47504753562C332C312C31312C30322C37302C3330322C32372C30352C33352C GPGSV,3,1,11,02,70,302,27,05,35, 3139372C32342C30362C34392C3035332C33312C30392C31372C3037332C3230 197,24,06,49,053,31,09,17,073,20 2A37360D0A2447504753562C332C322C31312C31322C35352C3236362C32352C *76..$GPGSV,3,2,11,12,55,266,25, Device baud rate is 9600 GPS data fields received: Status,UTC Date/Time,Lat,Lon,Hdg,Spd,Alt,Sats,Rx ok,Rx err,Rx chars, 3,2016-05-24 01:56:45.00,456013948,-720168555,,816,25450,7,21,0,1317, Warning: LAST_SENTENCE_IN_INTERVAL defined to be RMC, but was never received. Please use NMEAorder.ino to determine which sentences your GPS device sends, and then use the last one for the definition in NMEAGPS_cfg.h. ** NMEAdiagnostic completed ** 1 warnings ``` -------------------------------- ### NMEA: Initializing with No GPS Data Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Shows the initial output from NMEA.ino when the GPS device is not correctly connected. It displays object sizes and indicates no data is being received after the setup phase, suggesting potential wiring or serial port issues. ```text NMEA.INO: started fix object size = 31 gps object size = 84 Looking for GPS device on Serial1 GPS quiet time is assumed to begin after a GST sentence is received. You should confirm this with NMEAorder.ino Status,UTC Date/Time,Lat,Lon,Hdg,Spd,Alt,Sats,Rx ok,Rx err,Rx chars, ``` -------------------------------- ### NMEAorder Sentence Order Output Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Example output from the NMEAorder program, detailing the sequence of NMEA sentences received within a 1-second interval. This is crucial for understanding GPS fix timing and quiet time intervals. ```text NMEAorder.INO: started fix object size = 44 NMEAGPS object size = 72 Looking for GPS device on Serial1 ..................... Sentence order in each 1-second interval: RMC VTG GGA GSA GSV GSV GSV GSV GLL ``` -------------------------------- ### NMEA_isr Example (Async, RMC) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Demonstrates asynchronous operation using interrupts for single NMEA RMC sentence processing. This allows the main loop to perform other tasks while GPS data is handled. ```arduino // Code for NMEA_isr.ino would go here // This example focuses on async, single fix, standard NMEA (RMC only). ``` -------------------------------- ### Initialize NeoGPS Location_t Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Location.md Demonstrates how to create and initialize a NeoGPS::Location_t object using integer degrees multiplied by 10^7. This example shows setting coordinates for Madrid. ```cpp NeoGPS::Location_t madrid( 404381311L, -38196229L ); // see https://www.google.com/maps/@40.4381311,-3.8196229,6z ``` -------------------------------- ### NMEA.ino Output with Basic GPS Fix (Time/Status) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Example output from the NMEA sketch when the GPS device has acquired a basic fix, reporting status and UTC date/time. This signifies at least one satellite signal is being received. ```text Local time,Status,UTC Date/Time,Lat,Lon,Hdg,Spd,Alt,Sats,Rx ok,Rx err,Rx chars, 2015-09-14 15:07:30,1,2015-09-14 19:07:30.00,,,,,,3,0,259, 2015-09-14 15:07:31,1,2015-09-14 19:07:30.00,,,,,,3,0,521, ``` -------------------------------- ### Enable Pulse Per Day Output Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Configurations.md Configures example programs to display fix information once per day. This is an optional feature for reporting fix data frequency. ```cpp #define PULSE_PER_DAY ``` -------------------------------- ### Neogps Basic Usage Example Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Data Model.md Illustrates the fundamental usage pattern for the Neogps library, involving declaring a GPS object and reading completed fix structures. ```C++ NMEAGPS gps; gps_fix fix; // In your sketch loop: while (gps.available( cin )) { fix = gps.read(); // Process the 'fix' structure here // For example, check fix.valid.location for valid lat/lon } ``` -------------------------------- ### NMEA.ino Output with Poor GPS Reception (No Fix) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Example output from the NMEA sketch when the GPS device has no satellite fix, showing empty fields for location and time. It indicates issues with satellite signal acquisition. ```text Local time,Status,UTC Date/Time,Lat,Lon,Hdg,Spd,Alt,Sats,Rx ok,Rx err,Rx chars, ,0,,,,,,,3,0,259, ,0,,,,,,,6,0,521, ``` -------------------------------- ### NMEAdiagnostic Output Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Diagnostic output from the NMEAdiagnostic program, showing the process of detecting GPS sentences and identifying the correct baud rate. It helps troubleshoot connection issues. ```text NMEAdiagnostic: started Looking for GPS device on Serial1 ..................... Sentences detected on Serial1 at 9600 baud. ``` -------------------------------- ### NMEA.ino Output with Advanced GPS Fix (Lat/Lon/Alt/Sats) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Example output from the NMEA sketch when the GPS device has acquired sufficient satellite signals to report latitude, longitude, altitude, and satellite count. It also shows detailed satellite information when enabled. ```text Local time,Status,UTC Date/Time,Lat,Lon,Hdg,Spd,Alt,HDOP,VDOP,PDOP,Lat err,Lon err,Alt err,Sats,[sat elev/az @ SNR],Rx ok,Rx err,Rx chars, 2015-09-14 16:03:07,3,2015-09-14 20:03:07.00,,,,,,,,,,,,2,[2 71/27@14,5 65/197@33,],8,0,476, 2015-09-14 16:03:08,3,2015-09-14 20:03:08.00,,,,,,,,,,,,2,[2 71/27@14,5 65/197@33,],16,0,952, ``` -------------------------------- ### NeoGPS NMEA Benchmark Program Output Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Displays the execution times in microseconds for parsing various NMEA sentences (GGA, RMC, GSV) using the NMEAbenchmark program. This benchmark helps evaluate the performance of the NeoGPS library's parsing functions. ```Arduino C++ NMEAbenchmark: started fix object size = 22 NMEAGPS object size = 29 GGA time = 844 GGA no lat time = 497 ``` -------------------------------- ### Enable Floating-Point Output (Streamers.cpp) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Configurations.md Enables floating-point output formatting within the `Streamers.cpp` file, which is used by example programs for displaying GPS fix data. This is local to the streamers file and not required for core parsing. ```cpp #define USE_FLOAT ``` -------------------------------- ### Configure LAST_SENTENCE_IN_INTERVAL in NMEAGPS_cfg.h Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Illustrates how to set the LAST_SENTENCE_IN_INTERVAL macro in the NMEAGPS_cfg.h file. This configuration is crucial for correctly identifying GPS data intervals and quiet times. ```c++ #define LAST_SENTENCE_IN_INTERVAL NMEAGPS::NMEA_GLL ``` -------------------------------- ### Configure Device Baudrate with ublox UBX Command Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Extending.md Send proprietary commands to your GPS device to configure settings like baudrate. This example demonstrates sending a ublox-specific UBX command using the `send_P` method. ```Arduino gps.send_P( F("PUBX,41,1,0007,0003,19200,0") ); ``` -------------------------------- ### NeoGPS NMEA Self-Test Program Output Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Examples.md Demonstrates the output of the NMEAtest program, which validates NMEA sentence parsing using PROGMEM character arrays. It shows sample inputs and the corresponding parsed results, confirming correct configuration and functionality without a GPS device. ```Arduino C++ NMEA test: started fix object size = 44 NMEAGPS object size = 72 Test string length = 75 PASSED 11 tests. ------ Samples ------ Results format: Status,UTC Date/Time,Lat,Lon,Hdg,Spd,Alt,HDOP,VDOP,PDOP,Lat err,Lon err,Alt err,Sats,[sat], Input: $GPGGA,092725.00,4717.11399,N,00833.91590,E,1,8,1.01,499.6,M,48.0,M,,0*5B Results: 3,2000-01-01 09:27:25.00,472852332,85652650,,,49960,1010,,,,,,8,[], Input: $GPRMC,092725.00,A,2520.69213,S,13101.94948,E,0.004,77.52,091202,,,A*43 Results: 3,2002-12-09 09:27:25.00,-253448688,1310324913,7752,4,,,,,,,,,[], Input: $GPRMC,162254.00,A,3647.6643,N,8957.5193,W,0.820,188.36,110706,,,A*49 Results: 3,2006-07-11 16:22:54.00,367944050,-899586550,18836,820,,,,,,,,,[], Input: $GPRMC,235959.99,A,2149.65726,N,16014.69256,W,8.690,359.99,051015,9.47,E,A*26 Results: 3,2015-10-05 23:59:59.99,218276210,-1602448760,35999,8690,,,,,,,,,[], Input: $GNGLL,0105.60764,S,03701.70233,E,225627.00,A,A*6B Results: 3,2000-01-01 22:56:27.00,-10934607,370283722,,,,,,,,,,,[], Input: $GPGGA,064951.000,2307.1256,N,12016.4438,E,1,8,0.95,39.9,M,17.8,M,,*63 Results: 3,2000-01-01 06:49:51.00,231187600,1202740633,,,3990,950,,,,,,8,[], Input: $GPRMC,064951.000,A,2307.1256,N,12016.4438,E,0.03,165.48,260406,3.05,W,A*2C Results: 3,2006-04-26 06:49:51.00,231187600,1202740633,16548,30,,,,,,,,,[], Input: $GPVTG,165.48,T,,M,0.03,N,0.06,K,A*36 Results: 3,,,,16548,30,,,,,,,,,[], Input: $GPGSA,A,3,29,21,26,15,18,09,06,10,,,,,2.32,0.95,2.11*00 Results: 3,,,,,,,950,,2320,,,,,[], Input: $GPGSV,3,1,09,29,36,029,42,21,46,314,43,26,44,020,43,15,21,321,39*7D Results: ,,,,,,,,,,,,,9,[29,21,26,15,], Input: $GPGSV,3,2,09,18,26,314,40,09,57,170,44,06,20,229,37,10,26,084,37*77 Results: ,,,,,,,,,,,,,9,[29,21,26,15,18,9,6,10,], Input: $GPGSV,3,3,09,07,,,26*73 Results: ,,,,,,,,,,,,,9,[29,21,26,15,18,9,6,10,7,], Input: $GNGST,082356.00,1.8,,,,1.7,1.3,2.2*60 Results: ,2000-01-01 08:23:56.00,,,,,,,,,170,130,,,[29,21,26,15,18,9,6,10,7,], Input: $GNRMC,083559.00,A,4717.11437,N,00833.91522,E,0.004,77.52,091202,,,A,V*33 Results: 3,2002-12-09 08:35:59.00,472852395,85652537,7752,4,,,,,,,,,[29,21,26,15,18,9,6,10,7,], Input: $GNGGA,092725.00,4717.11399,N,00833.91590,E,1,08,1.01,499.6,M,48.0,M,,*45 Results: 3,2000-01-01 09:27:25.00,472852332,85652650,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,], Input: $GLZDA,225627.00,21,09,2015,00,00*70 Results: ,2015-09-21 22:56:27.00,,,,,,,,,,,,,[29,21,26,15,18,9,6,10,7,], --- floating point conversion tests --- Input: $GPGGA,092725.00,3242.9000,N,11705.8169,W,1,8,1.01,499.6,M,48.0,M,,0*49 Results: 3,2000-01-01 09:27:25.00,327150000,-1170969483,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,], Input: $GPGGA,092725.00,3242.9000,N,11705.8170,W,1,8,1.01,499.6,M,48.0,M,,0*41 Results: 3,2000-01-01 09:27:25.00,327150000,-1170969500,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,], Input: $GPGGA,092725.00,3242.9000,N,11705.8171,W,1,8,1.01,499.6,M,48.0,M,,0*40 Results: 3,2000-01-01 09:27:25.00,327150000,-1170969517,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,], Input: $GPGGA,092725.00,3242.9000,N,11705.8172,W,1,8,1.01,499.6,M,48.0,M,,0*43 Results: 3,2000-01-01 09:27:25.00,327150000,-1170969533,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,], Input: $GPGGA,092725.00,3242.9000,N,11705.8173,W,1,8,1.01,499.6,M,48.0,M,,0*42 Results: 3,2000-01-01 09:27:25.00,327150000,-1170969550,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,], Input: $GPGGA,092725.00,3242.9000,N,11705.8174,W,1,8,1.01,499.6,M,48.0,M,,0*45 Results: 3,2000-01-01 09:27:25.00,327150000,-1170969567,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,], Input: $GPGGA,092725.00,3242.9000,N,11705.8175,W,1,8,1.01,499.6,M,48.0,M,,0*44 Results: 3,2000-01-01 09:27:25.00,327150000,-1170969583,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,], Input: $GPGGA,092725.00,3242.9000,N,11705.8176,W,1,8,1.01,499.6,M,48.0,M,,0*47 Results: 3,2000-01-01 09:27:25.00,327150000,-1170969600,,,49960,1010,,,,,,8,[29,21,26,15,18,9,6,10,7,] ``` -------------------------------- ### Access Date/Time Data Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Data Model.md Provides an example of accessing date components, specifically the month, from the `dateTime` member of the `gps_fix` structure for conditional logic. ```C++ if (fix_copy.dateTime.month == 4) // test for the cruelest month cry(); ``` -------------------------------- ### Enable GPS Fix and NMEA Sentence Parsing in NMEAGPS_cfg.h Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Configuration directives for the NMEAGPS library to enable detailed GPS fix information and parsing of specific NMEA sentences like GGA, GSA, GSV, and satellite data. ```c++ #define GPS_FIX_SATELLITES #define NMEAGPS_PARSE_GGA #define NMEAGPS_PARSE_GSA #define NMEAGPS_PARSE_GSV #define NMEAGPS_PARSE_SATELLITES #define NMEAGPS_PARSE_SATELLITE_INFO #define NMEAGPS_MAX_SATELLITES (20) ``` -------------------------------- ### Example NMEA GPS Sentences Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Performance.md This snippet displays common NMEA sentences ($GPGGA, $GPRMC, $GPGSV) used by GPS receivers to transmit location, time, and satellite data. These sentences are parsed by libraries like NeoGPS. ```NMEA $GPGGA,092725.00,4717.11399,N,00833.91590,E,1,8,1.01,499.6,M,48.0,M,,0*5B $GPRMC,083559.00,A,4717.11437,N,00833.91522,E,0.004,77.52,091202,,,A*57 $GPGSV,3,1,10,23,38,230,44,29,71,156,47,07,29,116,41,08,09,081,36*7F $GPGSV,3,2,10,10,07,189,,05,05,220,,09,34,274,42,18,25,309,44*72 $GPGSV,3,3,10,26,82,187,47,28,43,056,46*77 ``` -------------------------------- ### NeoXXSerial Libraries for Interrupt-Driven GPS Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Details the different NeoXXSerial libraries available for implementing interrupt-driven GPS data handling. These libraries facilitate attaching interrupt handlers to GPS serial ports, enabling efficient data decoding and buffering without blocking the main loop. ```APIDOC NeoXXSerial Libraries: - NeoHWSerial: - Use when the GPS device is connected to the hardware serial ports (Serial or Serial1). - Enables interrupt handling for these specific hardware serial interfaces. - NeoICSerial: - Use when the Input Capture pin can be connected to the GPS device, typically required for AltSoftSerial compatibility. - Provides interrupt-driven serial communication via the input capture pin. - NeoSWSerial: - Use for connecting the GPS device to any pair of digital pins when hardware serial or input capture pins are not available. - Supports interrupt-driven serial communication on software-defined pins. - Note: Supports a limited number of baud rates. ``` -------------------------------- ### Minimal Configuration GPS Data Reading (C++) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/RAM.md Demonstrates how to read GPS data with a minimal NeoGPS configuration. This setup prioritizes low RAM usage by parsing no sentence types and storing no data members, focusing only on status updates. It shows the basic loop for checking GPS availability and reading a fix. ```C++ while (gps.available( gpsPort )) { gps_fix nothingButStatus = gps.read(); sentenceReceived(); } ``` -------------------------------- ### Neogps Time and Epoch Configuration Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Data Model.md Explains how to configure the library's time operations by setting custom epochs. Users can change static members in Time.h to base date/time operations on different starting points like NTP or POSIX. ```APIDOC Time Operations and Epochs: Time operations allow converting to and from total seconds offset from a de facto starting time (e.g., an epoch date/time "origin"). Configuration: - Modify `static` members `s_epoch_year` and `s_epoch_weekday` in `Time.h`. - All date/time operations will be based on the newly set epoch. - This does not affect GPS times but allows conversion to/from NTP or POSIX time values (seconds). Example Use Case: - Convert GPS time (UTC) into local time by converting to seconds from the epoch, adding the time zone offset in seconds, and converting back to a time structure. Related Files: - `Time.h`: Contains epoch configuration constants and settings. - `/examples/NMEAtimezone/NMEAtimezone.ino`: Example program demonstrating timezone conversion. ``` -------------------------------- ### Enable Satellite Parsing (C++) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Enables the parsing of satellite information, allowing access to data like the number of satellites used in the fix. This requires enabling the GPS_FIX_SATELLITES configuration option to ensure the necessary data structures are available. ```C++ // To enable parsing of satellite information: // #define NMEAGPS_PARSE_SATELLITES // #define GPS_FIX_SATELLITES // Example of accessing satellite count: // if (gps.fix.valid.satellites) { // Serial.print("Satellites: "); // Serial.println(gps.satellites.size()); // } ``` -------------------------------- ### NeoGPS Data Handling and Quiet Time Processing Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md This entry documents the core NeoGPS library functions and concepts for managing GPS data and performing operations during designated quiet times. It covers data parsing, storage, and execution of slow operations. ```APIDOC NeoGPS Library Usage Pattern: Restructure `loop()` to perform time-consuming operations during GPS quiet time. Core Concepts: - **Data Holding**: Store GPS information (date, time, location, sensor data) until the quiet time. - **Quiet Time Execution**: Perform blocking operations (e.g., `SD.write`) during the quiet interval to avoid losing GPS data. - **`fix` Structure**: NeoGPS uses a `fix` structure that is populated as characters are received, copied/merged when a sentence is complete, and can be used anytime or during quiet time. - **Incremental Parsing**: Parsing is spread across character receipt, not requiring a separate call after a complete sentence. Key Functions/Methods: `gps.available()` - Checks if a complete GPS sentence is available. - Returns: `true` if a sentence is ready, `false` otherwise. `gps.decode(char c)` - Processes a single character received from the GPS device. - Parameters: - `c`: The character to decode. - Returns: A status code indicating the decoding progress (e.g., `DECODE_COMPLETED` when a sentence is fully processed). `gps.fix` (Structure/Object) - Holds the parsed GPS data (date, time, location, etc.). - Populated incrementally by `gps.decode()`. - Can be accessed for fast operations or copied/merged for use during quiet time. `SD.write(data)` (Example of a slow operation) - Writes data to an SD card. - This is an example of a blocking operation that should be performed during GPS quiet time. `LAST_SENTENCE_IN_INTERVAL` (Constant/Flag) - Used to watch for a specific message completion to begin processing, potentially losing characters from subsequent sentences if they are not necessary. ``` -------------------------------- ### Enable UTC Sub-second Resolution via Interval Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Configurations.md This option enables the calculation of UTC time with sub-second accuracy by using the start of the GPS update interval as a timestamp. The timestamp is set when the first character of a new batch of sentences arrives, providing a nearly constant delay from the PPS edge. ```c++ #define NMEAGPS_TIMESTAMP_FROM_INTERVAL ``` -------------------------------- ### Access Altitude Data (Centimeters and Meters) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Data Model.md Demonstrates accessing altitude data from the `gps_fix` structure. It shows how to get the altitude in centimeters (`altitude_cm()`) and as a whole number of meters (`alt.whole`). ```C++ if (fix_copy.valid.altitude) { z2 = fix_copy.altitude_cm(); vz = (z2 - z1) / dt; z1 = z2; // Note: if you only care about meters, you could also do this: // z = fix_copy.alt.whole; } ``` -------------------------------- ### Enable GGA Sentence for Altitude (C++) Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Ensures that the GGA NMEA sentence is parsed by the NeoGPS library. The GGA sentence is the primary source for altitude data. If NMEA_PARSE_GGA is not defined, altitude members will not be populated even if a GGA sentence is received. ```C++ // To enable parsing of the GGA sentence for altitude: // #define NMEA_PARSE_GGA // Example of checking if altitude is valid after decoding: // if (gps.fix.valid.altitude) { // Serial.print("Altitude: "); // Serial.println(gps.fix.altitude); // } ``` -------------------------------- ### NMEA: Empty Data with Wrong Baud Rate Source: https://github.com/slashdevin/neogps/blob/master/extras/doc/Troubleshooting.md Displays the output from NMEA.ino when it's configured with the wrong baud rate for the GPS device. It shows increasing received character counts but zero successful message decodes (Rx ok), indicating a baud rate mismatch. ```text Local time,Status,UTC Date/Time,Lat,Lon,Hdg,Spd,Alt,HDOP,Rx ok,Rx err,Rx chars, ,,,,,,,,0,3,181, ,,,,,,,,0,1,422, ```