Skip to content

Commit

Permalink
For WebUI v3, ESP 800 was sending hardcoded values for the WebSocket …
Browse files Browse the repository at this point in the history
…address, rather than the values as actually configured (#1337)
  • Loading branch information
michmela44 authored Nov 4, 2024
1 parent b69dd39 commit 20e6a77
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions FluidNC/src/WebUI/WifiConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,23 @@ namespace WebUI {
j.member("Authentication", "Disabled");
#endif
j.member("WebCommunication", "Synchronous");
j.member("WebSocketIP", "localhost");

j.member("WebSocketPort", "82");
switch (WiFi.getMode()) {
case WIFI_AP:
j.member("WebSocketIP", IP_string(WiFi.softAPIP()));
break;
case WIFI_STA:
j.member("WebSocketIP", IP_string(WiFi.localIP()));
break;
case WIFI_AP_STA:
j.member("WebSocketIP", IP_string(WiFi.softAPIP()));
break;
default:
j.member("WebSocketIP", "0.0.0.0");
break;
}

j.member("WebSocketPort", std::to_string(Web_Server::port() + 2));
j.member("HostName", WiFi.getHostname());
j.member("WiFiMode", modeName());
j.member("FlashFileSystem", "LittleFS");
Expand Down

0 comments on commit 20e6a77

Please sign in to comment.