From 1abc8bc03ca0912f70733e6d624e02f97b21401f Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 19:53:07 +0700 Subject: [PATCH] code cleanup --- waterishos-gen2-mesh/waterishos-gen2-mesh.ino | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino index 9e3abd4..a95702f 100644 --- a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino +++ b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino @@ -18,18 +18,14 @@ unsigned long previousMillis = 0; const long interval = 5000; int cnt = 0; ESP8266MQTTMesh mesh = ESP8266MQTTMesh::Builder(networks, mqtt_server, mqtt_port).setMqttAuth(mqtt_user, mqtt_password).setVersion(FIRMWARE_VER, FIRMWARE_ID).setMeshPassword(mesh_password).build(); -, -void callback(const char *topic, const char *msg); //define initial callback - +void callback(const char *topic, const char *msg); void setup() { - Serial.begin(115200); delay(1000); mesh.setCallback(callback); mesh.begin(); - } @@ -37,7 +33,7 @@ void loop() { if (! mesh.connected())return; unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= interval) { - mesh.publish("", msg.c_str()); + mesh.publish("/test","test"); previousMillis = currentMillis; cnt++; }