Open carlestecno opened 5 months ago
This is part of the code:
`#include
SoftwareSerial mySerial(16, 17);
String check_gps; String check_coordinates; String check_att; String check_att_dos; String check_conn; String check_pdp;
int count_gps = 0; int count_coordinates = 0; int value_boton = 0; int flag = 0;
String coordinates, lat, lng; String mac = "a9g";
void setup() { // put your setup code here, to run once: Serial.begin(115200); mySerial.begin(9600); pinMode(4, INPUT); //sendData("AT+RST=2", 1000, DEBUG); // per posar el mòdul en consum baix check_gps = sendData("AT+GPS=1", 1000, DEBUG); //sendData("AT+GPSRD=20", 1000, DEBUG); }
void loop() { // put your main code here, to run repeatedly: if (check_gps.indexOf("OK") != -1) { count_gps = 1; Serial.println("GPS connectat"); } else { Serial.println("Intentant connectar-se"); check_gps = sendData("AT+GPS=1", 1000, DEBUG); } if (count_gps == 1) { if (count_coordinates == 0) { coordinates = sendData("AT+LOCATION=2", 2000, DEBUG); Serial.print("at + location: "); Serial.println(coordinates); if(coordinates.indexOf("OK") != -1)`
I will try outside. I'm close to the window but perhaps I need to be outside. Thanks
I think the problem was to be inside and not outside