Giter Site home page Giter Site logo

neogps's Introduction

NeoGPS

This fully-configurable Arduino library uses minimal RAM, PROGMEM and CPU time, requiring as few as 10 bytes of RAM, 866 bytes of PROGMEM, and less than 1mS of CPU time per sentence.

It supports the following protocols and messages:

NMEA 0183

  • GPGGA - System fix data
  • GPGLL - Geographic Latitude and Longitude
  • GPGSA - DOP and active satellites
  • GPGST - Pseudo Range Error Statistics
  • GPGSV - Satellites in View
  • GPRMC - Recommended Minimum specific GPS/Transit data
  • GPVTG - Course over ground and Ground speed
  • GPZDA - UTC Time and Date

The "GP" prefix usually indicates an original GPS source. NeoGPS parses all Talker IDs, including

This means that GLRMC, GBRMC or BDRMC, GARMC and GNRMC from the latest GPS devices (e.g., ublox M8N) will also be correctly parsed. See discussion of Talker IDs in Configurations.

Most applications can be fully implemented with the standard NMEA messages above. They are supported by almost all GPS manufacturers. Additional messages can be added through derived classes (see ublox and Garmin sections below).

Most applications will use this simple, familiar loop structure:

NMEAGPS gps;
gps_fix fix;

void loop()
{
  while (gps.available( gps_port )) {
    fix = gps.read();
    doSomeWork( fix );
  }
}

For more information on this loop, see the Usage section on the Data Model page.

(This is the plain Arduino version of the CosaGPS library for Cosa.)

Goals

In an attempt to be reusable in a variety of different programming styles, this library supports:

  • resource-constrained environments (e.g., ATTINY targets)
  • sync or async operation (reading in loop() vs interrupt processing)
  • event or polling (deferred handling vs. continuous calls in loop())
  • coherent fixes (merged from multiple sentences) vs. individual sentences
  • optional buffering of fixes
  • optional floating point
  • configurable message sets, including hooks for implementing proprietary NMEA messages
  • configurable message fields
  • multiple protocols from same device
  • any kind of input stream (Serial, NeoSWSerial, I2C, PROGMEM arrays, etc.)

Inconceivable!

Don't believe it? Check out these detailed sections:

Section Description
License The Fine Print
Installing Copying files
Data Model How to parse and use GPS data
Configurations Tailoring NeoGPS to your needs
Performance 37% to 72% faster! Really!
RAM requirements Doing it without buffers!
Program Space requirements Making it fit
Examples Programming styles
Troubleshooting Troubleshooting
Extending NeoGPS Using specific devices
ublox ublox-specific code
Garmin Garmin-specific code
Tradeoffs Comparing to other libraries
Acknowledgements Thanks!

neogps's People

Contributors

close2 avatar flokas avatar paulstoffregen avatar per1234 avatar slashdevin avatar sle118 avatar yngndrw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neogps's Issues

SBAS for better accuracy

Hi SlashDevin!
I would like to know, how to get the SBAS(WASS, EGNO...) information. I haven't being able to find a way to do it in your libraries.
Thanks in advance

License?

There is no global mention of the license for this project.
Some files contain an LGPL header but since this is targeted at embedded systems without any shared library functionality that doesn't really make sense.

Problems with example

#include <NeoTeeStream.h> and #include <NeoSWSerial.h> are both not in the download and therefor not working. Where can i find these libs, or can they be uploaded with the rest. This will help me a lot, cause i cant seem to configure my TINY RTK neo m8p through u-blox. Many thanks.

p.s. forgot to say it was about example rate.

How to measure distance between two changing locations

Am I correct in thinking that the distance measuring function can only work to calculate the distance from the current to a location setup in the variable declared before void setup? I'd like to "save" a location at some point in my program, and then at a later stage measure the distance traveled from that point. This location will be changed by the user multiple times. And I'm sorry if this shouldn't be requested here, but I can't find a help or ask a question button anywhere.

ESP8266 Compile error

Hi, so i tried to compile one of the examples to work with a nodeMCU ESP8266 board, but it failed. Is there a way to make this lib compatibile with this board?

No option for UBX-NAV-DOP message in ubx.h/.cpp/ubxCFG.config

Think I figured out the issue based on your comments in issue #11. Since I am running the ublox.ino example it uses the ubxGPS.cpp to parse the UBX messages (I can it commands previously) so I checked the ubxCFG file and ubxGPS.h/.cpp and there is no parsing option for the UBX-NAV-DOP message that contains those fields

Advice wanted on using Neo6m GPS effciently

We are investigating how to use our GPS Neo6m module to be as least time-consuming as possible in the following situation..

Our GPS is used for the following:

  • Activate an indicator on a Nextion display when a valid fix is made (2 - 5 min interval would be acceptable)
  • Log movement on a 1 to 30 seconds interval

This GPS functionality is part of a larger project of sensors (timed and interrupt driver) and activators, so every ms we spare on te GPS handling is welcome. We are wondering what would be the best way to achieve this, effectively ignoring all the data the gps is sending between "polling" intervals.

We though about using the interrupts mode of NeoGPS but wouldn't the interrupt handling still take time to process messages from the GPS when we are not really interested in the results?

Any advice is welcome!

Using NeoGPS to evaluate Data

Hey,

For analysing purposes, I would like to use NeoGPS on a Windows environment to read in NMEA messages send per serial to my windows laptop. Then I would like to use NeoGPS to write e.g. all the values of only the GPGGA message sentence in different columns of a .txt file.
I will later use this file and copy its values into a exel file and then I hope I will be able to plot these values.

Is it possible to use NeoGPS just on Windows?

Thanks for your help.

Power management?

Is there any way I can use this library to shift the GPS into low power mode?

I2C Input stream

I can't find any reference to using an i2c in the documentation or code. Is the feature implemented? if so how should I start?

Ublox.ino compile errors on Mega 2560

Getting the following errors during compile:

Arduino: 1.6.10 (Windows 10), TD: 1.30-beta3, Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\ubxGPS.cpp: In member function 'bool ubloxGPS::parseNavPosLLH(uint8_t)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\ubxGPS.cpp:597:11: error: 'U1' was not declared in this scope

       U1[ chrCount-20 ] = chr;

       ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\ubxGPS.cpp:599:31: error: 'U4' was not declared in this scope

         uint16_t err_cm = U4/100;

                           ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\ubxGPS.cpp:620:32: error: 'U4' was not declared in this scope

         m_fix.alt_err_cm = U4/100;

                            ^

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

Not sure if it is me or there is an error in the lib. I did change the beginning part of the sketch since I am using Serial2

#include <Arduino.h>
#include "ubxGPS.h"

//======================================================================
//  Program: ublox.ino
//
//  Prerequisites:
//     1) You have a ublox GPS device
//     2) PUBX.ino works with your device
//     3) You have installed the ubxGPS.* and ubxmsg.* files.
//     4) At least one UBX message has been enabled in ubxGPS.h.
//     5) Implicit Merging is disabled in NMEAGPS_cfg.h.
//
//  Description:  This program parses UBX binary protocal messages from
//     ublox devices.  It shows how to acquire the information necessary
//     to use the GPS Time-Of-Week in many UBX messages.  As an offset
//     from midnight Sunday morning (GPS time), you also need the current 
//     UTC time (this is *not* GPS time) and the current number of GPS 
//     leap seconds.
//
//  Serial is for debug output to the Serial Monitor window.
//
//======================================================================

    #include <NeoHWSerial.h>



#include "Streamers.h"

  #define DEBUG_PORT NeoSerial
#define gps_port NeoSerial2

//------------------------------------------------------------
// Check that the config files are set up properly

#if !defined(UBLOX_PARSE_STATUS) & !defined(UBLOX_PARSE_TIMEGPS) & \
    !defined(UBLOX_PARSE_TIMEUTC) & !defined(UBLOX_PARSE_POSLLH) & \
    !defined(UBLOX_PARSE_VELNED) & !defined(UBLOX_PARSE_SVINFO)

  #error No UBX binary messages enabled: no fix data available for fusing.

#endif

//-----------------------------------------------------------------
//  Derive a class to add the state machine for starting up:
//    1) The status must change to something other than NONE.
//    2) The GPS leap seconds must be received
//    3) The UTC time must be received
//    4) All configured messages are "requested"
//         (i.e., "enabled" in the ublox device)
//  Then, all configured messages are parsed and explicitly merged.

class MyGPS : public ubloxGPS
{
public:

    enum
      {
        GETTING_STATUS, 
        GETTING_LEAP_SECONDS, 
        GETTING_UTC, 
        RUNNING
      }
        state NEOGPS_BF(8);

    MyGPS( Stream *device ) : ubloxGPS( device )
    {
      state = GETTING_STATUS;
    }

    //--------------------------

    void get_status()
    {
      static bool acquiring = false;

      if (fix().status == gps_fix::STATUS_NONE) {
        static uint32_t dotPrint;
        bool            requestNavStatus = false;

        if (!acquiring) {
          acquiring = true;
          dotPrint = millis();
          DEBUG_PORT.print( F("Acquiring...") );
          requestNavStatus = true;

        } else if (millis() - dotPrint > 1000UL) {
          dotPrint = millis();
          DEBUG_PORT << '.';

          static uint8_t requestPeriod;
          if ((++requestPeriod & 0x07) == 0)
            requestNavStatus = true;
        }

        if (requestNavStatus)
          // Turn on the UBX status message
          enable_msg( ublox::UBX_NAV, ublox::UBX_NAV_STATUS );

      } else {
        if (acquiring)
          DEBUG_PORT << '\n';
        DEBUG_PORT << F("Acquired status: ") << (uint8_t) fix().status << '\n';

        #if defined(GPS_FIX_TIME) & defined(GPS_FIX_DATE) & \
            defined(UBLOX_PARSE_TIMEGPS)

          if (!enable_msg( ublox::UBX_NAV, ublox::UBX_NAV_TIMEGPS ))
            DEBUG_PORT.print( F("enable TIMEGPS failed!\n") );

          state = GETTING_LEAP_SECONDS;
        #else
          start_running();
          state = RUNNING;
        #endif
      }
    } // get_status

    //--------------------------

    void get_leap_seconds()
    {
      #if defined(GPS_FIX_TIME) & defined(GPS_FIX_DATE) & \
          defined(UBLOX_PARSE_TIMEGPS)

        if (GPSTime::leap_seconds != 0) {
          DEBUG_PORT << F("Acquired leap seconds: ") << GPSTime::leap_seconds << '\n';

          if (!disable_msg( ublox::UBX_NAV, ublox::UBX_NAV_TIMEGPS ))
            DEBUG_PORT.print( F("disable TIMEGPS failed!\n") );

          #if defined(UBLOX_PARSE_TIMEUTC)
            if (!enable_msg( ublox::UBX_NAV, ublox::UBX_NAV_TIMEUTC ))
              DEBUG_PORT.print( F("enable TIMEUTC failed!\n") );
            state = GETTING_UTC;
          #else
            start_running();
          #endif
        }
      #endif

    } // get_leap_seconds

    //--------------------------

    void get_utc()
    {
      #if defined(GPS_FIX_TIME) & defined(GPS_FIX_DATE) & \
          defined(UBLOX_PARSE_TIMEUTC)

        lock();
          bool            safe = is_safe();
          NeoGPS::clock_t sow  = GPSTime::start_of_week();
          NeoGPS::time_t  utc  = fix().dateTime;
        unlock();

        if (safe && (sow != 0)) {
          DEBUG_PORT << F("Acquired UTC: ") << utc << '\n';
          DEBUG_PORT << F("Acquired Start-of-Week: ") << sow << '\n';

          start_running();
        }
      #endif

    } // get_utc

    //--------------------------

    void start_running()
    {
      bool enabled_msg_with_time = false;

      #if (defined(GPS_FIX_LOCATION) | \
           defined(GPS_FIX_LOCATION_DMS) | \
           defined(GPS_FIX_ALTITUDE)) & \
          defined(UBLOX_PARSE_POSLLH)
        if (!enable_msg( ublox::UBX_NAV, ublox::UBX_NAV_POSLLH ))
          DEBUG_PORT.print( F("enable POSLLH failed!\n") );

        enabled_msg_with_time = true;
      #endif

      #if (defined(GPS_FIX_SPEED) | defined(GPS_FIX_HEADING)) & \
          defined(UBLOX_PARSE_VELNED)
        if (!enable_msg( ublox::UBX_NAV, ublox::UBX_NAV_VELNED ))
          DEBUG_PORT.print( F("enable VELNED failed!\n") );

        enabled_msg_with_time = true;
      #endif

      #if (defined(GPS_FIX_SATELLITES) | defined(NMEAGPS_PARSE_SATELLITES)) & \
          defined(UBLOX_PARSE_SVINFO)
        if (!enable_msg( ublox::UBX_NAV, ublox::UBX_NAV_SVINFO ))
          DEBUG_PORT << PSTR("enable SVINFO failed!\n");

        enabled_msg_with_time = true;
      #endif

      #if defined(UBLOX_PARSE_TIMEUTC)

        #if defined(GPS_FIX_TIME) & defined(GPS_FIX_DATE)
          if (enabled_msg_with_time &&
              !disable_msg( ublox::UBX_NAV, ublox::UBX_NAV_TIMEUTC ))
            DEBUG_PORT.print( F("disable TIMEUTC failed!\n") );

        #elif defined(GPS_FIX_TIME) | defined(GPS_FIX_DATE)
          // If both aren't defined, we can't convert TOW to UTC,
          // so ask for the separate UTC message.
          if (!enable_msg( ublox::UBX_NAV, ublox::UBX_NAV_TIMEUTC ))
            DEBUG_PORT.print( F("enable TIMEUTC failed!\n") );
        #endif

      #endif

      state = RUNNING;
      trace_header( DEBUG_PORT );

    } // start_running

    //--------------------------

    bool running()
    {
      switch (state) {
        case GETTING_STATUS      : get_status      (); break;
        case GETTING_LEAP_SECONDS: get_leap_seconds(); break;
        case GETTING_UTC         : get_utc         (); break;
      }

      return (state == RUNNING);

    } // running

} NEOGPS_PACKED;

// Construct the GPS object and hook it to the appropriate serial device
static MyGPS gps( &gps_port );

#ifdef NMEAGPS_INTERRUPT_PROCESSING
  static void GPSisr( uint8_t c )
  {
    gps.handle( c );
  }
#endif

//--------------------------

static void configNMEA( uint8_t rate )
{
  for (uint8_t i=NMEAGPS::NMEA_FIRST_MSG; i<=NMEAGPS::NMEA_LAST_MSG; i++) {
    ublox::configNMEA( gps, (NMEAGPS::nmea_msg_t) i, rate );
  }
}

//--------------------------

static void disableUBX()
{
  gps.disable_msg( ublox::UBX_NAV, ublox::UBX_NAV_TIMEGPS );
  gps.disable_msg( ublox::UBX_NAV, ublox::UBX_NAV_TIMEUTC );
  gps.disable_msg( ublox::UBX_NAV, ublox::UBX_NAV_VELNED );
  gps.disable_msg( ublox::UBX_NAV, ublox::UBX_NAV_POSLLH );
}

//--------------------------

void setup()
{
  // Start the normal trace output
  DEBUG_PORT.begin(9600);
  while (!DEBUG_PORT)
    ;

  DEBUG_PORT.print( F("ublox binary protocol example started.\n") );
  DEBUG_PORT << F("fix object size = ") << sizeof(gps.fix()) << '\n';
  DEBUG_PORT << F("ubloxGPS object size = ") << sizeof(ubloxGPS) << '\n';
  DEBUG_PORT << F("MyGPS object size = ") << sizeof(gps) << '\n';
  //DEBUG_PORT.println( F("Looking for GPS device on " USING_GPS_PORT) );
  DEBUG_PORT.flush();

  // Start the UART for the GPS device
  #ifdef NMEAGPS_INTERRUPT_PROCESSING
    gps_port.attachInterrupt( GPSisr );
  #endif
  gps_port.begin(9600);

  // Turn off the preconfigured NMEA standard messages
  configNMEA( 0 );

  // Turn off things that may be left on by a previous build
  disableUBX();

  #if 0
    // Test a Neo M8 message -- should be rejected by Neo-6 and Neo7
    ublox::cfg_nmea_v1_t test;

    test.always_output_pos  = false; // invalid or failed
    test.output_invalid_pos = false;
    test.output_invalid_time= false;
    test.output_invalid_date= false;
    test.use_GPS_only       = false;
    test.output_heading     = false; // even if frozen
    test.__not_used__       = false;

    test.nmea_version = ublox::cfg_nmea_v1_t::NMEA_V_4_0;
    test.num_sats_per_talker_id = ublox::cfg_nmea_v1_t::SV_PER_TALKERID_UNLIMITED;

    test.compatibility_mode = false;
    test.considering_mode   = true;
    test.max_line_length_82 = false;
    test.__not_used_1__     = 0;

    test.filter_gps    = false;
    test.filter_sbas   = false;
    test.__not_used_2__= 0;
    test.filter_qzss   = false;
    test.filter_glonass= false;
    test.filter_beidou = false;
    test.__not_used_3__= 0;

    test.proprietary_sat_numbering = false;
    test.main_talker_id = ublox::cfg_nmea_v1_t::MAIN_TALKER_ID_GP;
    test.gsv_uses_main_talker_id = true;
    test.beidou_talker_id[0] = 'G';
    test.beidou_talker_id[1] = 'P';

    DEBUG_PORT << F("CFG_NMEA result = ") << gps.send( test );
  #endif

  while (!gps.running())
    if (gps.available( gps_port ))
      gps.read();
}

//--------------------------

void loop()
{
  if (gps.available( gps_port ))
    trace_all( DEBUG_PORT, gps, gps.read() );

  // If the user types something, reset the message configuration
  //   back to a normal set of NMEA messages.  This makes it
  //   convenient to switch to another example program that
  //   expects a typical set of messages.  This also saves
  //   putting those config messages in every other example.

  if (Serial.available()) {
    do { Serial.read(); } while (Serial.available());
    DEBUG_PORT.println( F("Stopping...") );

    configNMEA( 1 );
    disableUBX();
    gps_port.flush();
    gps_port.end();

    DEBUG_PORT.println( F("STOPPED.") );
    for (;;);
  }
}

Thanks again Mike

Playing with extra messages

Firstly, let me say you that this is a great library for GPS and UBX protocol!

I try to work with your ublox.ino pure UBX example, but I only need 2 new messages. I'm working with extra UBX functions (UBX only) in the M8U, this is a UDR with 3D IMU sensors, and a Teensy 3.2 board.
This new messages are NAV-ODO (0x01 0x09) and HNR-PVT(x028 0x00) .

I add this, following your DOP code as reference, in ubxGPS.cpp :

bool ubloxGPS::parseNavODO   ( uint8_t chr )
{
  bool ok = true;

//if (chrCount == 0) Serial.print( F( "dop ") );
  #ifdef UBLOX_PARSE_ODO
    switch (chrCount) {
      case 4: case 5: case 6: case 7:
        ok = parseTOW( chr );
        break;

      #ifdef GPS_FIX_ODO_DISTANCE
        case 8: case 9: case 10: case 11:
          NMEAGPS_INVALIDATE( distance );      
          ((uint32_t *)&m_fix.distance) [ chrCount-6] = chr;
          m_fix.valid.distance = true;
          break;
        
      #endif

      #ifdef GPS_FIX_ODO_TOTAL_DISTANCE
        case 12: case 13: case 14: case 15:  
          NMEAGPS_INVALIDATE( total_distance );      
          ((uint32_t *)&m_fix.total_distance) [ chrCount-12] = chr;
          m_fix.valid.total_distance = true;
          break;
      #endif

      #ifdef GPS_FIX_ODO_DISTANCE_STD
        case 16: case 17: case 18: case 19:
          NMEAGPS_INVALIDATE( distanceSTD );
          ((uint32_t *)&m_fix.distanceSTD) [ chrCount-16] = chr;
          m_fix.valid.distanceSTD = true;
          break;
      #endif

    }
  #endif

  return ok;

} // parseNavODO 

And add UBX_NAV_ODO case in ubloxGPS::parseField function and bool parseNavODO ( uint8_t chr );' in 'ubx.GPS.h.
I checked that It parses ODO message (0x01 0x09) correctly, but I don't know how receive into <Streamers.h> or my sketch directly (as 'if (fix.valid.distance) Serial.print( fix.distance / 1000 );'

Would be great if you can explain/example us how can I try to check this data and how HNR-PVT could be implemented.

Thanks again,
Best regards!

NeoGPS Not Returning fixes when incorporated into obs avoid sketch

Hi @SlashDevin

Me again. I decided to move away from tinygps++ and incorporate a version of NEMACoherent into my obstacle avoidance sketch (https://github.com/mjs513/Dagu-Rover-5-Obstacle-Avoidance-Testbed/tree/master/DaguRover5AutoNavv5). I first tested a standalone where I hard coded the gps port as serial2 and it worked fine (here is the standalone code):

#include <Arduino.h>
#include "NMEAGPS.h"
#include <Streaming.h>

//======================================================================
//  Program: NMEAcoherent.ino
//
//  Prerequisites:
//     1) NMEA.ino works with your device
//     2) At least one NMEA sentence has been enabled in NMEAGPS_cfg.h
//     3) NMEAGPS_COHERENT is enabled in NMEAGPS_cfg.h
//     3) Explicit or Implicit merging is enabled in NMEAGPS_cfg.h
//
//  Description:  This program guarantees coherency in the fix data.  
//     When a sentence is received with a new time interval, 
//     the 'coherent' fix will start with just that new data.  
//     All data from the previous interval is replaced or deleted.  
//     As new sentences are received, data from this new interval 
//     are merged into the 'coherent' fix.
//     
//     This program also shows how to 'poll' for a specific message 
//     if it is not sent by default.
//
//  Serial is for debug output to the Serial Monitor window.
//
//======================================================================

#define gps_port Serial2
#define DEBUG_PORT Serial


//------------------------------------------------------------
// Check that the config files are set up properly

#if !defined( NMEAGPS_PARSE_GGA ) & !defined( NMEAGPS_PARSE_GLL ) & \
    !defined( NMEAGPS_PARSE_GSA ) & !defined( NMEAGPS_PARSE_GSV ) & \
    !defined( NMEAGPS_PARSE_RMC ) & !defined( NMEAGPS_PARSE_VTG ) & \
    !defined( NMEAGPS_PARSE_ZDA ) & !defined( NMEAGPS_PARSE_GST ) & \
    !defined( NMEAGPS_RECOGNIZE_ALL )

  #error No NMEA sentences enabled

#endif

#ifndef NMEAGPS_COHERENT
  #error You must define NMEAGPS_COHERENT in NMEAGPS_cfg.h!
#endif

#ifdef NMEAGPS_NO_MERGING
  #error You must define EXPLICIT or IMPLICIT merging in NMEAGPS_cfg.h!
#endif

#ifdef NMEAGPS_INTERRUPT_PROCESSING
  #error You must *NOT* define NMEAGPS_INTERRUPT_PROCESSING in NMEAGPS_cfg.h!
#endif

//------------------------------------------------------------

static NMEAGPS gps;
static gps_fix coherent;

NeoGPS::Location_t madrid( 407746670L, -738146590L ); 


//----------------------------------------------------------------

static void doSomeWork( const gps_fix & fix )
{
  // Print all the things!
  //trace_all( DEBUG_PORT, gps, fix );
    DEBUG_PORT << coherent.hdop << ", " << coherent.pdop << ", " << coherent.speed() <<  ", "  ;
    DEBUG_PORT << coherent.heading() << ", " << coherent.latitudeL() << ", " ;
    DEBUG_PORT << coherent.longitudeL() << ", " << coherent.satellites << ", ";
    DEBUG_PORT << coherent.dateTime << "." << coherent.dateTime_cs <<", " << coherent.valid.location;
    DEBUG_PORT << endl;

    float dist = NeoGPS::Location_t::DistanceKm( coherent.location, madrid );
    float bearing = NeoGPS::Location_t::BearingToDegrees( coherent.location, madrid );

    DEBUG_PORT << dist*1000. << ", " << bearing;
    DEBUG_PORT << endl;

  #ifdef NMEAGPS_PARSE_GST
    // Now is a good time to ask for a GST.  Most GPS devices
    //   do not send GST, and some GPS devices may not even
    //   respond to this poll.  Other may let you request
    //   these messages once per second by sending a 
    //   configuration command in setup().
    gps.poll( &gps_port, NMEAGPS::NMEA_GST );

  #endif

} // doSomeWork

//------------------------------------

static void GPSloop()
{
  while (gps.available( gps_port )) {
    coherent = gps.read();
    doSomeWork( coherent );
  }

} // GPSloop

//--------------------------

void setup()
{

  // Start the normal trace output
  DEBUG_PORT.begin(115200);
  while (!DEBUG_PORT)
    ;

  DEBUG_PORT.print( F("NMEAcoherent: started\n") );
  DEBUG_PORT.print( F("fix object size = ") );
  DEBUG_PORT.println( sizeof(gps.fix()) );
  DEBUG_PORT.print( F("NMEAGPS object size = ") );
  DEBUG_PORT.println( sizeof(gps) );
  DEBUG_PORT.println( F("Looking for GPS device on " ) );

  // Check configuration

  #if !defined( NMEAGPS_PARSE_GGA ) & !defined( NMEAGPS_PARSE_GLL ) & \
      !defined( NMEAGPS_PARSE_GSA ) & !defined( NMEAGPS_PARSE_GSV ) & \
      !defined( NMEAGPS_PARSE_RMC ) & !defined( NMEAGPS_PARSE_VTG ) & \
      !defined( NMEAGPS_PARSE_ZDA ) & !defined( NMEAGPS_PARSE_GST ) & \
      defined( NMEAGPS_RECOGNIZE_ALL )

    DEBUG_PORT.println( F("\nWARNING: No NMEA sentences are enabled: no fix data will be displayed.") );
  #endif

  //trace_header( DEBUG_PORT );

  DEBUG_PORT.flush();

  // Start the UART for the GPS device
  gps_port.begin(115200);

  #ifdef NMEAGPS_PARSE_GST
    gps.poll( &gps_port, NMEAGPS::NMEA_GST );
  #endif

}

//--------------------------

void loop()
{
  GPSloop();
}

Unfortunately no data is ever returned. The primary modified files were in the DaguRover5v5.ino and the gpsready() in the sensor_read.ino files. It is like the port is never really being read. Not sure what the problem is - any help would be appreciated.

MIke

add fix.latitude sprintf

how to add fix.latitude sprintf ? I try
char tanggalDanJam[100];
sprintf(tanggalDanJam,%.6f, (fix.latitude(), 6)
output is
?

GPS data in Minimum Time

Hey SlashDevin

i have not tested this code but i have one query and hoping you will help me with that

Query is : i need Long , Lat and HDOP data cont. from GPS within minium time like 1uh (microsecond) so is there a way that we can use your library and we get all those data is less time ?

Show adjust date & time in LCD 5110

how to show adjust date & time in LCD 5110 ?
I try not show in LCD 5110

 while (gps.available( gpsPort )) {
    fix = gps.read();

    if (fix.valid.time && fix.valid.date) {
      adjustTime( fix.dateTime );
      display << fix.dateTime;
    }
    display.display();
  }

Can't Get Longitude and Latitude Data from Neo-6m Module

Hi,
I am trying to use Neo-6m module with Arduino Uno, but unfortunately I have not been able to get the data from the module. I have attached a screen-shot of the raw data recieved with NMEA.ino example.
I am using AltSoftSerial in the GPSport.h, for communication and connected my GPS TX line to pin 8 and GPS RX line to pin 9 of arduino. I have been through almost all the GPS libraries availaible online for arduino but none seem to work. Can anyone help me?
screenshot from 2017-08-30 15-25-30

Using NeoGPS to store RAW Data

Hey,

I have another questions. I simply want to connect my uBlox GPS serial port to my adruino uno and read in NMEA sentences as well as RAW messages(RAWX, SFRBX,MEASX) and then store them to a microSD card (with openLog).

It works fine so far for storing NMEA sentences. However if I want to store RAW messages my code has some problems.....
Thats why I want to ask how can be determined the ("end of line for raw messages?") or how can I use NEOGPS to simply print all the incoming data from the serial port of my gps module.

My code so far was:

String inData;

void setup() {
    Serial.begin(38400);
}

void loop() {
    while (Serial.available() > 0)
    {
        char recieved = Serial.read();
        inData += recieved; 

        // Process message when new line character is recieved
        if (recieved == '\n')
        {
            //Serial.print("Arduino Received: ");
            Serial.print(inData);

            inData = ""; // Clear recieved buffer
        }
    }

}

I mean if I connect my Serial Port of my gps module with a serial to usb converter and have a look at the data with RealTerm then all the linebrakes and so on is managed fine.

My goal is to store NMEA data and RAW data on an microSD card so that this file can afterwards be opened by uCenter and when playing it it will recognice the RAW messages as well.

Everything with serial.print will be written to my sd card.

Thanks! :)

Satellite information

Hi SlashDevin,
I am trying to map the current satellite configuration to a reached precision level. Hence, I used the "full" configuration of NeoGPS to generate the required data based on a SainSmart Ublox NEO-6M module. But I realized that the "Satellite Array" included up to 16 satellites. I believe to know, that more than 12 satellites should never be visible from a specific point.

The documentation of gps.satellies[] mentions that : "There is additional information that is not related to a fix." Does the satellite array collects and stores the satellite parameters in a specific way? Are these information suitable for my project?

Best wishes

Sebastian

neogps mega2560

I try on mega2560 with uncomment
#define gpsPort Serial1
#define GPS_PORT_NAME "Serial1"
#define DEBUG_PORT Serial
in GPSport.h but I can't show coordinat. I am try with NMEAsimple.ino

latitude and longitude DMS is not working

I can get every other specific data from gps_fix except latitude and longitude in DMS.

static gps_fix fix_data;
Serial.print(fix_data.latitudeDMS.degrees);

gets me compile error:
NMEA:117: error: 'class gps_fix' has no member named 'latitudeDMS'

Thanks for help.

DUE version

Hi, Devin,
Current version is not working in my DUE.
Do you have Auduino/DUE version for this NeoGPS?
Thanks

Wrong datetime?

Hello

I'm trying to create a GPS tracker, which store the current location to a SD card (when moving) and send it to my server when on WIFI.
It seems to work, but the timestamp seems to be in the 1970'. Am I doing something wrong?

15548742,8,5x.xx,9.xx,1.14
15548767,7,5x.xx,9.xx,1.24
$ date -d @15548767
tir jun 30 00:06:07 CET 1970

The hardware is a NodeMCU v3 (esp8266) and a GV-NEO6MV2, and software wise I'm using NeoGPS 4.1.7 and Arduino ESP8266 v2.3.0.

The code is as following:

/*
  SD card datalogger

 This example shows how to log data from three analog sensors
 to an SD card using the SD library.

 The circuit:
 * analog sensors on analog ins 0, 1, and 2
 * SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

 created  24 Nov 2010
 modified 9 Apr 2012
 by Tom Igoe

 This example code is in the public domain.

 */

// https://forum.arduino.cc/index.php?topic=46900.0
//#define DEBUG

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

#include <SPI.h>
#include <SD.h>
#include <NMEAGPS.h>
NMEAGPS gps;

#include <SoftwareSerial.h>

SoftwareSerial serialGPS(D1, 0);

void setup() {
  // https://github.com/esp8266/Arduino/blob/d46d742db1c066eb36ef2d4d0706e0faba1f2c23/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino#L29
  WiFi.mode(WIFI_STA);
  WiFi.begin("xxx", "xxx");

  #ifdef DEBUG
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.print("Initializing SD card...");
  #endif

  // see if the card is present and can be initialized:
  if (!SD.begin(SS)) {
    ESP.restart();
    #ifdef DEBUG
    Serial.println("Card failed, or not present");
    #endif
  } else {
    #ifdef DEBUG
    Serial.println("card initialized.");
    #endif
  }
}

bool sendData() {
  if (WiFi.status() == WL_CONNECTED) {
    #ifdef DEBUG
    Serial.println("wifi connected");
    Serial.printf("heap size: %u\n", ESP.getFreeHeap());
    #endif

    // https://github.com/wiieva/examples/blob/59e7e7fc40df6460a1d1918d7bb47cd681898249/wiieva-intro/wiieva-intro.cpp
    File dataFile = SD.open("datalog.txt", FILE_READ);
    #ifdef DEBUG
    Serial.printf("dataFile.size: %u\n", dataFile.size());
    #endif
    if (dataFile.size() > 0) {
      HTTPClient http;
      http.begin("http://xx.xx.xx.xx:8082/");

      int httpCode = http.sendRequest ("POST", &dataFile, dataFile.size());
      http.end();
      #ifdef DEBUG
      Serial.printf("httpCode: %u\n", httpCode);
      #endif
      // Memory leak :/
      delay(10000);
      if (httpCode == 200) {
        SD.remove("datalog.txt");
        return true;
      }
      return false;
    }
    return true;
  }
  return false;
}

void loop() {
  /*if(serialGPS.available()){
    Serial.write(serialGPS.read());
  }*/
  //Serial.println(gps.available( serialGPS ));
  sendData();
  while (gps.available( serialGPS )) {
    sendData();
    gps_fix fix = gps.read();
    String dataString = "";
    //Serial.println(fix.speed_kph());
    if (fix.valid.speed && fix.speed_kph() > 1 && fix.valid.location && fix.valid.altitude) {
      dataString += String(fix.dateTime) + ",";
      dataString += String(fix.satellites) + ",";
      // https://github.com/SlashDevin/NeoGPS/blob/master/extras/doc/Data%20Model.md#data-model
      // "~7 significant digits"
      // https://github.com/SlashDevin/NeoGPS/blob/master/extras/doc/Data%20Model.md#precision
      // "32-bit ints have 10 significant digits, so you can detect very"
      dataString += String(fix.latitude(), 10) + ",";
      dataString += String(fix.longitude(), 10) + ",";
      dataString += String(fix.speed_kph());
      dataString += "\n";

      File dataFile = SD.open("datalog.txt", FILE_WRITE);
      if (dataFile) {
        dataFile.print(dataString);
        dataFile.close();
      }
      #ifdef DEBUG
      Serial.print(dataString);
      #endif
      delay(10000);
    }
  }
}

-- Kristian

Blanc page without data or errors !

Hi man,
Thank you so much for this nice package !
I've imported your library and tested it on Arduino Uno (pinsRx =0, pinxTx = 1).
But I just receive a blank page :
untitled

Please what's the mistake ?

Here my program :

#include <NMEAGPS.h>
  /*
    This program sketch obtain and print the lati,logi,speed,date and time
    It requires the use of SoftwareSerial, and assumes that you have a
    9600-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
   */
#include <NeoSWSerial.h>
static const int RXPin = 0, TXPin = 1;
NeoSWSerial gpsPort(RXPin, TXPin);
static const uint32_t GPSBaud = 9600;

NMEAGPS gps;
gps_fix fix;
uint8_t fixCount = 0;

void setup()
{
  Serial.begin(9600);
  gpsPort.begin(GPSBaud);

  Serial.println(F("GPS LOADING....."));
  Serial.println(F("Obtain and print lati,logi,speed,date and time"));
  Serial.println(F("Testing by : "));
  Serial.println(F("Billa"));
  Serial.println();
}

void loop()
{
  while (gps.available( gpsPort )) {
    fix = gps.read();

    // Once every 5 seconds...    
    if (++fixCount >= 5) {
      displayInfo();
      fixCount = 0;
    }
  }

  if ((gps.statistics.chars < 10) && (millis() > 5000)) {
     Serial.println( F("No GPS detected: check wiring.") );
     while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (fix.valid.location) {
    Serial.print( fix.latitude(), 5 );
    Serial.print( ',' );
    Serial.print( fix.longitude(), 5 );
  } else {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Speed: ")); 
  if (fix.valid.speed) {
    Serial.print(fix.speed_kph());
    Serial.print(F(" KMPH "));
  } else {
    Serial.print(F("INVALID"));
  }

  // Shift the date/time to local time
  NeoGPS::clock_t localSeconds;
  NeoGPS::time_t  localTime;
  if (fix.valid.date && fix.valid.time) {
    using namespace NeoGPS; // save a little typing below...

    localSeconds = (clock_t) fix.dateTime; // convert structure to a second count
    localSeconds += 5 * SECONDS_PER_HOUR + 30 * SECONDS_PER_MINUTE; // shift timezone
    localTime = localSeconds;              // convert back to a structure
  }

  Serial.print(F("  Date : "));
  if (fix.valid.date) {
    Serial.print(fix.dateTime.month);
    Serial.print('/');
    Serial.print(fix.dateTime.date);
    Serial.print('/');
    Serial.print(fix.dateTime.year);
  } else {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Time : "));
  if (fix.valid.time) {
    Serial.print(localTime.hours);
    Serial.print(':');
    if (localTime.minutes < 10) Serial.print('0');
    Serial.print(localTime.minutes);
    Serial.print(':');
    if (localTime.seconds < 10) Serial.print(F("0"));
    Serial.print(localTime.seconds);
  } else {
    Serial.print(F("INVALID"));
  }

  Serial.println();
}

Send GPS data to server http

Hi man,

Thank you so much for your nice packages.
I've arduino sim900 + Neo-6m-0-001 + Arduino Uno.
I can successfully send GPS data (lat, lng, spd , ...etc ) via sms to a number.
Now I have an http web server, I want to send these data to it,
x.x.x.x/getData.
Please could you give me a code how to setup my url, gprs ?

Thanks.

NeoGPS::Location_t::RAD_PER_DEG' cannot appear in a constant-expression

Hello,

I am facing the issue while compiling on Arduino IDE. Here is exact error message >>

In file included from C:\Users\abc\Documents\Arduino\libraries\NeoGPS-master/GPSfix.h:34:0,
                 from C:\Users\abc\Documents\Arduino\libraries\NeoGPS-master/NMEAGPS.h:28,
                 from neogps_neoswserial.ino:1:
C:\Users\abc\Documents\Arduino\libraries\NeoGPS-master/Location.h:57:52: error: 'NeoGPS::Location_t::RAD_PER_DEG' cannot appear in a constant-expression
     CONST_CLASS_DATA float DEG_PER_RAD     = 1.0 / RAD_PER_DEG;
                                                    ^
Error compiling.

Traveled Distance?

Hey, thank you so much for all the work! Great library (even kind of usable for me as a total beginner;)!
But i have two questions:

  1. i cannot find a simple way to get the traveled distance. Is there anything already implemented in the library, what i could use to realize some kind of odometer?

  2. I am working right now with the example file NMEASDLog.ino. It workes wonderfully, i changed a little bit, that i directly outputs gpx files, so nothing special. But here is the question: if i not only want to write down anything to SD card, but also display it on an lcd, where would i put the additional code?
    to be a little bit more clear: i have basically these lines added to the example file NMEASDLog.ino: `#include <UTFT.h>

    include <GroteskBold16x32.c>

    UTFT myGLCD(ILI9341_16, 38, 39, 40, 41);in the setup routine are these two lines new: myGLCD.InitLCD();
    myGLCD.setFont(GroteskBold16x32 ); and the very last line before the last } is:myGLCD.print("TEST", 0, 0);
    }But it is not working at all. (it simply does not show anything). also when adding a:DEBUG_PORT.println( F("DEBUGTEST") );` it does not show up.

Is there any reason, that commands in loop() are not dealt with?

Thanks a lot!,

Pcace

How to add data members to fix?

Hello,
Very impressed with the library, but it doesn't quite cover everything I need. Using a Ublox GPS and I need most of the data from the PUBX_00 message, but have been unable to get the vertical velocity. Have tried going through the various .h and .cpp files to add a "GPS_FIX_VERT_VEL" and "parseVVel()", but have been unsuccessful. Can this be easily done? Is there a set of steps I should follow to incorporate this? Brand new to GitHub so my apologies if this isn't the right forum/format.

$GPTXT sentence

(before I begin, I know the answer is almost certainly going to be "write a new parser for it", and I probably will, but)

I got a ublox neo 6m and ran NMEAdiagnostic.ino: the ublox is transmitting on 9600, and in the test I see the sentences coming through, but it's $GPTXT, which isn't one of the default message types, so the code continued to scan.

Since this is an out-of-the-box thing I got from Amazon I was surprised that there was something that wasn't supported (since ublox is specifically). Like I said, I know I can make NeoGPS accept anything, but has it already been done by someone? (not that I could tell from searching) If I wrote it, would you consider a PR to add it? Or does this mean I got a malfunctioning ublox?

Using Serial or Neoserial via NeoHWSerial rather than Serial1, SS or alternatives

Hello SlashDevin, using an ESP8266 MCU...

I only have one hardware serial port. I am using it for the GPS. I have a physical switch to disable GPS & enable uploading of newly compiled code changes, or if the switch was removed I could also upload such firmware updates via a ESP8266 webserver. This system works perfectly - I have been using it with TinyGPS++, so I know my wiring and code around this is sound.

I do all my debug & monitoring using telnet thanks to: https://github.com/JoaoLopesF/ESP8266-RemoteDebug-Telnet

My issue is that I can't seem to get NeoGPS working showing satellites with fix when using Serial, even though the light on the GPS indicates it has a valid fix.

Not including all the wifi, lorawan, webserver & standard stuff It looks roughly like:

#include <NMEAGPS.h>
#include <RemoteDebug.h>

RemoteDebug Debug;
#define gpsPort Serial
NMEAGPS gps;
gps_fix fix;

void setup(void) {

Debug.printf("GPS port init \n");
gpsPort.begin(9600, SERIAL_8N1);

}

void loop(void) {

fix = gps.read();
Debug.printf("Satellites with fix: %u \n", fix.satellites);

}

I have tried using the great new tabular example Tabular.ino rather than just displaying the number of satellites as in the example above, but it seems to continue the tradition of using the only hardware serial port for debug messages & general output rather than allowing me to use it for the GPS... my modifications to it to send to the RemoteDebug library don't seem to result in any data either, though this might be due to the added complexity of your print feature.

My thought is just that I could use NeoHWSerial with interrupt support on the sole hardware serial where a GPS is connected. Once I get just Serial working, I'll move onto using NeoHWSerial.

Would you have a tip?

Using NeoGPSTabular example with Teensy 3.x

While trying to run the tabular example in the library I ran into the following error:
Tabular: In function 'const __FlashStringHelper* compassDir(uint16_t)': Tabular:200: error: 'pgm_read_ptr' was not declared in this scope return (const __FlashStringHelper *) pgm_read_ptr( &dirStrings[ dir ] );

I am using Arduino IDE 1.8.4 with the latest version of the Teensyduino (1.39 beta 1) and compiling for a Teensy 3.5.

Do not know how to fix this one.

Thanks
Mike

Implementing NeoGPS for Arduino Mega

Hello, I have a Garmin LVC 18x GPS that I got working with an arduino Uno with an SD shield. Unfortunately, the Uno was not large enough for the program I am trying to eventually write, so I switched everything to a Mega 2560. The Mega however does not like software serial, which, is what TinyGPSPlus uses. So many forwarded me to NeoGPS. That being said, I have fixed many issues and errors that have popped up, and eventually upgraded the Arduino IDE to get all of them to finally go away. Now, my issue is not an error popping up, but nothing popping up.

I am using the basic NMEA.ino example.
My GPS is 4800 Baud rate (Which I have changed around line 145).
I have switched the RX and TX ports endlessly on 18 and 19 in case I got them mixed up

I tried the original GPSport.h, as well as commented out everything except
#define gpsPort Serial1
#define GPS_PORT_NAME "Serial1"
#define DEBUG_PORT Serial

And still all I get out of the serial window is
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,

When running NMEAorder.ino, I get
No valid sentences, but characters are being received.
Check baud rate or device protocol configuration.

I know the GPS is working because I have just re-tested it on the Uno and it spits out NMEA sentences like $--GGA. The GPS has been sitting in the same spot, so it's not still warming up. I also tested it with NMEADiagnostics and it said the same thing "No valid sentences, but characters are being received" With no conclusion on baud rate (Specs say 4800 which works on Uno)

When I run a while(serial1.available) loop I get A LOT of numbers but no ascii like below
155
78
159
141
167
157
163
157
167
This goes on ad naseum.

I have no idea where else to go. Thank you.

EDIT: I am thinking I need to invert the signal logic? That is what I did with SoftwareSerial(rx,tx,1) but I have not found a way to do this on the Mega 2560 without a 232 shifter? Does this sound like it may be the problem?

Usable Example

Hi, thanks so much for this code! But if you can i need a simple thing, i wish use your library in my project but i don't understand as i can read the data from the GPS (the example NMEA work and i can read the data) like Serial.print(GPS.lat) can i use the data in this simple way? Can you make me a simple example?! Many thanks!

Problems using NMEAtimezone.ino example

Hi!
I use Arduino UNO and Neo m8n clone and like to control my scrolling clock with NMEAtimezone code. But when I want to see Daylight Savings Time added in real time I can't see it. For this I open NMEAtimezone.ino and uncomment <AltSoftSerial.h> and change my zone_hours and changeover time. First I noticed I must set changeover time in UTC and not by my local clock. But when I watch Serial Monitor and time passes my changeover time - nothing happening, time just ticking forward. Change in hours occur after Arduino reset. Somehow in my case zone_hours++ not processed without reloading whole code. What I must change here?

[Question] Sending UBX protocol commands

Trying to send a cold start request to a UBlox 7m device using the UBX protocol.
I figured this should work:

static const uint8_t gps_cold[] __PROGMEM = { ublox::UBX_CFG, ublox::UBX_CFG_RST, sizeof(ublox::cfg_reset_t), 0, 0xff, 0xff,    0x02,          0x00};
static const ublox::cfg_reset_t *cfg_cold_P = (const ublox::cfg_reset_t *) &gps_cold[0];

void gpsColdStart(void) {
  gps.send_request_P(*cfg_cold_P);

However, I do not get any response/reply on this command? ๐Ÿ˜ข

Compilation error using Arduino Due or Maple Mini

I get compilation errors if I try to compile the NMEAtest script on a 32 bit platform (with IDE1.6.5).

The first error is:

In file included from C:\Users\Andreas\Dropbox\ASP\Arduino\Sketches\libraries\NeoGPS/NMEAGPS.h:25:0,
from NMEAtest.ino:21:
C:\Users\Andreas\Dropbox\ASP\Arduino\Sketches\libraries\NeoGPS/NMEAGPS_cfg.h:155:2: error: #error You must define NMEAGPS_DERIVED_TYPES in NMEAGPS.h in order to parse Talker and/or Mfr IDs
#error You must define NMEAGPS_DERIVED_TYPES in NMEAGPS.h in order to parse Talker and/or Mfr IDs
^

Error compiling.

If I comment this one, I get the next error:

C:\Users\Andreas\Dropbox\ASP\Arduino\Sketches\libraries\NeoGPS\NMEAGPS.cpp: In member function 'bool NMEAGPS::parseLat(char)':
C:\Users\Andreas\Dropbox\ASP\Arduino\Sketches\libraries\NeoGPS\NMEAGPS.cpp:807:32: error: cannot bind packed field '((NMEAGPS_)this)->NMEAGPS::m_fix.gps_fix::lat' to 'int32_t& {aka long int&}'
parseDDDMM( m_fix.lat, chr );
^
C:\Users\Andreas\Dropbox\ASP\Arduino\Sketches\libraries\NeoGPS\NMEAGPS.cpp: In member function 'bool NMEAGPS::parseLon(char)':
C:\Users\Andreas\Dropbox\ASP\Arduino\Sketches\libraries\NeoGPS\NMEAGPS.cpp:828:32: error: cannot bind packed field '((NMEAGPS_)this)->NMEAGPS::m_fix.gps_fix::lon' to 'int32_t& {aka long int&}'
parseDDDMM( m_fix.lon, chr );
^
C:\Users\Andreas\Dropbox\ASP\Arduino\Sketches\libraries\NeoGPS\NMEAGPS.cpp: In member function 'bool NMEAGPS::parseHDOP(char)':
C:\Users\Andreas\Dropbox\ASP\Arduino\Sketches\libraries\NeoGPS\NMEAGPS.cpp:897:38: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::hdop' to 'uint16_t& {aka short unsigned int&}'
if (parseFloat( m_fix.hdop, chr, 3 ))
^
Error compiling.

I would like to use your great library on a 32 bit platform because of speed, double precison, and many serial connections.

fix.dateTime.day only returns second character

When Serial.println(fix.dateTime.day); is used, it only prints the second character. For instance today is 27/09/2016 but only "7" gets printed.

However Serial.println(fix.dateTime.year); prints 16 as expected.

This issue also occurs when passing the fix.dateTime.day value into a variable, not just with serial.print

NeoGPS Compile "pgm_read_ptr" redefined on T3.5

Using IDE 1.8.5 and TD1.40 I tried compiling a program I have using NeoGPS and I received the following warning message:

Programs\arduino-1.8.5\hardware\teensy\avr\cores\teensy3/WString.h:33:0,
                 from C:\Local Programs\arduino-1.8.5\hardware\teensy\avr\cores\teensy3/Print.h:38,
                 from C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS\src\DMS.cpp:20:
C:\Local Programs\arduino-1.8.5\hardware\teensy\avr\cores\teensy3/avr/pgmspace.h:113:0: warning: "pgm_read_ptr" redefined
 #define pgm_read_ptr(addr) ({ \
 ^

In file included from C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS\src\DMS.h:21:0,
                 from C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS\src\DMS.cpp:18:
C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS\src\NeoGPS_cfg.h:106:0: note: this is the location of the previous definition
   #define pgm_read_ptr(addr) (*(const void **)(addr))
 ^

I reported this as an issue in Teensy core-libs and Paul identified the problem as in NEOGPS as associated with:

//------------------------------------------------------------------------
// The PROGMEM definitions are not correct for Zero and MKR1000

#if !defined(__AVR__)
  // TODO: use the Zero/MKR1000-specific symbols
  #undef pgm_read_ptr
  #define pgm_read_ptr(addr) (*(const void **)(addr))
#endif

Guess easy fix would be:

#if !defined(__AVR__)  to #if !defined(__AVR__) or !defined(__TEENSYDUINO__)

Thanks
Mike

Having trouble with latitudeDMS.NS

This is almost definitely me overlooking something really dumb.

char ffNS = (fix.latitudeDMS.NS);

I get "error: cannot convert 'DMS_t::NS' from type 'char (DMS_t::)() const' to type 'char'"

I also get an error if I try using it in a memcpy:

memcpy(fix.latitudeDMS.NS, &NMEALat[7], 1);

"error: invalid use of non-static member function"

Sorry for the probably noobish question!

Compile error on Arduino Mega

Hello,
I've tried to compile NMEA.ino, NMEAdiagnostics.ino, NMEAtest.ino and ublox.ino but compilation fails with these errors:
In file included from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:22:0from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:29, from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\examples\NMEA\NMEA.ino:2: C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: error: 'constexpr' does not name a type #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:137:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA float KM_PER_NMI = 1.852; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11 #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:137:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA float KM_PER_NMI = 1.852; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: error: 'constexpr' does not name a type #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:140:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA uint16_t M_PER_NMI = 1852; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11 #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:140:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA uint16_t M_PER_NMI = 1852; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: error: 'constexpr' does not name a type #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:143:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA float MI_PER_NMI = 1.150779; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11 #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:143:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA float MI_PER_NMI = 1.150779; ^ In file included from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:29:0, from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\examples\NMEA\NMEA.ino:2: C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h: In member function 'float gps_fix::speed_kph() const': C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:138:52: error: 'KM_PER_NMI' was not declared in this scope float speed_kph () const { return speed() * KM_PER_NMI; }; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h: In member function 'uint32_t gps_fix::speed_metersph() const': C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:141:59: error: 'M_PER_NMI' was not declared in this scope uint32_t speed_metersph() const { return (spd.whole * M_PER_NMI) + (spd.frac * M_PER_NMI)/1000; }; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h: In member function 'float gps_fix::speed_mph() const': C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:144:49: error: 'MI_PER_NMI' was not declared in this scope float speed_mph() const { return speed() * MI_PER_NMI; }; ^ In file included from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:22:0, from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:29, from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\examples\NMEA\NMEA.ino:2: C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h: At global scope: C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: error: 'constexpr' does not name a type #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:96:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA nmea_msg_t NMEA_FIRST_MSG = (nmea_msg_t) (NMEA_UNKNOWN+1); ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11 #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:96:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA nmea_msg_t NMEA_FIRST_MSG = (nmea_msg_t) (NMEA_UNKNOWN+1); ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: error: 'constexpr' does not name a type #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:97:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA nmea_msg_t NMEA_LAST_MSG = (nmea_msg_t) (NMEAMSG_END-1); ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11 #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:97:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA nmea_msg_t NMEA_LAST_MSG = (nmea_msg_t) (NMEAMSG_END-1); ^ In file included from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\examples\NMEA\NMEA.ino:2:0: C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:290:41: error: 'NMEAGPS_KEEP_NEWEST_FIXES' was not declared in this scope static const bool keepNewestFixes = NMEAGPS_KEEP_NEWEST_FIXES; ^ In file included from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/GPSfix.h:22:0, from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:29, from C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\examples\NMEA\NMEA.ino:2: C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: error: 'constexpr' does not name a type #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:362:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA uint8_t NMEA_FIRST_STATE = NMEA_IDLE; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11 #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:362:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA uint8_t NMEA_FIRST_STATE = NMEA_IDLE; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: error: 'constexpr' does not name a type #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:363:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA uint8_t NMEA_LAST_STATE = NMEA_RECEIVING_CRC; ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NeoGPS_cfg.h:81:35: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11 #define CONST_CLASS_DATA static constexpr ^ C:\Users\****USER****\Documents\Arduino\libraries\NeoGPS\src/NMEAGPS.h:363:5: note: in expansion of macro 'CONST_CLASS_DATA' CONST_CLASS_DATA uint8_t NMEA_LAST_STATE = NMEA_RECEIVING_CRC; ^ exit status 1 Errore durante la compilazione per la scheda Arduino/Genuino Mega or Mega 2560.

But with Arduino Uno works fine...
Sorry for my bad English.

Cannot compile for Teensy 3.2

Hi,

First I just want to say great library and its been fun learning how to use it. The forum helped a lot. I am running windows 10 64bit, IDE 1.6.11 and teensyduino 1.30 beta 3. Receiving following errors when I try using the Teensy3.2 using the NEMAcoherent sketch. It does work fine for the Mega 2560.

Arduino: 1.6.10 (Windows 10), TD: 1.30-beta3, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimize speed (overclock), US English"

Build options changed, rebuilding all
C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parseGSV(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:800:68: error: cannot bind packed field '((NMEAGPS_)this)->NMEAGPS::satellites[((int)((NMEAGPS_)this)->NMEAGPS::sat_count)].NMEAGPS::satellite_view_t::azimuth' to 'uint16_t& {aka short unsigned int&}'

                   parseInt( satellites[sat_count].azimuth, chr );

                                                                ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parseLat(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:1269:9: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::location.NeoGPS::Location_t::_lat' to 'int32_t& {aka long int&}'

     );

     ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parseLon(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:1308:9: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::location.NeoGPS::Location_t::_lon' to 'int32_t& {aka long int&}'

     );

     ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parseHDOP(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:1417:40: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::hdop' to 'uint16_t& {aka short unsigned int&}'

 if (parseFloat( m_fix.hdop, chr, 3 ))

                                    ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parseVDOP(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:1432:40: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::vdop' to 'uint16_t& {aka short unsigned int&}'

 if (parseFloat( m_fix.vdop, chr, 3 ))

                                    ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parsePDOP(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:1447:40: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::pdop' to 'uint16_t& {aka short unsigned int&}'

 if (parseFloat( m_fix.pdop, chr, 3 ))

                                    ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parse_lat_err(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:1462:46: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::lat_err_cm' to 'uint16_t& {aka short unsigned int&}'

 if (parseFloat( m_fix.lat_err_cm, chr, 2 ))

                                          ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parse_lon_err(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:1477:46: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::lon_err_cm' to 'uint16_t& {aka short unsigned int&}'

 if (parseFloat( m_fix.lon_err_cm, chr, 2 ))

                                          ^

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp: In member function 'bool NMEAGPS::parse_alt_err(char)':

C:\Users\CyberPalin\Documents\Arduino\libraries\NeoGPS-master\NMEAGPS.cpp:1492:46: error: cannot bind packed field '((NMEAGPS*)this)->NMEAGPS::m_fix.gps_fix::alt_err_cm' to 'uint16_t& {aka short unsigned int&}'

 if (parseFloat( m_fix.alt_err_cm, chr, 2 ))
                                          ^

Error compiling for board Teensy 3.2 / 3.1.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

library not recognized in visual studio community edition 2017

Hi,

Using Visual Micro Arduino IDE for visual studio community edition 2017,

Your library isn't recognized.

When installed from zip or from the library manager.

#include <NMEAGPS.h>
results in 'cannot open source file'
even though the library manager shows NeoGPS is installed.
I can't select it in the list of installed libraries, it doesn't show.

It is recognized in the Arduino compiler 1.8.2

Let me know if I need to push this to Visual Micro.
Cheers,
X

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.