NMEA library help

I would greatly appreciate your help. I have been working on code for my High altitude balloon that reads GPS input serial and then gives the coordinates to an Xbee to send home. Please take a look at my code. Thanks, B.

#include <SoftwareSerial.h> 
#include <nmea.h>

SoftwareSerial mySerial(2, 3);  //2 goes to GPS pin 4, 3 goes to GPS pin 3. (2 - artificial RX, 3 - artificial TX
int incomingByte = 0;    //Variable to store incoming Byte
NMEA gps(GPRMC);  //Tells GPS to only read GPRMC data

void setup()  
{
  Serial.begin(19200);    //Baud rate of Xbee
  Serial.println("Program Intitiating");  //Little startup message

  mySerial.begin(4800);  //Set up the artificial serial port (For GPS)
  pinMode(13, OUTPUT);
}

void loop() // run over and over
{
  if (mySerial.available() > 0) {  //Check if there is a Byte waiting to be read
		incomingByte = mySerial.read();    //Set the "incomingByte" to the incoming GPS byte
		if (gps.gprmc_status() == 'A') {  //If the GPS is active
                  Serial.print("Time:");
                  Serial.print(gps.gprmc_utc);
                  Serial.print("Longitude:");
                  Serial.print(gps.gprmc_longitude);
                  Serial.print("Latitude:");
                  Serial.print(gps.gprmc_latitude);
                  Serial.println("End of Statement");     
                }
                else {
                  Serial.println ("Program initialising, Please wait");
                  
        }
  }
}

I get error message:

In file included from NMEA_attempt.cpp:2:
C:\Users\wms\Desktop\Applications\arduino-1.0\libraries\NMEA/nmea.h:24:24: error: WConstants.h: No such file or directory
NMEA_attempt.cpp: In function 'void loop()':
NMEA_attempt:22: error: no matching function for call to 'HardwareSerial::print(<unresolved overloaded function type>)'
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:52: note: candidates are: size_t Print::print(const __FlashStringHelper*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:53: note:                 size_t Print::print(const String&)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:54: note:                 size_t Print::print(const char*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:55: note:                 size_t Print::print(char)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:56: note:                 size_t Print::print(unsigned char, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:57: note:                 size_t Print::print(int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:58: note:                 size_t Print::print(unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:59: note:                 size_t Print::print(long int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:60: note:                 size_t Print::print(long unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:61: note:                 size_t Print::print(double, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:62: note:                 size_t Print::print(const Printable&)
NMEA_attempt:24: error: no matching function for call to 'HardwareSerial::print(<unresolved overloaded function type>)'
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:52: note: candidates are: size_t Print::print(const __FlashStringHelper*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:53: note:                 size_t Print::print(const String&)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:54: note:                 size_t Print::print(const char*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:55: note:                 size_t Print::print(char)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:56: note:                 size_t Print::print(unsigned char, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:57: note:                 size_t Print::print(int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:58: note:                 size_t Print::print(unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:59: note:                 size_t Print::print(long int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:60: note:                 size_t Print::print(long unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:61: note:                 size_t Print::print(double, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:62: note:                 size_t Print::print(const Printable&)
NMEA_attempt:26: error: no matching function for call to 'HardwareSerial::print(<unresolved overloaded function type>)'
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:52: note: candidates are: size_t Print::print(const __FlashStringHelper*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:53: note:                 size_t Print::print(const String&)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:54: note:                 size_t Print::print(const char*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:55: note:                 size_t Print::print(char)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:56: note:                 size_t Print::print(unsigned char, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:57: note:                 size_t Print::print(int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:58: note:                 size_t Print::print(unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:59: note:                 size_t Print::print(long int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:60: note:                 size_t Print::print(long unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:61: note:                 size_t Print::print(double, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:62: note:                 size_t Print::print(const Printable&)

With this as a header:
"no matching function for call to ‘HardWareSerial::print()’

WConstants.h is part of version 0023, not 1.0. You will have to extract this header from the 0023 installation and port it into 1.0.

Looks like that is a pre-1.0 library? Try using Arduino 0022 perhaps? Or find an up-to-date version of the library.

ajofscott: WConstants.h is part of version 0023, not 1.0. You will have to extract this header from the 0023 installation and port it into 1.0.

Could you give me some basic instruction on how to do that? Thanks for all your help, -B.

I have moved all headers that existed in arduino 23, and moved them into their apropriate places in the arduino 1 folder. When I verify to code, it still gives me an error message. Message is:

In file included from C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Arduino.h:6,
                 from NMEA_attempt.cpp:4:
c:/users/wms/desktop/applications/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'
c:/users/wms/desktop/applications/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
c:/users/wms/desktop/applications/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
NMEA_attempt.cpp: In function 'void loop()':
NMEA_attempt:22: error: no matching function for call to 'HardwareSerial::print(<unresolved overloaded function type>)'
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:52: note: candidates are: size_t Print::print(const __FlashStringHelper*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:53: note:                 size_t Print::print(const String&)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:54: note:                 size_t Print::print(const char*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:55: note:                 size_t Print::print(char)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:56: note:                 size_t Print::print(unsigned char, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:57: note:                 size_t Print::print(int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:58: note:                 size_t Print::print(unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:59: note:                 size_t Print::print(long int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:60: note:                 size_t Print::print(long unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:61: note:                 size_t Print::print(double, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:62: note:                 size_t Print::print(const Printable&)
NMEA_attempt:24: error: no matching function for call to 'HardwareSerial::print(<unresolved overloaded function type>)'
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:52: note: candidates are: size_t Print::print(const __FlashStringHelper*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:53: note:                 size_t Print::print(const String&)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:54: note:                 size_t Print::print(const char*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:55: note:                 size_t Print::print(char)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:56: note:                 size_t Print::print(unsigned char, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:57: note:                 size_t Print::print(int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:58: note:                 size_t Print::print(unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:59: note:                 size_t Print::print(long int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:60: note:                 size_t Print::print(long unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:61: note:                 size_t Print::print(double, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:62: note:                 size_t Print::print(const Printable&)
NMEA_attempt:26: error: no matching function for call to 'HardwareSerial::print(<unresolved overloaded function type>)'
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:52: note: candidates are: size_t Print::print(const __FlashStringHelper*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:53: note:                 size_t Print::print(const String&)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:54: note:                 size_t Print::print(const char*)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:55: note:                 size_t Print::print(char)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:56: note:                 size_t Print::print(unsigned char, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:57: note:                 size_t Print::print(int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:58: note:                 size_t Print::print(unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:59: note:                 size_t Print::print(long int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:60: note:                 size_t Print::print(long unsigned int, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:61: note:                 size_t Print::print(double, int)
C:\Users\wms\Desktop\Applications\arduino-1.0\hardware\arduino\cores\arduino/Print.h:62: note:                 size_t Print::print(const Printable&)

This error message comes with a header:
"no matching function to call to ‘HardwareSerial::print()’

Also, The NMEA library can be found here http://www.maartenlamers.com/nmea/

The headers needed to go to the project directory, not the IDE's includes folder. Now you will have to restore the 1.0 installation.

I downloaded a fresh copy of 0023, and installed the NMEA library onto it. I loaded up the sample code, and got this error message when I tried to verify the code:

In file included from C:\Users\wms\Desktop\Applications\arduino-0023\hardware\arduino\cores\arduino/WProgram.h:6,
                 from gprmc_position.cpp:14:
c:/users/wms/desktop/applications/arduino-0023/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'
c:/users/wms/desktop/applications/arduino-0023/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
c:/users/wms/desktop/applications/arduino-0023/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'

With heading: Error compiling.

Thanks for being such a great arduino translator, -B.

Please attach all source files, the pde, the library headers and cpp files. zip all into a single file if you can.

ajofscott gave you bad advice in reply #1 (sorry, aj).

You now need to do a new install of 1.0, and then edit the library that tries to include WConstants.h, and make it include Arduino.h, instead.

@Paul he has math.h errors even under ver 0023 if you read his latest error report.

ajofscott: Please attach all source files, the pde, the library headers and cpp files. zip all into a single file if you can.

Couldn't figure out how to attach the ZIP. Its only a copy of 0023 with the NMEA library installed from the website stated previously.

First you need to change the follow line from the nmea.h and nmea.cpp files for using arduino 1.0 IDE

#include <WProgram.h>

to this

#if (ARDUINO >= 100)
#include <Arduino.h> // for byte data type
#else
#include <WProgram.h>
#endif

next your errors in the loop() function was this
Serial.print(gps.gprmc_utc()); need to add

void loop() // run over and over
{
  if (mySerial.available() > 0) {  //Check if there is a Byte waiting to be read
		incomingByte = mySerial.read();    //Set the "incomingByte" to the incoming GPS byte
		if (gps.gprmc_status() == 'A') {  //If the GPS is active
                  Serial.print("Time:");
                  Serial.print(gps.gprmc_utc());
                  Serial.print("Longitude:");
                  Serial.print(gps.gprmc_longitude());
                  Serial.print("Latitude:");
                  Serial.print(gps.gprmc_latitude());
                  Serial.println("End of Statement");     
                }
                else {
                  Serial.println ("Program initialising, Please wait");
                  
        }
  }
}

Thanks for your help, in what program should I change the .h file?

EDIT: I edited them in microsoft text editor, and saved it as .h, and .ccp

EDIT2: I opened up the example program and verifyied the code. Error message:

gprmc_position.cpp:11:18: error: nmea.h: No such file or directory
gprmc_position.pde:-1: error: 'NMEA' does not name a type
gprmc_position.cpp: In function 'void loop()':
gprmc_position.pde:-1: error: 'gps' was not declared in this scope

with heading: 'NMEA' does not name a type

Don't bother editing anything else until you correct this problem:

gprmc_position.cpp:11:18: error: nmea.h: No such file or directory

You have not downloaded, unzipped, and/or installed the NMEA library correctly. Trying to fix any other problems is a waste of time.

PaulS: Don't bother editing anything else until you correct this problem:

gprmc_position.cpp:11:18: error: nmea.h: No such file or directory

You have not downloaded, unzipped, and/or installed the NMEA library correctly. Trying to fix any other problems is a waste of time.

Solved that issue:

In file included from C:\Users\wms\Desktop\Applications\arduino-0023\hardware\arduino\cores\arduino/WProgram.h:6,
                 from gprmc_position.cpp:14:
c:/users/wms/desktop/applications/arduino-0023/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'
c:/users/wms/desktop/applications/arduino-0023/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
c:/users/wms/desktop/applications/arduino-0023/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'

What code is at line 14?

What version of the IDE are you using?

ajofscott: What code is at line 14?

It was the example code, "GPRMC_position"