gasagna / A76XX

Arduino library for the A76XX family of SIMCOM cellular modules, with native MQTT(S), HTTP(S), etc, clients!
MIT License
6 stars 1 forks source link

Https POST "Failed to read Body error -2" #5

Open karrisaiteja opened 2 months ago

karrisaiteja commented 2 months ago

I was using the string body and added all the data for the post. I don't know what I am missing, getting the "Failed to read Body error -2"

body content:

  String moisture_raw =String("12");  
  String moisture_percentage = String("34");
  String payload = "{ \\\"moisture_raw\\\": \\\"" + moisture_raw + "\\\", \\\"moisture_percentage\\\": \\\"" + moisture_percentage + "\\\" }";
  String body = "{ \"UUID\": \"00000000-0000-0000-0000-987654321\", \"Tag\": \"Sensor\", \"Payload\": \"" + payload + "\" }";

Function were I am getting the error:

if (http_client.getResponseBody(body) == false) { Serial.print("Failed to read body. Code: "); Serial.println(http_client.getLastError()); }

Recived response : 706

gasagna commented 1 month ago

Hi,

Apologies for the late reply. The A76XX documentation says that error 706 corresponds to "Receive/send socket data failed". This does not seem an issue with the library, but perhaps with how the module connects to the http server you are using.

Have you encountered the issue with other applications or by using another http server?