From 0ba9d21fb3295cf6aff3826a4d1efa18466dd1c3 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Wed, 13 Jun 2018 02:02:23 +0200 Subject: [PATCH] wait if not configured --- src/main.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fa15621..3470f63 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -185,15 +185,16 @@ void setup() { iot.mqtt.onMessage(onMqttMessage); iot.mqtt.setWill(sensorTopic.c_str(), 0, false, "OFFLINE"); -/* - while (iot.wifi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - screen->draw(); + + // Wait here if not configured + if (iot.configuration.get("WifiConfigured") != "True") { + while (iot.wifi.status() != WL_CONNECTED) { + delay(500); + Serial.print("."); + screen->draw(); + } } - onWiFiConnect(); -*/ strcpy(state.timeStr, "--:--:--"); if (alarmclock.isNight()) { @@ -235,7 +236,7 @@ void onWiFiConnect() { } } - udp.beginMulticast(udpMulticastAddress, udpMulticastPort); +/* udp.beginMulticast(udpMulticastAddress, udpMulticastPort);*/ }