Closed Yash1903 closed 3 years ago
Hi @Yash1903,
Please explain what the problem is.
Best regards, Benoit
thank you for Replay @bblanchon , i have 2 question 1) in above Program run ArduinoJson 5.13.5 run completely but i modify to Arduinojson V6 then show me bytes instead of sensor data. 2) can i send whole data.json file to Mqtt ? if yes then can you share example of it. or How to write,append and read .json file in Arduinojson v6
Hi,
Best regards, Benoit
hello @bblanchon I try example of JsonConfigFile.ino..but Shaw me Error..
Failed to initialize SD library
how i can resolve this Error ??
and other SD example run Completely
This is not a problem related to ArduinoJson. Please compare the working examples with the non-working one to see how they differ.
hello @bblanchon
`#include
include
include
include
SoftwareSerial s(14,12);
include
const char ssid = "LIMELIGHT LAB"; const char password = "TATA@123"; const char mqttServer = "vernemq.limelightit.io"; const int mqttPort = 1883; //const char mqttUser = "yourInstanceUsername"; //const char* mqttPassword = "yourInstancePassword";
WiFiClient espClient; PubSubClient client(espClient);
void setup() { // Initialize Serial port Serial.begin(115200); s.begin(115200); // while (!Serial) continue;
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.println("Connecting to WiFi.."); }
Serial.println("Connected to the WiFi network");
client.setServer(mqttServer, mqttPort);
while (!client.connected()) { Serial.println("Connecting to MQTT...");
} } void loop() { StaticJsonDocument<300> doc; DeserializationError error = deserializeJson(doc,s); if (error) { Serial.print("deserializeJson() failed");
}
serializeJson(doc,Serial); Serial.println("Sending message to MQTT topic.."); Serial.println();
if (client.publish("esp/test",serializeJson(doc,Serial)) == true) { Serial.println("Success sending message"); } else { Serial.println("Error sending message"); }
client.loop(); Serial.println("-------------");
delay(2000); }`