Hi guys, I want to make a GPS tracker and wondering if it is possibile to connect to UNO 2 devices by softwareSerial. I Have M8M gps module, which is connected to pins (3, 4) and SIM800 to (7,8).
I can read parameters from NMEA messages like att. long. lat. with TinyGPS+ library. But how I can send this data through SIM800, using gprs, to my tcp/ip server?
I've started with something like this:
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
TinyGPSPlus gps;
String atCommand;
SoftwareSerial ss(3, 4);
SoftwareSerial gsm(7, 8);
void setup() {
Serial.begin(9600);
ss.begin(9600);
gsm.begin(9600);
}
void loop()
{
if (gps.altitude.isUpdated())
{
Serial.print(("\n alt[m]=\t")); Serial.print(gps.altitude.meters());
Serial.print(F("\n latt=")); Serial.println(gps.location.lat(), 6);
Serial.print(F("\n lng=")); Serial.println(gps.location.lng(), 6);
Serial.print(F("\n time ")); Serial.println(gps.time.value());
Serial.print("\n ----------------------------------------------------------------------");
delay(1000);
}
if (gsm.available())
Serial.write(gsm.read());
if (Serial.available())
gsm.write(Serial.read());
}
But I can't read gps data now, only comunicate with SIM800 with AT commands.
Is it even possible to combine this?