Que tal Foreros:
Creo este post debido a que surgió algo extraño en mis lecturas del GPS, quizá ustedes puedan ayudarme con esto..
HARDWARE:
- ARDUINO NANO.
- GPS NEO 6 M V2.
Tengo un GPS realizando simples lecturas de posición, añado aquí mi code:
#include <TinyGPS.h>
#include <SoftwareSerial.h>
TinyGPS gps;
SoftwareSerial serialgps(4,3);
char dato=' ';
char lat[10];
char lon[10];
String ObLat;
String ObLon;
String msgTx[] = {};
char msgGPSTx[] = {};
void setup()
{
serialgps.begin(9600);
Serial.begin(115200);
}
void loop()
{
gpsPos();
}
void gpsPos(){ // LISTO
while(serialgps.available())
{
int c = serialgps.read();
if(gps.encode(c))
{
float latitude, longitude;
gps.f_get_position(&latitude, &longitude);
//Serial.print("Latitud/Longitud: ");
//Serial.print(latitude,5);
//Serial.print(", ");
//Serial.println(longitude,5);
if(dtostrf(latitude,5,5,lat))
{
ObLat = lat;
}
if(dtostrf(longitude,5,5,lon))
{
ObLon = lon;
}
msgTx[25] = ObLat + ',' + ObLon;
msgTx[25].toCharArray(msgGPSTx,25);
Serial.println(msgGPSTx);
}
}
}
Estoy utilizado la libreria TinyGPS, como podrán ver, pero las lecturas son las siguientes:
13:15:21.267 -> 14.23451,-200.43484
13:15:21.403 -> 14.23451,-200.43484
13:15:22.286 -> 14.23451,-200.43484
13:15:22.388 -> 14.23451,-200.43484
13:15:23.268 -> 14.23451,-200.43484
13:15:23.401 -> 14.23451,-200.43484
13:15:24.281 -> ⸮⸮⸮⸮
13:15:24.382 -> ⸮⸮⸮⸮
13:15:25.271 -> ⸮⸮⸮⸮
13:15:25.375 -> ⸮⸮⸮⸮
13:15:26.259 -> ⸮⸮⸮⸮
13:15:26.394 -> ⸮⸮⸮⸮
13:15:27.282 -> ⸮⸮⸮⸮
13:15:27.384 -> ⸮⸮⸮⸮aaaaa
13:15:28.270 -> ⸮⸮⸮⸮
13:15:28.372 -> ⸮⸮⸮⸮
13:15:29.252 -> ⸮⸮⸮⸮
13:15:29.387 -> ⸮⸮⸮⸮
13:15:30.274 -> ⸮⸮⸮⸮
13:15:30.375 -> ⸮⸮⸮⸮
13:15:31.257 -> ⸮⸮⸮⸮
13:15:31.394 -> ⸮⸮⸮⸮
13:15:32.278 -> 14.23451,-200.43484
13:15:32.381 -> 14.23451,-200.43484
13:15:33.268 -> 14.23451,-200.43484
Hasta que llega un punto en el que ya no toma más posición..
Alguna idea chicos???
De antemano agradezco quién pueda apoyarme.