1

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
asked Mar 31, 2024 at 15:02
1
  • what is your specific question? Commented Mar 31, 2024 at 17:59

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.