From 303423a5a5e75f18955023dd4c027a794a9a501f Mon Sep 17 00:00:00 2001 From: Holger Weber Date: Fri, 13 Mar 2026 15:52:36 +0100 Subject: [PATCH] Added wifi state output as version. --- include/EggDuino.h | 4 +--- src/Config_Web.cpp | 8 ++++++-- src/Functions.cpp | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/EggDuino.h b/include/EggDuino.h index c1d6b81..e0e32db 100644 --- a/include/EggDuino.h +++ b/include/EggDuino.h @@ -14,9 +14,6 @@ #include "SerialCommand.h" #include "button.h" -// implemented Eggbot-Protocol-Version v13 -#define initSting "EBBv13_and_above Protocol emulated by Eggduino-Firmware V1.6a" - #ifdef ESP32 // Rotational Stepper @@ -104,6 +101,7 @@ extern int g_iMaxAcclSpeed; extern String g_sHostname; extern String g_sWifiSsid; extern String g_sWifiPassword; +extern String g_strConnectionState; enum ProtocolTransport { PROTOCOL_TRANSPORT_SERIAL = 0, diff --git a/src/Config_Web.cpp b/src/Config_Web.cpp index b73daf6..bb55774 100644 --- a/src/Config_Web.cpp +++ b/src/Config_Web.cpp @@ -3,6 +3,8 @@ #include #include + String g_strConnectionState = "No Wifi connection"; + namespace { const char *kConfigPath = "/config.json"; @@ -594,7 +596,8 @@ void startWebInterface() staConnectionKnown = staConnected; if (staConnected) { - Serial.println(String("Connected: http://") + WiFi.localIP().toString()); + g_strConnectionState = String("Connected: http://") + WiFi.localIP().toString(); + Serial.println(g_strConnectionState); } else { @@ -620,7 +623,8 @@ void startWebInterface() { apModeActive = true; dnsServer.start(kDnsPort, "*", WiFi.softAPIP()); - Serial.println(String("AP aktiv: ") + hostName + " / http://" + WiFi.softAPIP().toString() + " (Name: " + hostName + ")"); + g_strConnectionState = String("AP aktiv: http://" + WiFi.softAPIP().toString() + " (" + hostName + ")"); + Serial.println(g_strConnectionState); } else { diff --git a/src/Functions.cpp b/src/Functions.cpp index a67780d..067587b 100644 --- a/src/Functions.cpp +++ b/src/Functions.cpp @@ -318,11 +318,12 @@ void stepperModeConfigure() void sendVersion() { - Log(__FUNCTION__); - protocolWrite(initSting); + Log(__FUNCTION__); + protocolWrite("EBB: " + g_strConnectionState); protocolWrite("\r\n"); } + void unrecognized(const char *command) { Log(__FUNCTION__);