0
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #15 on: September 10, 2008, 06:16:16 am » |
So this code works on the Hardware Serial (UART) just change the Baundrate and set your GPS to send the data in GPRMC Thanks GekoCH although I can't get the latest code to work. I put the baudrate to 4800 and I also tried putting the following code into the setup function: pinMode(2, INPUT); pinMode(3, OUTPUT);
|
|
|
|
|
Logged
|
|
|
|
|
Switzerland
Offline
Sr. Member
Karma: 0
Posts: 261
|
 |
« Reply #16 on: September 11, 2008, 03:25:05 am » |
I told you it does just work on the UART port. Connect the GPS pin to Arduino Pin 0 (RX).
I haven't tried it with the SoftwareSerial (pin 2 or pin 3)
Would be strange if it doesn't work... What kind of Sentence does your GPS send?
Geko
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 7
Arduino rocks
|
 |
« Reply #17 on: September 11, 2008, 04:22:34 am » |
Geko, thank you so much for you assistance and help on this topic! It is much appreciated by me.
I have looked into the remarks in this thread shortly, and believe that nearly all problems are caused because the example programs were written for Wiring, not Arduino! I do not have an Arduino, and as a result, I didn't know that there is no port "Serial1" on Arduino.
I will write new example code, and try it on an actual Arduino this weekend. Will then post an update on this thread and inform you how to download the new example code. I'm pretty sure it will work fine then.
thanks for your feedback and patience, Maarten
|
|
|
|
|
Logged
|
|
|
|
|
Switzerland
Offline
Sr. Member
Karma: 0
Posts: 261
|
 |
« Reply #18 on: September 11, 2008, 04:27:01 am » |
Geko, thank you so much for you assistance and help on this topic! It is much appreciated by me.
I have looked into the remarks in this thread shortly, and believe that nearly all problems are caused because the example programs were written for Wiring, not Arduino! I do not have an Arduino, and as a result, I didn't know that there is no port "Serial1" on Arduino.
I will write new example code, and try it on an actual Arduino this weekend. Will then post an update on this thread and inform you how to download the new example code. I'm pretty sure it will work fine then.
thanks for your feedback and patience, Maarten Thx a lot Maarten Yes I think there are some bugs in the Library but he core code does work for me. Just some tiny bits do not work! Thx again for your great work! Geko
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #19 on: September 11, 2008, 05:05:32 am » |
GekoCH, I told you it does just work on the UART port. Connect the GPS pin to Arduino Pin 0 (RX). OK, this won't work for me as I have a GPS/GPRS shield that sits directly on top of the Arduino and uses pins 2 and 3. Maarten, thanks that would be great!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 7
Arduino rocks
|
 |
« Reply #20 on: September 11, 2008, 05:57:47 am » |
OK, this won't work for me as I have a GPS/GPRS shield that sits directly on top of the Arduino and uses pins 2 and 3. I am aware that the example code does not work (yet) via Arduino pins 2 and 3. However, I'm hoping to borrow an Arduino this weekend and write some new example code that uses "SoftwareSerial" on those two pins. I have no reason to assume that would not work. Maarten
|
|
|
|
« Last Edit: September 11, 2008, 06:04:18 am by maartenl »
|
Logged
|
|
|
|
|
Switzerland
Offline
Sr. Member
Karma: 0
Posts: 261
|
 |
« Reply #21 on: September 11, 2008, 06:22:03 am » |
But as you know the SoftwareSerial is quite slow or better it does need a lot of power and that slows the Arduino down. I got some experience in this. I do now parse the Gps sentence at 5hz on the UART so the Hardware Serial on pin 0. I think as your program grows Software Serial is going to be a problem. And at 5hz the Software Serial is relay struggling getting the data and parse them...
Geko
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 7
Arduino rocks
|
 |
« Reply #22 on: September 11, 2008, 07:14:55 am » |
I wasn't really aware that SoftwareSerial was much slower than Serial, but I trust that it is. This may indeed be limiting to the number of sentences the library can process per second. However, this not only depends on the frequency of NMEA cycles (for example 1 Hz, or 5 Hz), but also on the number of sentences output per cycle. If you are only using a particular sentence type (for example GPRMC or GPGGA), then some GPS receivers let you choose to only output those sentence types. This will considerably speed-up processing.
Also, I would think that the library as-it-is does not require much processing, but only at the moment when a GPRMC sentence was completed: at that moment it does a lot of floating-point stuff.
Maarten
|
|
|
|
« Last Edit: September 11, 2008, 07:15:58 am by maartenl »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 20
Arduino rocks
|
 |
« Reply #23 on: October 17, 2008, 12:27:49 pm » |
Hi Maarten,
Any progress with the Arduino port of the NMEA library? It works fine with the Wiring IDE though.
Keep up the good work.
thanks, Madhu.
|
|
|
|
|
Logged
|
|
|
|
|
Korea
Offline
Newbie
Karma: 0
Posts: 20
Arduino rocks
|
 |
« Reply #24 on: October 18, 2008, 06:55:40 am » |
I'm looking forward to Maarten's progress too.
And I got some success(? )
with Arduino and NMEA library , I connected GPS to HW serial and AFSoftSerial to the PC It works ^^ (<- smiling eyes. kind of Korean emoticon. korean emoticon is upright style. can you understand it? ) But programming is some hassle --; (<- cold sweating ?)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 4
Arduino rocks
|
 |
« Reply #25 on: October 26, 2008, 07:06:53 am » |
Any idea of how to connect the arduino BT to a BT GPS receiver? this is the closest I've read to a BT connection other than a computer: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1180546719 :-[
|
|
|
|
« Last Edit: October 26, 2008, 07:09:27 am by busstopArduino »
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 103
Arduino rocks
|
 |
« Reply #26 on: November 03, 2008, 06:41:04 pm » |
How is the arduino port coming along? I am looking foward to this 
|
|
|
|
|
Logged
|
|
|
|
|
Salem, Oregon
Offline
Full Member
Karma: 0
Posts: 175
Arduino rocks but sometimes it rolls
|
 |
« Reply #27 on: December 12, 2008, 04:57:15 am » |
I'm not sure why anybody is waiting for a "port" to the Arduino - the NMEA library works out of the box for me. I think the example programs are what needs to be modified. I grabbed the provided example to show all sentences and modified two or three lines - it worked fine for me. Here is the modified code, but my contribution wasn't much. Oh yeah, you'll need the AFSoftSerial library (since the normal software serial doesn't have an avaliable function). // This example illustates access to all sentence types, // using the NMEA library. It assumes that a GPS receiver // is connected to serial port 'Serial1' at 4800 bps.
#include <nmea.h> #include <AFSoftSerial.h>
// Constants #define rxPin 9 #define txPin 8
// set up the serial port
AFSoftSerial mySerial = AFSoftSerial(rxPin, txPin);
// variables NMEA gps(ALL); // GPS data connection to all sentence types
void setup() { Serial.begin(9600); mySerial.begin(4800); }
void loop() { if (mySerial.available() > 0 ) { // read incoming character from GPS and feed it to NMEA type object if (gps.decode(mySerial.read())) { // full sentence received Serial.print ("Sentence = "); Serial.println (gps.sentence()); Serial.print ("Datatype = "); Serial.println (gps.term(0)); Serial.print ("Number of terms = "); Serial.println (gps.terms()); } } }
Hope this helps, Brad. [edit]I've seen a reference somewhere on the forum that this library has a large memory footprint - perhaps that's the problem people are seeing? I've upgraded to the 328P, so maybe that's why I don't see a problem?[/edit]
|
|
|
|
« Last Edit: December 12, 2008, 07:24:26 pm by bradb »
|
Logged
|
|
|
|
|
Austin, TX USA
Offline
God Member
Karma: 3
Posts: 992
Arduino rocks
|
 |
« Reply #28 on: December 18, 2008, 11:51:31 pm » |
I've seen a reference somewhere on the forum that this library has a large memory footprint - perhaps that's the problem people are seeing? I've upgraded to the 328P, so maybe that's why I don't see a problem? I think your assessment is correct, Brad. Creating a single NMEA object allocates ~1200 bytes of RAM, which is probably great for the 328P, but a little too big to fit in a "conventional" Arduino. I am working on a derivative library called TinyGPS that provides a subset of NMEA's functionality but is much smaller. It provides latitude, longitude, time, date, course, speed, and magnetic variation -- everything that the $GPRMC sentence provides. I would welcome suggestions on whether this would suffice for a majority of users. Mikal
|
|
|
|
« Last Edit: December 19, 2008, 12:01:30 am by mikalhart »
|
Logged
|
|
|
|
|
Salem, Oregon
Offline
Full Member
Karma: 0
Posts: 175
Arduino rocks but sometimes it rolls
|
 |
« Reply #29 on: December 20, 2008, 01:24:18 am » |
It provides latitude, longitude, time, date, course, speed, and magnetic variation -- everything that the $GPRMC sentence provides. I would welcome suggestions on whether this would suffice for a majority of users. Mikal- I'm not sure what everybody else needs, but I think it would be fine for my purposes (I haven't looked, but I think that's enough information to plot my location on google maps). Since I'm passing the data via XBee using API mode, I'm limited to a payload of 72 bytes (once I get the code sorted out) so simple is really better. I'm looking forward to your library. Brad.
|
|
|
|
|
Logged
|
|
|
|
|
|