I can't validate an AT command. Would anyone have any suggestions as to what I might be doing wrong? It should be printing "Sending successful! or "Sending failed!", but it doesn't show any text.
if (httpReadResponse.indexOf("OK") != -1) {
Serial.println("Envio bem-sucedido!");
} else {
Serial.println("Falha no envio!");
}
My serial monitor is printing this:
AT+HTTPDATA=192,5000\ DOWNLOAD\ OK\ AT+HTTPACTION=0\ OK\ AT+HTTPREAD
Full function:
void sendHttpRequest(int distance_cm) {
gsm_send_serial("AT+HTTPINIT");
gsm_send_serial("AT+HTTPPARA=CID,1");
gsm_send_serial("AT+HTTPSSL=1");
gsm_send_serial("AT+HTTPPARA=URL," + url2 + "/" + distance_cm + "/" + id_cliente + "/" + id_caixa + "/" + ipadd1 + "/" + sinal + "/" + totalMilliLitres + "/" + vazao_atual + "/" + apikey);
gsm_send_serial("AT+HTTPPARA=CONTENT,application/x-www-form-urlencoded");
gsm_send_serial("AT+HTTPDATA=192,5000");
gsm_send_serial("param=Aqualizar");
gsm_send_serial("AT+HTTPACTION=0");
String httpReadResponse = gsm_send_serial("AT+HTTPREAD");
gsm_send_serial("AT+HTTPTERM");
if (httpReadResponse.indexOf("OK") != -1) {
Serial.println("Sending successful!");
} else {
Serial.println("Sending failed!");
}
}