Browse code

Minor change: am adaugat posibilitatea de reset via MQTT

Liviu Pislaru authored on 28/02/2018 21:16:10
Showing 1 changed files
... ...
@@ -180,7 +180,15 @@ void getMessage(char* topic, byte* payload, unsigned int length) {
180 180
       client.publish(mqttTEMP, json.c_str(),TRUE);
181 181
       Serial.println(json);
182 182
   }  
183
-
183
+// reset la ESP
184
+  if (mqttMessage == "reset")
185
+  {
186
+      String lastwords="Am fost resetat ...";
187
+      client.publish(mqttESP, lastwords.c_str(), TRUE);
188
+      delay (3000);
189
+      ESP.reset();
190
+      delay (5000);
191
+  }
184 192
 // procedura de software update via WEB
185 193
    if (mqttMessage == "update")
186 194
    {