Open PsySc0rpi0n opened 1 day ago
i see similar result in case i respond before its 2s result : AT+CGPS? +CGPS: 0,1 OK AT+CGPS=1 OK AT+CGPS? +CGPS: 1,1 --------if respond fast AT+CGPS? +CGPS: 1,1 OK AT+CGPS=0 --- This Put OK AT+CGPS? +CGPS: 1,1 ---- wrong result as respond before 2s OK +CGPS: 0 ---- prev command response i think AT+CGPS? +CGPS: 0,1 ---- now it works..
in AT Command module note: After the GPS closed, it should to wait about 2s~30s for start again. Reason: If the signal conditions are right (strong enough signals to allow ephemeris demodulation) or ephemeris demodulation is on going, sometimes MGP will stay on longer in order to demodulate more ephemeris. This will help the engine provide faster TTFF and possibly better yield later (up to 2 hours), because it has the benefit of more ephemeris available. https://m2msupport.net/m2msupport/atcgps-start-stop-gps-session/
Yes, I also read about that note. But I also tried to wait longer than that period of time and it was still not working. So, I issued a AT+CFUN
command to restart the modem, and after that I was able to start/stop GPS sessions almost freely! Like almost immediately one after the other! So, I have no idea what was keeping the GPS session stuck.
I'l still leave this issue open so that we can still discuss about it in the next days, if needed!
As a side note, I did something like this to wait for the modem response before issuing new AT command:
bool sendATCommand (const char* command, const char* expectedResponse,
unsigned long timeout){
SerialAT.println (command);
unsigned long startTime = millis();
String response = "";
while (millis() - startTime < timeout){
while (SerialAT.available()){
char c = SerialAT.read();
response += c;
if (response.indexOf(expectedResponse) != -1){
Serial.print("Response: "), Serial.println(response);
return true;
}
}
}
Serial.println("Timeout for response...");
return false;
}
Hello.
I'm using the example code from here and after the device is ready to take AT commands, it seems that I cannot stop the GPS session.
This is what I get:
So, for some reason I cannot get the GPS session to stop. Why is this? Any common reason?