2 serial connections: 1 to GPS and other to Serial Monitor?
Posted: Sun Jun 14, 2015 3:02 am
I have an MTK3339 (G.top010) GPS [1] that I'm trying to connect to the esp8266. It uses a serial bus to communicate its coordinates.
I'd like to be able to listen to the serial data from the GPS, and send it back to my laptop via Serial Monitor--in other words, I have two simultaneous serial connections going on in the main loop. From what I've seen, this is fairly simple [2] with the SoftwareSerial library on a regular Arduino mcu:
AFAICT, there is no analogous SoftwareSerial library available for the esp8266? Lacking that, I tried a hardware serial with "Serial.swap()" in the main loop, hoping I could read on one pair of pins (13, 15) and read/write on another (3, 1). So far, no dice (it freezes up after several loops).
Are there any libraries that could help me accomplish this dual serial comms task? Any other approaches I could consider?
Thanks,
Duane
[1] http://www.aliexpress.com/item/Gms-hpr- ... 92334.html
[2] http://www.jarzebski.pl/arduino/kompone ... eo6-m.html
I'd like to be able to listen to the serial data from the GPS, and send it back to my laptop via Serial Monitor--in other words, I have two simultaneous serial connections going on in the main loop. From what I've seen, this is fairly simple [2] with the SoftwareSerial library on a regular Arduino mcu:
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial GPS(3, 1); // RX, TX
void setup()
{
Serial.begin(115200);
while (!Serial) { }
GPS.begin(9600);
}
void loop()
{
if (GPS.available())
{
Serial.write(GPS.read());
}
}
AFAICT, there is no analogous SoftwareSerial library available for the esp8266? Lacking that, I tried a hardware serial with "Serial.swap()" in the main loop, hoping I could read on one pair of pins (13, 15) and read/write on another (3, 1). So far, no dice (it freezes up after several loops).
Are there any libraries that could help me accomplish this dual serial comms task? Any other approaches I could consider?
Thanks,
Duane
[1] http://www.aliexpress.com/item/Gms-hpr- ... 92334.html
[2] http://www.jarzebski.pl/arduino/kompone ... eo6-m.html