Pokhraj
October 26, 2017, 10:02am
1
Hi ,
I have one GPS module which is connected to arduino board RX=2 pin TX=3 pin.
One GSM module which is connected to arduino board pin 9[TX of GSM], pin 10 [RX of GSM].
At my sketch I am including the above four pins like below:
#include <SoftwareSerial.h>
SoftwareSerial mygps(3,2)
SoftwareSerial mygsm(10,9)
I am getting compilation error. Am I doing any mistake?
Thanks-
Pokhraj
system
October 26, 2017, 10:20am
3
Do you intend to listen to the GPS or the GSM? Both is the wrong answer. Only one instance of SoftwareSerial can listen at a time. Data sent to the pins that the other instance is monitoring evaporates in the ether.
Pokhraj
October 26, 2017, 10:25am
4
I am listening from GSM . I want to send the NMEA data received from GPS by using GSM shield to the TCP server.
Please advice.
Thanks-
Pokhraj
system
October 26, 2017, 10:49am
5
I am listening from GSM . I want to send the NMEA data received from GPS by using GSM shield to the TCP server.
If you are listening to the GSM, and it receives a request for GPS data, you will have no data from the GPS to give it.
You REALLY need an Arduino with multiple hardware serial ports. One for the GPS, one for the GSM, and one for debugging. That means a Mega or a Due.
pert
October 26, 2017, 7:51pm
6
I found the information under the "Serial Port Options" section of this page helpful:
https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html