If i change code he not give any value.
Response have this data:
14:14:26.894 -> AT+HTTPTERM
14:14:26.894 -> OK
14:14:37.874 -> +HTTPACTION: 2,200,710
14:14:37.874 -> +CNSMOD: 0,8
14:14:37.874 -> OK
14:14:37.874 -> LTE
14:14:54.040 -> AT+CSQ
14:14:54.040 -> +CSQ: 18,99
After when i try check
if(response.indexOf("+HTTPACTION: 2,200") > 0) {
he return val = 2 because it after checking signal quality. response for CSQ i make every 10 seconds, response from +HTTPACTION: 2,200 - every 20 seconds.
void checksimsignal() {
delay(10000);
SIM7670Serial.print("AT+CNSMOD?\r\n");
String response = SIM7670Serial.readString();
Serial.println(response);
char* pch; //string pointer
char message[20];
response.toCharArray(message, 20);
pch = strtok(message, delim);
if (strncmp(pch,"+CSQ",4) == 0) {
pch = strtok(NULL, delim);
// parse it to an integer
int val = atoi(pch);
Serial.println(val);
}
Not show any data.
Next code to check https status
void ltehttpshead() {
delay(15000);
SIM7670Serial.print("AT+HTTPACTION=2\r\n");
String response = SIM7670Serial.readString();
Serial.println(response);
if(response.indexOf("+HTTPACTION: 2,200") > 0) {
// Call connected
Serial.println("Its worked");
}
if i change string to if (strncmp(pch,"+CSQ",4) != 0) {
he show val = 2
I want to check +CSQ and +HTTPACTION: 2,200 and other like gps\gnss. I try to change response sting to another, but how i think all data spins in SIM7670Serial.readString(); and i need somehow separate them by name, otherwise it parses all the lines.