Get GPS coordinates

1

I currently have a module 808 .
My query is whether to get the GPS location with this module I just need to use the AT commands, or I can use libraries like TinyGPS .

I currently have this code:

#include <SoftwareSerial.h>
#include <TinyGPS.h>

long lat,lon;
SoftwareSerial SIM808(7, 8);

TinyGPS gps;

void setup(){
  Serial.begin(19200);
  SIM808.begin(19200);
  Serial.print("GPS START");
}

void loop() {
  gps.encode(SIM808.read());
  gps.get_position(&lat, &lon);
  Serial.print("Position: ");
  Serial.print("lat "); Serial.prntln(lat);
  Serial.print("lon "); Serial.prntln(lon);
  delay(500);
}

But I can not get the coordinates right, and I do not know if it's because only with AT commands work.

    
asked by AndreyC1995 01.12.2017 в 18:16
source

1 answer

1

I have conducted tests with the sim 808 indoors and I have no problems I recommend using the AT commands first to verify the operation of your card.

perform the verification commands for your pin

AT+CPIN?
AT+CPIN=XXXX LAS "X" SON TU NÚMERO PIN DE LA SIM CELULAR
AT+IPR=19200
AT+CMGF=1 ACTIVA MODO TEXTO
AT+CMGR=1 ACTIVA RECEPTOR DE MENSAJES
AT+CNMI=2,2,0,0 ACTIVA VISUALIZACION DE MENSAJES
AT+ CGPSPWR=1 ACT GPS ORI
AT+CGNSTST=1 ACT GPS OCCI
AT+CGPSSTATUS?
AT+CGNSINF
    
answered by 17.04.2018 в 05:08