Good evening
im new to arduino
and im working in project which need to combine both GSM and GPS libraries together
my project is to send the location via sms after activating the push button
im using adafruit GPS
Could you please assist me on that
combine GPS and GSM
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: combine GPS and GSM
What you want to do is possible, but you'll need to be a bit careful about writing the code.
Both the GPS module and the FONA use Serial/UART communication, and an Arduino Uno only has one hardware Serial port. There are several libraries that emulate Serial connections in software, but getting more than one to work at the same time is a hard problem to solve.
The FONA library uses Mikal Hart's NewSoftSerial library, which solves a slightly easier version of the problem: you can have as many NewSoftSerial connections as you want, but only one can be active at any time. You use the .listen() function to make one connection active and temporarily disable all the others, and any job that can work with the devices taking turns will work.
Our GPS library also uses NewSoftSerial, so it's compatible with the FONA library.
This page has information about using the NewSoftSerial library:
http://arduiniana.org/libraries/newsoftserial/
We have tutorials for both the GPS module and the FONA:
https://learn.adafruit.com/adafruit-ultimate-gps
https://learn.adafruit.com/adafruit-fon ... e/overview
And this page from the FONA tutorial explains how to send SMS:
https://learn.adafruit.com/adafruit-fon ... d-read-sms
Both the GPS module and the FONA use Serial/UART communication, and an Arduino Uno only has one hardware Serial port. There are several libraries that emulate Serial connections in software, but getting more than one to work at the same time is a hard problem to solve.
The FONA library uses Mikal Hart's NewSoftSerial library, which solves a slightly easier version of the problem: you can have as many NewSoftSerial connections as you want, but only one can be active at any time. You use the .listen() function to make one connection active and temporarily disable all the others, and any job that can work with the devices taking turns will work.
Our GPS library also uses NewSoftSerial, so it's compatible with the FONA library.
This page has information about using the NewSoftSerial library:
http://arduiniana.org/libraries/newsoftserial/
We have tutorials for both the GPS module and the FONA:
https://learn.adafruit.com/adafruit-ultimate-gps
https://learn.adafruit.com/adafruit-fon ... e/overview
And this page from the FONA tutorial explains how to send SMS:
https://learn.adafruit.com/adafruit-fon ... d-read-sms
- HeliosPrime
- Posts: 38
- Joined: Mon Mar 02, 2015 12:28 am
Re: combine GPS and GSM
Thank you! That was driving me nuts.
Please be positive and constructive with your questions and comments.