From 82c50d3fd9c39adad8d7e15d6ea397ad3c748f10 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 20:17:09 +0700 Subject: [PATCH] add wifi library and code diagnostic --- waterishos-gen2-mesh/waterishos-gen2-mesh.ino | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino index a95702f..5985609 100644 --- a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino +++ b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino @@ -1,3 +1,25 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "settings.h" #include #include @@ -5,22 +27,12 @@ // |----------------------------------| // | SIWAT INC | // |----------------------------------| -#define FIRMWARE_ID 0x1337 -#define FIRMWARE_VER "0.1" -wifi_conn networks[] = {WIFI_CONN("ssid 1", "Password", NULL, 0),WIFI_CONN("ssid 2", "Another Password", NULL, 0),NULL,}; - String ID = String(ESP.getChipId()); - - - - 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(); +ESP8266MQTTMesh mesh = ESP8266MQTTMesh::Builder(networks, mqtt_server, mqtt_port).setMqttAuth(mqtt_user, mqtt_password).setVersion(FIRMWARE_VER, FIRMWARE_ID).setMeshPassword(mesh_password).setMeshSSID(mesh_ssid).build(); void callback(const char *topic, const char *msg); - - void setup() { Serial.begin(115200); delay(1000); @@ -38,9 +50,6 @@ void loop() { cnt++; } } - - - void callback(const char *topic, const char *msg) { Serial.print(topic); Serial.print(msg);