I have issues with ESP32 PubsClient.h where i am publishing some 768 arrays. Here is my below snippet.
StaticJsonDocument<1000> doc;
doc["device"] = "ESP32";
doc["sensor"] = "IR";
JsonArray data = doc.createNestedArray("data");
for (int i = 0; i < 768; i++) {
data.add(dataArray[i]);
}
char JSONmessageBuffer[1200];
serializeJson(doc, JSONmessageBuffer);
Serial.println(JSONmessageBuffer);
if (client.publish(MQTT_IR, JSONmessageBuffer) == true) {
Serial.println("Success sending message");
} else {
Serial.println("Error sending message");
}
Issue is i am only able to send max of 59 data points. If i try to increase the StaticJsonDocument - i run into runtime issues. Pls suggest me how i can send my 768 data pints.