diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 9c53d41..bd11200 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -27,18 +27,23 @@ void mqttCallback(char *topic, const uint8_t *payload, unsigned int length) { memcpy(message, payload, length); *(message + length) = 0; Log.printf("MQTT received: topic=\"%s\", message=\"%s\"\n", topic, message); - if (strcmp(message, "reboot") == 0) { - Log.printf("rebooting...\n"); - delay(500); - mqtt.disconnect(); - delay(500); - EspClass::restart(); + if (strcmp(message, "help") == 0) { + Log.printf("HELP\n"); + Log.printf(" %s\n", "help"); + Log.printf(" %s\n", "info"); + Log.printf(" %s\n", "reboot"); } else if (strcmp(message, "info") == 0) { Log.printf("INFO\n"); Log.printf(" %-10s %s\n", "SSID:", WiFi.SSID().c_str()); Log.printf(" %-10s %s\n", "IP:", WiFi.localIP().toString().c_str()); Log.printf(" %-10s %d\n", "RSSI:", WiFi.RSSI()); Log.printf(" %-10s %s\n", "uptime:", uptimeString().c_str()); + } else if (strcmp(message, "reboot") == 0) { + Log.printf("rebooting...\n"); + delay(500); + mqtt.disconnect(); + delay(500); + EspClass::restart(); } }