General

Arduino UNO + GPS/GPRS/GSM Module V3.0 -> switch between GPS/GSM

userHead deathiii 2014-04-24 09:30:27 7475 Views6 Replies

Hi,

i'm a new arduino user trying to do something like:

- Use the GPS mode to get the current location (coordinates) and compare it with a known one (static, defined in the code), if it's there (or relatively near), the module should switch to GSM mode and send a SMS saying that it arrived at the expected position.

Where I'm at:

- I can successfully use the code "How to Send a message" in GSM Mode via Arduino board (it can send the given message and it is delivered);

- I can successfully use the code "How to drive the GPS Mode via Arduino board" (it shows me the current coordinates like it should).
(both available at http://www.dfrobot.com/wiki/index.php/G ... U:TEL0051))

Problem:

- Can't combine the codes mentioned above. I've tried but apparently i fail to switch between the GPS and GSM mode like i need too, the START green led should be lit between the switch? It goes off when i disable the GPS and enable the GSM...

Any help will be appreciated,
Thanks in advance!
 

2014-05-22 21:05:38 Has anyone tried both the GPS and GSM on BLUNO? Any links or guides? userHeadPic visualxl
2014-04-30 12:46:22 Hi again, sorry but I've been kinda busy... Grey tell me something.. since the Arduino Mega has 4 serial ports, can't i just use that one? Again, I'm really just a beginner trying to learn something xD the thing is, if i can use the Mega, what Serial should i use for debug(Serial Monitor) and what Serial should i use to communicate with the GPS/GSM Shield?

Thanks!!
userHeadPic deathiii
2014-04-25 21:47:32 Welcome deathiii,

Try this code, might give you some ideas:
https://github.com/DFRobot/GPS-GPRS-GSM ... RS_GPS.ino

Cheers!
userHeadPic Jose
2014-04-25 19:29:19 Yes, the code is for the Leonardo.
But you could try a SoftwareSerial port first.
To bend the RX/TX pins and make sure they are disconnecting to the RX0/TX0 when you plug the shield on the board. With a jumper wire to connect them to the SoftwareSerial port.
It will just like a Leonardo.
userHeadPic Grey.CC
2014-04-25 11:52:36 Thanks Grey, but isn't there a problem with using an Arduino UNO with that code? Since the UNO only has one Serial port available... Well maybe i could try to change it to use just one Serial port... Anyway I've got access to a Arduino Mega 2560, maybe it should work with that one?

Again thanks for the tip :P
userHeadPic deathiii
2014-04-24 20:10:53 Hello deathiii,

As you has seen the  the code "How to drive the GPS Mode via Arduino board"
You must will notice the last sample code: GPS Sample Code
There are two parts in the sample code: one is the library, one is the code.
It will make module work at two modes.
You could try it first.
userHeadPic Grey.CC