From 5dfab5613f1c18d6846aab5bc4f06ca68fb80919 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 12 Aug 2019 16:54:22 +0700 Subject: [PATCH] Update WaterishOS-core2.0.ino --- WaterishOS-core2.0/WaterishOS-core2.0.ino | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/WaterishOS-core2.0/WaterishOS-core2.0.ino b/WaterishOS-core2.0/WaterishOS-core2.0.ino index 7e76a05..bccc29d 100644 --- a/WaterishOS-core2.0/WaterishOS-core2.0.ino +++ b/WaterishOS-core2.0/WaterishOS-core2.0.ino @@ -87,10 +87,12 @@ void setup() { delay(500); if (connectionattempt >= 60) { writelcd(" Cannot Connect"," Going Offline!"); - delay(3000); online = false; } } + String wifiname(ssid); + if(online)writelcd(" WiFi Connected",wifiname); + delay(3000); writelcd("Boot Sequence P3"," Loading Kernel"); attachInterrupt(digitalPinToInterrupt(1), readA, FALLING); attachInterrupt(digitalPinToInterrupt(3), readB, FALLING); @@ -112,7 +114,15 @@ void setup() { delay(2000); writelcd("Waterish OS a3.9","Reading Sensors"); delay(1000); - + writelcd("Telemetry Control","siwatsystem.com"); + if (client.connect("waterishos")) { + writelcd("Telemetry Control","Connected"); + delay(1000); + } else { + writelcd("Telemetry Control"," Failed Offline"); + online=false; + delay(3000); + } datacollector.onRun(collectdata); datacollector.setInterval(1000); if(online)mqttupdater.onRun(updatemqtt);