fixed some things and tried to convert it into str

main
thunic 3 years ago
parent 75b53350c2
commit 8c1f352fbd

@ -33,7 +33,7 @@ def add_sensordata():
now = datetime.now() now = datetime.now()
timestamp = {"timestamp":now} timestamp = {"timestamp":str(now)}
sensordata.update(timestamp) sensordata.update(timestamp)

@ -89,9 +89,9 @@ void loop() {
DynamicJsonDocument doc(2048); DynamicJsonDocument doc(2048);
// Add values in the document // Add values in the document
doc["temperature"] = temperature; doc["temperature"] = String(temperature);
doc["moisture"] = moisture; doc["moisture"] = String(moisture);
doc["humidity"] = humidity; doc["humidity"] = String(humidity);
String requestBody; String requestBody;
serializeJson(doc, requestBody); serializeJson(doc, requestBody);

Loading…
Cancel
Save