From 6faf903b4cb6c5d74bb5290e387cb3eec332a9a1 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 12:42:34 +0000 Subject: [PATCH 1/9] Update readme.md --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index e69de29..2b25d48 100644 --- a/readme.md +++ b/readme.md @@ -0,0 +1 @@ +Work in Progress \ No newline at end of file -- 2.40.1 From 300df0380818e1e84867a9f5a07ecdba0d25250e Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 19:51:02 +0700 Subject: [PATCH 2/9] branding --- waterishos-gen2-mesh/waterishos-gen2-mesh.ino | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino index c122ded..9e3abd4 100644 --- a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino +++ b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino @@ -2,7 +2,9 @@ #include #include - +// |----------------------------------| +// | 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,}; @@ -15,19 +17,16 @@ String ID = String(ESP.getChipId()); unsigned long previousMillis = 0; const long interval = 5000; int cnt = 0; - -// Note: All of the '.set' options below are optional. The default values can be -// found in ESP8266MQTTMeshBuilder.h -ESP8266MQTTMesh mesh = ESP8266MQTTMesh::Builder(networks, mqtt_server, mqtt_port).setVersion(FIRMWARE_VER, FIRMWARE_ID).setMeshPassword(mesh_password).build(); - -void callback(const char *topic, const char *msg); +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 setup() { Serial.begin(115200); - delay(1000); //This is only here to make it easier to catch the startup messages. It isn't required + delay(1000); mesh.setCallback(callback); mesh.begin(); @@ -35,23 +34,13 @@ void setup() { void loop() { - - - if (! mesh.connected()) - return; - + if (! mesh.connected())return; unsigned long currentMillis = millis(); - if (currentMillis - previousMillis >= interval) { - - String cntStr = String(cnt); - String msg = "hello from " + ID + " cnt: " + cntStr; - mesh.publish(ID.c_str(), msg.c_str()); + mesh.publish("", msg.c_str()); previousMillis = currentMillis; cnt++; - } - } -- 2.40.1 From 1abc8bc03ca0912f70733e6d624e02f97b21401f Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 19:53:07 +0700 Subject: [PATCH 3/9] 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++; } -- 2.40.1 From 82c50d3fd9c39adad8d7e15d6ea397ad3c748f10 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 20:17:09 +0700 Subject: [PATCH 4/9] 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); -- 2.40.1 From f43bc9bc5b036baee78759522a0c744849fb31fd Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 20:25:15 +0700 Subject: [PATCH 5/9] uplaod first error free source --- waterishos-gen2-mesh/waterishos-gen2-mesh.ino | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino index 5985609..2f1f1db 100644 --- a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino +++ b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino @@ -1,3 +1,8 @@ +#include +#include +#include +#include +#include #include #include #include @@ -23,7 +28,7 @@ #include "settings.h" #include #include - +wifi_conn networks[] = {WIFI_CONN(wifi_ssid, wifi_password, NULL, 0),NULL}; // |----------------------------------| // | SIWAT INC | // |----------------------------------| @@ -35,6 +40,7 @@ ESP8266MQTTMesh mesh = ESP8266MQTTMesh::Builder(networks, mqtt_server, mqtt_port void callback(const char *topic, const char *msg); void setup() { Serial.begin(115200); + Serial.print("Loading . . ."); delay(1000); mesh.setCallback(callback); mesh.begin(); -- 2.40.1 From 4310f55d05a0a05d0356e7aedbf6bc117e3b312f Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 20:26:40 +0700 Subject: [PATCH 6/9] add debug serial print --- waterishos-gen2-mesh/waterishos-gen2-mesh.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino index 2f1f1db..5287242 100644 --- a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino +++ b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino @@ -43,7 +43,9 @@ void setup() { Serial.print("Loading . . ."); delay(1000); mesh.setCallback(callback); + Serial.print("Callback set done"); mesh.begin(); + Serial.print("Mesh Started"); } -- 2.40.1 From 6e78cdf9e38462e4039dc80e750066fac8169c8e Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 20:37:28 +0700 Subject: [PATCH 7/9] no message --- waterishos-gen2-mesh/waterishos-gen2-mesh.ino | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino index 5287242..c834b41 100644 --- a/waterishos-gen2-mesh/waterishos-gen2-mesh.ino +++ b/waterishos-gen2-mesh/waterishos-gen2-mesh.ino @@ -50,12 +50,9 @@ void setup() { void loop() { - if (! mesh.connected())return; - unsigned long currentMillis = millis(); - if (currentMillis - previousMillis >= interval) { - mesh.publish("/test","test"); - previousMillis = currentMillis; - cnt++; + if (! mesh.connected()){ + Serial.print("Mesh Disconnected"); + return; } } void callback(const char *topic, const char *msg) { -- 2.40.1 From a9f1904db9fa06c4a1e56a3b242c027564e389a4 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 13:38:38 +0000 Subject: [PATCH 8/9] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 2b25d48..ee139b8 100644 --- a/readme.md +++ b/readme.md @@ -1 +1 @@ -Work in Progress \ No newline at end of file +STATE: ABDN \ No newline at end of file -- 2.40.1 From 8ac8c5080223ac74c0ccae5d622577fe565ec1d6 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 21 Aug 2019 13:41:40 +0000 Subject: [PATCH 9/9] Update readme.md --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index ee139b8..0da7c41 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,2 @@ -STATE: ABDN \ No newline at end of file +**STATE: DEVELOPMENT HALTED** +All Node that is running beta version should revert back to the revison 3 of the 1st generation firmware without mesh (https://git.siwatsystem.com/projects/WAT/repos/waterishos-revision3.0x) as the 2nd generation firmware may have man in the middle 802.11 Handshake intercept attack vulnerability. \ No newline at end of file -- 2.40.1