I have the code below and it doesn't work with my URL. I receive a
715(Handshake Failed)
This code below works normally, but with my API it doesn't work.
I'm using a A7670SA with Arduino Mega 2560.
My API is on Heroku and uses an Automated Certificate Management by Heroku, that uses the Let's Encrypt.
String sendATCommand(String command, String expectedResponse = "", unsigned long timeout = 5000) {
Serial1.println(command);
Serial.println("Command send: " + command);
unsigned long startTime = millis();
String response = "";
while (millis() - startTime < timeout) {
if (Serial1.available() > 0) {
char c = Serial1.read();
response += c;
}
}
response.replace(command, "");
Serial.println(response);
delay(500);
return response;
}
void setup() {
Serial.begin(115200);
while (!Serial)
;
delay(1000);
Serial1.begin(115200);
sendATCommand("AT", "OK");
sendATCommand("AT+CGREG?");
sendATCommand("AT+CGDCONT=1,\"IP\",\"claro.com.br\"", "OK");
sendATCommand("AT+HTTPINIT"); // Iniciar ambiente HTTP
sendATCommand("AT+HTTPPARA=\"URL\",\"https://httpbin.org/\"");
sendATCommand("AT+HTTPACTION=0", "OK", 1000);
sendATCommand("AT+HTTPREAD?");
sendATCommand("AT+HTTPTERM", "OK");
}
void loop() {}
Greenonline
3,1527 gold badges36 silver badges48 bronze badges
-
what is your specific question?jsotola– jsotola03/31/2024 17:59:32Commented Mar 31, 2024 at 17:59