Added wifi state output as version.

This commit is contained in:
2026-03-13 15:52:36 +01:00
parent f55dab7546
commit 303423a5a5
3 changed files with 10 additions and 7 deletions

View File

@@ -14,9 +14,6 @@
#include "SerialCommand.h" #include "SerialCommand.h"
#include "button.h" #include "button.h"
// implemented Eggbot-Protocol-Version v13
#define initSting "EBBv13_and_above Protocol emulated by Eggduino-Firmware V1.6a"
#ifdef ESP32 #ifdef ESP32
// Rotational Stepper // Rotational Stepper
@@ -104,6 +101,7 @@ extern int g_iMaxAcclSpeed;
extern String g_sHostname; extern String g_sHostname;
extern String g_sWifiSsid; extern String g_sWifiSsid;
extern String g_sWifiPassword; extern String g_sWifiPassword;
extern String g_strConnectionState;
enum ProtocolTransport { enum ProtocolTransport {
PROTOCOL_TRANSPORT_SERIAL = 0, PROTOCOL_TRANSPORT_SERIAL = 0,

View File

@@ -3,6 +3,8 @@
#include <DNSServer.h> #include <DNSServer.h>
#include <string.h> #include <string.h>
String g_strConnectionState = "No Wifi connection";
namespace namespace
{ {
const char *kConfigPath = "/config.json"; const char *kConfigPath = "/config.json";
@@ -594,7 +596,8 @@ void startWebInterface()
staConnectionKnown = staConnected; staConnectionKnown = staConnected;
if (staConnected) if (staConnected)
{ {
Serial.println(String("Connected: http://") + WiFi.localIP().toString()); g_strConnectionState = String("Connected: http://") + WiFi.localIP().toString();
Serial.println(g_strConnectionState);
} }
else else
{ {
@@ -620,7 +623,8 @@ void startWebInterface()
{ {
apModeActive = true; apModeActive = true;
dnsServer.start(kDnsPort, "*", WiFi.softAPIP()); 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 else
{ {

View File

@@ -319,10 +319,11 @@ void stepperModeConfigure()
void sendVersion() void sendVersion()
{ {
Log(__FUNCTION__); Log(__FUNCTION__);
protocolWrite(initSting); protocolWrite("EBB: " + g_strConnectionState);
protocolWrite("\r\n"); protocolWrite("\r\n");
} }
void unrecognized(const char *command) void unrecognized(const char *command)
{ {
Log(__FUNCTION__); Log(__FUNCTION__);