From bde1b9b36f4f7978a736fec4c9ed8b92b0a7ea60 Mon Sep 17 00:00:00 2001 From: Ronald Schaten Date: Tue, 22 Mar 2016 00:31:36 +0100 Subject: [PATCH] show configuration via HTTP --- things.ino | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/things.ino b/things.ino index 1b5ebbd..3749e51 100644 --- a/things.ino +++ b/things.ino @@ -417,6 +417,22 @@ void setup() { delay(100); }); + http_server.on("/config", [](){ + read_sensor(); + DynamicJsonBuffer jsonBuffer; + JsonObject& json = jsonBuffer.createObject(); + json["mqtt_server"] = mqtt_server; + json["mqtt_port"] = mqtt_port; + json["mqtt_topic"] = mqtt_topic; + json["capability_dht"] = capability_dht; + json["capability_ldr"] = capability_ldr; + json["capability_rgb"] = capability_rgb; + String response; + json.printTo(response); + http_server.send(200, "text/plain", response); + delay(100); + }); + // start the web server http_server.begin(); Serial.println("HTTP server started");