diff --git a/docs/use/gateway.md b/docs/use/gateway.md index 7cf9425..76f2e5f 100644 --- a/docs/use/gateway.md +++ b/docs/use/gateway.md @@ -165,8 +165,8 @@ The pre-built binaries for **rfbridge** and **avatto-bakeey-ir** have the above The gateway can support up to 3 LED to display its operating state: * LED_INFO switched ON when network and MQTT connection are OK -5s ON, 5s OFF when WIFI is disconnected -1s ON, 4s OFF when MQTT is disconnected +5s ON, 5s OFF when MQTT is disconnected +2s ON, 2s OFF when NETWORK is disconnected * LED_RECEIVE Blink for `TimeLedON` 1s when the gateway receive a signal from one of its module so as to send to MQTT diff --git a/main/ZsensorGPIOInput.ino b/main/ZsensorGPIOInput.ino index 3bc1a5f..6922e31 100644 --- a/main/ZsensorGPIOInput.ino +++ b/main/ZsensorGPIOInput.ino @@ -64,7 +64,7 @@ void MeasureGPIOInput() { if (reading == LOW) { if (resetTime == 0) { resetTime = millis(); - } else if ((millis() - resetTime) > 10000) { + } else if ((millis() - resetTime) > 3000) { Log.trace(F("Button Held" CR)); Log.notice(F("Erasing ESP Config, restarting" CR)); setup_wifimanager(true); diff --git a/main/main.ino b/main/main.ino index c4b223e..b0d2b5c 100644 --- a/main/main.ino +++ b/main/main.ino @@ -328,7 +328,6 @@ void pub(const char* topicori, JsonObject& data) { String dataAsString = ""; serializeJson(data, dataAsString); Log.notice(F("Send on %s msg %s" CR), topicori, dataAsString.c_str()); - SendReceiveIndicatorON(); String topic = String(mqtt_topic) + String(gateway_name) + String(topicori); #if valueAsATopic # ifdef ZgatewayPilight @@ -417,6 +416,7 @@ void pubMQTT(const char* topic, const char* payload) { */ void pubMQTT(const char* topic, const char* payload, bool retainFlag) { if (client.connected()) { + SendReceiveIndicatorON(); Log.trace(F("[ OMG->MQTT ] topic: %s msg: %s " CR), topic, payload); #if AWS_IOT client.publish(topic, payload); // AWS IOT doesn't support retain flag for the moment @@ -424,7 +424,7 @@ void pubMQTT(const char* topic, const char* payload, bool retainFlag) { client.publish(topic, payload, retainFlag); #endif } else { - Log.warning(F("Client not connected, aborting thes publication" CR)); + Log.warning(F("Client not connected, aborting the publication" CR)); } } @@ -526,6 +526,11 @@ void delayWithOTA(long waitMillis) { #if defined(ESP8266) || defined(ESP32) long waitStep = 100; for (long waitedMillis = 0; waitedMillis < waitMillis; waitedMillis += waitStep) { +# ifndef ESPWifiManualSetup +# if defined(ESP8266) || defined(ESP32) + checkButton(); // check if a reset of wifi/mqtt settings is asked +# endif +# endif ArduinoOTA.handle(); delay(waitStep); } @@ -589,7 +594,7 @@ void connectMQTT() { Log.warning(F("failed, ssl error code=%d" CR), ((WiFiClientSecure*)eClient)->getLastSSLError()); #endif ErrorIndicatorON(); - delayWithOTA(2000); + delayWithOTA(5000); ErrorIndicatorOFF(); delayWithOTA(5000); if (failure_number_mqtt > maxRetryWatchDog) {