I've now discovered there's not a whole lot of documentation or guidance. It says it communicates on pins 11 and 12 via software serial, but the board doesn't even connect to those pins.
So I'm confused and hoping someone can point me to a link to study, or give me a hint on how to start. I'm assuming the GPS bee is putting out the standard GPS strings, and once I get a good serial connection I'll be able to parse those pretty easily.
I have their Xbee Shield (v1.1) and to my understanding the on-board switches simply connect/disconnect the UART of the attached device (Xbee or Xbee-GPS). Temporarily 'disconnecting' the UART of the attached device allows you to upload sketches without removing the shield. (At least that's how I've always used it.)
Looking at the board... the only Arduino pins that have traces to them are 1 & 2. I have no idea why they claim soft serial capabilities, as the traces just aren't there (and it physically only has pin connections to pins 1-7).
I use the Xbee on pins 1/2 (as, in my understanding, you really have no other choice with this Shield), and then send debug information to an LCD via SoftSerial port on other pins.
I normally put them in "left-left" setting to UL sketches (which the chart claims remaps them to pins 11/12 - but unless it's using some sort of "magic-fairly-dust-air-transfer", we know this isn't possible). Then I put the switches in "right-right" when I'm running the sketch and want data from them on pins 1/2.
Hope this helps a bit, and I won't be offended in the least if someone is able to point out additional settings/functionality of this shield.
They say it uses Pin 11 and 12 through the ISP header. I looked that up and did see a reference to 3 pins from the ISP corresponding to digital pins 11-13. I haven't had a chance to try it yet, but I intend to use newsoftserial to listen to those pins and see if the GPS bee is sending anything.
Well I gave it a shot. I wrote the code below that I think should listen to pin 11. It didn't send any data to the serial monitor meaning it didn't show up as available. Did I do anything obvious wrong in my code?
I wonder if the GPS bee needs to be initialized or configured in some fashion, or if it should just start pumping out NMEA sentences...
#include <NewSoftSerial.h>
int ledPin = 13; // LED test pin
int rxPin = 11; // RX PIN
int txPin = 12; // TX TX
int GPSbyte=-1;
NewSoftSerial GPS = NewSoftSerial(rxPin, txPin);
void setup() {
pinMode(ledPin, OUTPUT); // Initialize LED pin
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
Serial.begin(9600); // Open comm with serial monitor
Serial.println("Serial comm initiated"); // Print a test line
GPS.begin(9600); // Open serial comm with xbee
}
void loop() {
digitalWrite(ledPin, HIGH); // Turn on LED 13
while (GPS.available())
{
GPSbyte = GPS.read(); // Read a byte from the xbee
Serial.print(GPSbyte, BYTE); // Print the read byte to serial monitor
}
Serial.println("---"); // Line return
digitalWrite(ledPin, LOW); // Turn off LED 13
delay(100);
}
They say it uses Pin 11 and 12 through the ISP header.
Ahh, yes - it sure does, and I'm rather embarrassed by my oversight.
I haven't used the GPS Bee, so I'm not sure if there's an initialization command. Some GPS's have an enable line that you need to pull high to turn them on. Also, the datasheet for that GPS states the baud rate is 9600 when BUS Powered, and 38400 when Self Powered. I'm not sure how its configured in the GPS Bee config so you may want to verify the baud rate.
You might try looking through the GPS tutorial on LadyAda's website. Its specific to a different GPS and shield, but you might be able to simply change the code to reflect the pins that you're using. GPS datalogging shield for Arduino
Thanks! In hindsight I should have just bought LadyADA's gps shield. I thought the u-blox5 chip in the GPS Bee was one of the best, so I got it thinking it had to be easy to configure and operate.
I tried the code you suggested, substituting pins 11 and 12. I didn't find anything in the u-blox documentation about pulling a pin low but the xbee shield wouldn't give me the chance to do that anyway. Nothing happened when I ran it.
So I either need a new clue or I bought a rather expensive tie-tack.
Thanks a bunch for responding to me though. I do appreciate it!
Forgive me for posing a couple strange questions. Is it possible the U-Blox 5 gps module will not work (send ANY data) if an antenna is not attached?
Second, I get the suspicion that the GPS Bee was put together without a lot of testing. Is it possible they slapped that chip on there and never determined if it was working properly with the Xbee shield?