Error after 4 connections

Hi all

I'm having an issue with mkr1010. After 4 succesfull connections, the board did not continue sending info. The process is done, but no info is received

Anyone could help to me?

Thank's

///////////////////////////////////////////////////////////////Libraries definition//////////////////////////////////////////////////////
#include <ArduinoLowPower.h>
#include <ArduinoHttpClient.h>
#include <DallasTemperature.h>
#include "Wire.h"
#include <ArduinoJson.h>
#include <SPI.h>
#include <WiFiNINA.h>

#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)


int status = WL_IDLE_STATUS;
WiFiClient client;




void setup() {

  ///////////////////POWER LINES PIN///////////////////////////
  pinMode(7, OUTPUT);
}
void loop() {

  digitalWrite(LED_BUILTIN, HIGH);
  ///////////////////////////////////////////////////////////////Power ON Lines//////////////////////////////////////////////////////

  digitalWrite(7, HIGH);
  Serial.begin(9600);
  delay(3000);
  //////////////READING sensor///////////////////////////////////////



  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  ///////////////////////////////////////////////////////////////WIFI SENDING MESSAGE///////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  StaticJsonBuffer<300> jsonBuffer;
  JsonObject& root = jsonBuffer.createObject();
  root["dot"] = "wifi01";

  JsonObject& data = root.createNestedObject("data");
  data.set("5", xxxxx);
  data.set("6", xxxxx);



  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }

  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");
  Serial.print("Posting data");
  Serial.println("");
  root.printTo(Serial);
  postToTBD(root);
  delay(5000);



  digitalWrite(LED_BUILTIN, LOW);
  delay(rebootTime);
  //LowPower.sleep(rebootTime);


}
void dummy() {
  volatile int aaa = 0;
}

where is postToTBD()?

is in another tab, see the code below

void postToTBD(JsonObject& data) {
  dataStr = "";
  data.printTo(dataStr);
  httpClient.beginRequest();
  httpClient.post(path);
  httpClient.sendHeader("Content-Type", "application/json");
  httpClient.sendHeader("Content-Length", data.measureLength());
  httpClient.sendHeader("Authorization", "Bearer "  + String(device_secret_key));
  httpClient.beginBody();
  httpClient.print(dataStr);
  httpClient.endRequest();
}

Try adding a httpClient.stop()

I still miss the code where you create and stop the HttpClient

sandeepmistry:
Try adding a httpClient.stop()

It WORKS!!!! thank youuuuuuuuuu

@ecabanas, can you post all your code, please?