From 063dddca2b6138f2e229c9979b7afad8e485165e Mon Sep 17 00:00:00 2001 From: Stephen Schwetz Date: Sun, 9 Mar 2025 12:14:19 +1100 Subject: [PATCH 1/4] Clear Led Flashing after error fixed --- src/blflow/mqttmanager.h | 4 ++++ src/main.cpp | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/blflow/mqttmanager.h b/src/blflow/mqttmanager.h index 98828e9..af36752 100644 --- a/src/blflow/mqttmanager.h +++ b/src/blflow/mqttmanager.h @@ -43,6 +43,10 @@ void ParseMQTTState(int code){ break; case 0: // MQTT_CONNECTED Serial.println(F("MQTT CONNECTED")); + if (printerVariables.errorcode == "no mqtt"){ + //if this routine set the error code, clear it + printerVariables.errorcode = ""; + } break; case 1: // MQTT_CONNECT_BAD_PROTOCOL Serial.println(F("MQTT BAD PROTOCOL")); diff --git a/src/main.cpp b/src/main.cpp index 25e1a34..ee1b270 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,13 +37,22 @@ void setup(){ Serial.println(F("SSID or password is missing. Please configure both by going to: https://dutchdevelop.com/smartflow-configuration-setup/")); return; } + else if (printerVariables.errorcode == "no config"){ + //if this routine set the error code, clear it + printerVariables.errorcode = ""; + } + scanNetwork(); //Sets the MAC address for following connection attempt if(!connectToWifi()){ printerVariables.errorcode = "no wifi"; return; } - + else if (printerVariables.errorcode == "no wifi"){ + //if this routine set the error code, clear it + printerVariables.errorcode = ""; + } + setupWebserver(); delay(500); start_ssdp(); From 27b9587aba554ab4de055c05827d0f970c10c6ee Mon Sep 17 00:00:00 2001 From: Stephen Schwetz Date: Sun, 9 Mar 2025 12:18:24 +1100 Subject: [PATCH 2/4] Delete .DS_Store --- .DS_Store | Bin 10244 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index bd8a7fa0b162de9eedc6ca2bcc66a46439aae0cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 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`IyQr^Yt0(^w#750OGINQx(1Z5_%09LFCK? z$o)Z72oRq!C;mXgcaJwlXT^Fjj3D>*F@zmhQ@wJ}LJ7;kFW1enGNY|bGTz8V Date: Sun, 9 Mar 2025 19:30:49 +1100 Subject: [PATCH 3/4] added call to PaseMTTQState if connection successful --- src/blflow/mqttmanager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blflow/mqttmanager.h b/src/blflow/mqttmanager.h index af36752..8a5bf8f 100644 --- a/src/blflow/mqttmanager.h +++ b/src/blflow/mqttmanager.h @@ -84,6 +84,7 @@ void connectMqtt(){ mqttClient.subscribe(report_topic.c_str()); printerVariables.online = true; printerVariables.disconnectMQTTms = 0; + ParseMQTTState(mqttClient.state()); //Serial.println(F("Updating LEDs from MQTT connect")); }else{ Serial.println(F("Failed to connect with error code: ")); From 707a45b37c1144e440d33d5d868e797a1e34f4e3 Mon Sep 17 00:00:00 2001 From: Stephen Schwetz Date: Mon, 10 Mar 2025 13:57:04 +1100 Subject: [PATCH 4/4] move clear mttq error to connectMqtt --- src/blflow/mqttmanager.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blflow/mqttmanager.h b/src/blflow/mqttmanager.h index 8a5bf8f..2925ca7 100644 --- a/src/blflow/mqttmanager.h +++ b/src/blflow/mqttmanager.h @@ -84,7 +84,10 @@ void connectMqtt(){ mqttClient.subscribe(report_topic.c_str()); printerVariables.online = true; printerVariables.disconnectMQTTms = 0; - ParseMQTTState(mqttClient.state()); + if (printerVariables.errorcode == "no mqtt"){ + //if this routine set the error code, clear it + printerVariables.errorcode = ""; + } //Serial.println(F("Updating LEDs from MQTT connect")); }else{ Serial.println(F("Failed to connect with error code: "));