More messages than expected on application server.
-
@Martijn-Kooijman I tried AT+CSGT but only ERROR as a return value (also with the serialpassthrough script). I can’t set it either: AT+CSGT=1,“test” for example.
So I have no clue how I should be able to test when it is fine to start.
I include the relevant code here, that my help understanding my power and “delay time” problems. I have no clue how I should do this modem greetings test to get rid of these excessive delays which consume power.#include <MKRNB.h>
#include <ArduinoLowPower.h>
#define LOG true
#define l(x) if (LOG) Serial.println(x);
#define DELAY (15 * 1000) //default 15 s
#define TIMEOUT (5 * 1000) //default 5 s
unsigned long baud = 115200;
String response;
// connection state
boolean notConnected = true;void setup() {
// enable the POW_ON pin SARA module
pinMode(SARA_PWR_ON, OUTPUT);
digitalWrite(SARA_PWR_ON, HIGH);// reset the ublox module
pinMode(SARA_RESETN, OUTPUT);
digitalWrite(SARA_RESETN, HIGH);
delay(100);
digitalWrite(SARA_RESETN, LOW);
Serial.begin(baud);
SerialSARA.begin(baud);
}
Loop{
delay(16000); //wait for SARA module to get ready (>65mA)
//do some measurements
cmd(“AT+USOCR=17,7000”); //opens a port
delay(4000); //need to wait here also
cmd(“AT+USOST=0,“172.27.131.100”,15683,16” //it returns “@”
cmd(payload);
digitalWrite(SARA_PWR_ON, LOW);
LowPower.sleep(900000); //(10 mA with modem on, 1.2 mA with modem off)
digitalWrite(SARA_PWR_ON, HIGH);
}
/**- Send AT command to u-blox module
*/
String cmd(String cmd) {
l("cmd: " + cmd);
SerialSARA.println(cmd);
int timeout = TIMEOUT;
while (!SerialSARA.available() & timeout > 0) {
timeout–;
delay(1);
}if (timeout == 0 || timeout < 0) {
l(“Timed out”);
return “”;
}String result = “”;
do {
result += char(SerialSARA.read());
delay(5);
} while(SerialSARA.available());l("rsp: " + result);
return result;
} - Send AT command to u-blox module
-
@Martijn-Kooijman I tried AT+CSGT but only ERROR as a return value (also with the serialpassthrough script). I can’t set it either: AT+CSGT=1,“test” for example.
So I have no clue how I should be able to test when it is fine to start.AT+CSGT=1 works fine on my u-blox R4, I guess it’s not supported on your older firmware. You can try monitoring the V_INT signal, that will tell you if the module is in low power mode or not and may also tell you if the module is ready to receive commands
-
@Martijn-Kooijman I solved it by checking the return message after sending “AT+USOCR=17,7000”. Once it is contains “+USOCR: 0” in the returning string I know it is ok:
(it takes about 5 s after a reset)
added code:String check_sara=cmd("AT+USOCR=17,7000"); while ((check_sara.indexOf("+USOCR: 0",1)<0)) { delay(500); check_sara=cmd("AT+USOCR=17,7000"); Serial.println(check_sara);//just for checking }