Will Adafruit's GPS Library work with Adafruit Bluefruit

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rgbjork
 
Posts: 9
Joined: Sun Aug 09, 2015 11:05 am

Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by rgbjork »

I'm trying to find a Arduino with a small form factor ( at most 1 inch in one dimension) that will work with the GPS Ultimate breakout. I had started with RFDuino but that uses an ARM processor which is incompatible with Adafruit's GPS Library. Can anyone tell be if I can expect the GPS library to compile and run on Bluefruit(same processor as Leonardo and Flora)? I'm looking at this MCU because of its small form factor and (not as important) integrated bluetooth.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by adafruit_support_rick »

You mean this one?
https://www.adafruit.com/product/2661

Yes, the GPS library will work with that.

User avatar
rgbjork
 
Posts: 9
Joined: Sun Aug 09, 2015 11:05 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by rgbjork »

Thanks

User avatar
swca
 
Posts: 10
Joined: Wed Mar 25, 2015 8:22 pm

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by swca »

Hi rgbjork and Rick,

I am trying to use the Adafruit GPS with RFDuino. Where did you find out that Adafruit GPS Library will not work with RFDuino? I thought it should work because it is Arduino environment.

I also tried the RFduinoNonBLE > Communication > SerialEvent example. I was able to get some data to print out once if I called Serial.print() within SerialEvent(), but it is not printing to serial monitor without modifying example code.

The Adafruit GPS is receiving 3.3V in, with connection to RFDuino RX->RX and TX->TX.

User avatar
rgbjork
 
Posts: 9
Joined: Sun Aug 09, 2015 11:05 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by rgbjork »

I believe you aren't using the Arduino processor if you connect the GPS receiver directly to RX and TX. It think only when you connect to other GPIO pins and compile and run an example, like 'parsing', do you find the trouble. Compiling for RFDuino results in a "SoftwareSerial.h not found". When I comment out this Include, I get a problem when I upload to RFDuino. - I get a message suggesting that the processor is wrong. The documentation on Adafruit's GPS says that it runs with boards that use the Atmel processor. RFDuino has an ARM processor - I think that's the reason. The GPS libraries and compiled binaries for the Atmel processor.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by adafruit_support_rick »

The Adafruit_GPS library includes a couple of examples for the Arduino Due. These sketches are set up to use the Due's hardware Serial1, and do not reference SoftwareSerial. Perhaps you can adapt them to use the hardware serial on your RFDuino.

User avatar
rgbjork
 
Posts: 9
Joined: Sun Aug 09, 2015 11:05 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by rgbjork »

I tried the 'due_parsing' with RFDuino as target board and got the following when compiling:
due_parsing.ino:23:18: error: 'Serial1' was not declared in this scope
due_parsing.ino:25:19: note: in expansion of macro 'mySerial'
due_parsing.ino: In function 'void setup()':
due_parsing.ino:23:18: error: 'Serial1' was not declared in this scope
due_parsing.ino:47:3: note: in expansion of macro 'mySerial'

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by adafruit_support_rick »

You will have to substitute whatever the RFduino uses for hardware serial for "Serial1"

User avatar
rgbjork
 
Posts: 9
Joined: Sun Aug 09, 2015 11:05 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by rgbjork »

A slightly modified version of "due_parsing" compiles and uploads succesfully to RFDuino but there is no reading's from the GPS device. I tried changing Serial1 to Serial(9600,2,3) (my understanding is ARM M0 core allow any GPIO's have Serial capability).
So I modified due_parsing setup code to the following:
#define mySerial Serial

Adafruit_GPS GPS(&mySerial);


// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences.
#define GPSECHO true

// this keeps track of whether we're using the interrupt
// off by default!
boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy

void setup()
{

// connect at 115200 so we can read the GPS fast enough and echo without dropping chars
// also spit it out
Serial.begin(57600);
Serial.println("Adafruit GPS library basic test!");

// 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
GPS.begin(9600);
Serial.begin(9600,2,3);

// uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
//GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
// uncomment this line to turn on only the "minimum recommended" data
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
// For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since
// the parser doesn't care about other sentences at this time
...

What I get on the serial monitor is the following:

Adafruit GPS library basic test!
$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29
$PMTK220,1000*1F
$PGCMD,33,1*6C
$PMTK605*31

Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0

Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0

...

No GPS data.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by adafruit_support_rick »

So, the PMTK commands that are supposed to be going to the GPS are going to Serial Monitor instead. You can't use Serial for the GPS. You have to use a different serial port.

I don't know anything about RFDuino. Does it have a second UART? Does it support SoftwareSerial?

Which RFduino module have you got?

How is the GPS connected to it?

User avatar
rgbjork
 
Posts: 9
Joined: Sun Aug 09, 2015 11:05 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by rgbjork »

It doesn't support Software serial. I have the GPS connected to pins corresponding to GPIO 2 and 3. The default is 0 and 1.
That is why I tried the following:
...
GPS.begin(9600);
Serial.begin(9600,2,3);
...

There is only one UART on the RFDuino. Its been suggest that one can switch the assignment between ports in a sort of time share of the UART:
That's correct only 1 UART on the module, however depending on how you are using it, you could switch the UART back and forth between different GPIOs as needed:

Serial.begin(9600); //uart on GPIO 0, 1
do something here
Serial.end();

Serial.begin(9600, 2, 3); //uart on GPIO 2, 3
do something here
Serial.end();

I haven't tried this. Do you think this could be a solution?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Will Adafruit's GPS Library work with Adafruit Bluefruit

Post by adafruit_support_rick »

rgbjork wrote:I haven't tried this. Do you think this could be a solution?
I hope so. Otherwise, I don't think you have a solution.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”