Bonjour
J'essaie de récupérer des valeurs envoyés par ma passerelle de panneaux solaires Enphase
mais je doit avoir un problème lorsque j'affiche le JSON avec la commande : ReadLoggingStream loggingStream(client, Serial); il me retourne la valeur : 5bb
est ce que qq un a une idée ?
vous remerciant
mon code
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
while (!Serial) continue;
delay(1000);
Serial.println(F("Connecting..."));
// Connect to HTTP server
WiFiClient client;
client.setTimeout(10000);
if (!client.connect("10.101.83.211", 80)) {
Serial.println(F("Connection failed"));
return;
}
Serial.println(F("Connected!"));
// Send HTTP request
client.println(F("GET /production.json HTTP/1.1"));
client.println(F("Host: 10.101.83.211"));
client.println(F("Connection: close"));
if (client.println() == 0) {
Serial.println(F("Failed to send request"));
client.stop();
return;
}
// Check HTTP status
char status[32] = {0};
client.readBytesUntil('\r', status, sizeof(status));
// It should be "HTTP/1.0 200 OK" or "HTTP/1.1 200 OK"
if (strcmp(status, "HTTP/1.1 200 OK") != 0) {
Serial.print(F("Unexpected response: "));
Serial.println(status);
client.stop();
return;
}
// Skip HTTP headers
char endOfHeaders[] = "\r\n\r\n";
if (!client.find(endOfHeaders)) {
Serial.println(F("Invalid response"));
client.stop();
return;
}
ReadLoggingStream loggingStream(client, Serial);
StaticJsonDocument<48> filter;
filter["consumption"][0]["wNow"] = true;
StaticJsonDocument<128> doc;
DeserializationError error = deserializeJson(doc, loggingStream);