1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 08:06:13 +01:00

Update WiFi LCD messages

This commit is contained in:
Ash-4 2024-02-05 01:06:20 -06:00
parent df20e3ad95
commit 6253267b5d
2 changed files with 22 additions and 11 deletions

View File

@ -181,7 +181,14 @@ bool WifiESP::setup(const char *SSid,
if (WiFi.status() == WL_CONNECTED) { if (WiFi.status() == WL_CONNECTED) {
// DIAG(F("Wifi STA IP %s"),WiFi.localIP().toString().c_str()); // DIAG(F("Wifi STA IP %s"),WiFi.localIP().toString().c_str());
DIAG(F("Wifi in STA mode")); DIAG(F("Wifi in STA mode"));
LCD(7, F("IP: %s"), WiFi.localIP().toString().c_str()); //
if (MAX_MSG_SIZE < 20) {
LCD(4, F("IP: %s"), WiFi.localIP().toString().c_str());
LCD(5,F("PORT=%d WiFi"), IP_PORT);
} else {
LCD(4, F("WiFi UP"));
LCD(5, F("%s:%d"), WiFi.localIP().toString().c_str(), IP_PORT);
}
wifiUp = true; wifiUp = true;
} else { } else {
DIAG(F("Could not connect to Wifi SSID %s"),SSid); DIAG(F("Could not connect to Wifi SSID %s"),SSid);
@ -228,12 +235,12 @@ bool WifiESP::setup(const char *SSid,
havePassword ? password : strPass.c_str(), havePassword ? password : strPass.c_str(),
channel, false, 8)) { channel, false, 8)) {
// DIAG(F("Wifi AP SSID %s PASS %s"),strSSID.c_str(),havePassword ? password : strPass.c_str()); // DIAG(F("Wifi AP SSID %s PASS %s"),strSSID.c_str(),havePassword ? password : strPass.c_str());
DIAG(F("Wifi in AP mode")); DIAG(F("WiFi in AP mode"));
LCD(5, F("Wifi: %s"), strSSID.c_str()); LCD(4, F("WiFi: %s"), strSSID.c_str());
LCD(5, F("%s:%d"),WiFi.softAPIP().toString().c_str(), IP_PORT);
if (!havePassword) if (!havePassword)
LCD(6, F("PASS: %s"),strPass.c_str()); LCD(6, F("PASS: %s"),strPass.c_str());
// DIAG(F("Wifi AP IP %s"),WiFi.softAPIP().toString().c_str()); // DIAG(F("Wifi AP IP %s"),WiFi.softAPIP().toString().c_str());
LCD(7, F("IP: %s"),WiFi.softAPIP().toString().c_str());
wifiUp = true; wifiUp = true;
APmode = true; APmode = true;
} else { } else {

View File

@ -166,10 +166,10 @@ wifiSerialState WifiInterface::setup(Stream & setupStream, const FSH* SSid, con
if (wifiState == WIFI_CONNECTED) { if (wifiState == WIFI_CONNECTED) {
StringFormatter::send(wifiStream, F("ATE0\r\n")); // turn off the echo StringFormatter::send(wifiStream, F("ATE0\r\n")); // turn off the echo
checkForOK(200, true); checkForOK(200, true);
DIAG(F("WiFi CONNECTED")); DIAG(F("WiFi UP"));
// LCD already shows IP // LCD already shows IP
} else { } else {
LCD(4,F("WiFi DISCON.")); LCD(4,F("WiFi DOWN"));
} }
return wifiState; return wifiState;
} }
@ -366,11 +366,15 @@ wifiSerialState WifiInterface::setup2(const FSH* SSid, const FSH* password,
} }
ipString[ipLen]=ipChar; ipString[ipLen]=ipChar;
} }
LCD(4,F("%s"),ipString); // There is not enough room on some LCDs to put a title to this if (MAX_MSG_SIZE < 20) {
} LCD(4,F("%s"),ipString); // There is not enough room on some LCDs to put a title to this
// suck up anything after the IP. LCD(5,F("PORT=%d WiFi"),port);
} else {
LCD(4,F("WiFi UP"));
LCD(5,F("%s:%d"), ipString, port);
}
}
if (!checkForOK(1000, true, false)) return WIFI_DISCONNECTED; if (!checkForOK(1000, true, false)) return WIFI_DISCONNECTED;
LCD(5,F("PORT=%d"),port);
return WIFI_CONNECTED; return WIFI_CONNECTED;
} }