Consistant usage of Wi-Fi
This commit is contained in:
10
Network.cpp
10
Network.cpp
@@ -67,13 +67,13 @@ void Network::setupDevice()
|
||||
{
|
||||
if(_preferences->getBool(preference_network_wifi_fallback_disabled))
|
||||
{
|
||||
Log->println(F("Failed to connect to network. Wifi fallback is disable, rebooting."));
|
||||
Log->println(F("Failed to connect to network. Wi-Fi fallback is disabled, rebooting."));
|
||||
memset(WiFi_fallbackDetect, 0, sizeof(WiFi_fallbackDetect));
|
||||
sleep(5);
|
||||
restartEsp(RestartReason::NetworkDeviceCriticalFailureNoWifiFallback);
|
||||
}
|
||||
|
||||
Log->println(F("Switching to WiFi device as fallback."));
|
||||
Log->println(F("Switching to Wi-Fi device as fallback."));
|
||||
_networkDeviceType = NetworkDeviceType::WiFi;
|
||||
}
|
||||
else
|
||||
@@ -82,7 +82,7 @@ void Network::setupDevice()
|
||||
switch (hardwareDetect)
|
||||
{
|
||||
case 1:
|
||||
Log->println(F("Wifi only"));
|
||||
Log->println(F("Wi-Fi only"));
|
||||
_networkDeviceType = NetworkDeviceType::WiFi;
|
||||
break;
|
||||
case 2:
|
||||
@@ -110,7 +110,7 @@ void Network::setupDevice()
|
||||
_networkDeviceType = NetworkDeviceType::LilyGO_T_ETH_POE;
|
||||
break;
|
||||
default:
|
||||
Log->println(F("Unknown hardware selected, falling back to Wifi."));
|
||||
Log->println(F("Unknown hardware selected, falling back to Wi-Fi."));
|
||||
_networkDeviceType = NetworkDeviceType::WiFi;
|
||||
break;
|
||||
}
|
||||
@@ -286,7 +286,7 @@ bool Network::update()
|
||||
{
|
||||
case ReconnectStatus::CriticalFailure:
|
||||
strcpy(WiFi_fallbackDetect, "wifi_fallback");
|
||||
Log->println("Network device has a critical failure, enable fallback to Wifi and reboot.");
|
||||
Log->println("Network device has a critical failure, enable fallback to Wi-Fi and reboot.");
|
||||
delay(200);
|
||||
restartEsp(RestartReason::NetworkDeviceCriticalFailure);
|
||||
break;
|
||||
|
||||
@@ -132,7 +132,7 @@ void WebCfgServer::initialize()
|
||||
if(_allowRestartToPortal)
|
||||
{
|
||||
String response = "";
|
||||
buildConfirmHtml(response, "Restarting. Connect to ESP access point to reconfigure WiFi.", 0);
|
||||
buildConfirmHtml(response, "Restarting. Connect to ESP access point to reconfigure Wi-Fi.", 0);
|
||||
_server.send(200, "text/html", response);
|
||||
waitAndProcess(true, 2000);
|
||||
_network->reconfigureDevice();
|
||||
@@ -662,8 +662,8 @@ void WebCfgServer::buildHtml(String& response)
|
||||
|
||||
if(_allowRestartToPortal)
|
||||
{
|
||||
response.concat("<br><br><h3>WiFi</h3>");
|
||||
buildNavigationButton(response, "Restart and configure wifi", "/wifi");
|
||||
response.concat("<br><br><h3>Wi-Fi</h3>");
|
||||
buildNavigationButton(response, "Restart and configure Wi-Fi", "/wifi");
|
||||
}
|
||||
|
||||
response.concat("</BODY></HTML>");
|
||||
@@ -814,14 +814,14 @@ void WebCfgServer::buildMqttConfigHtml(String &response)
|
||||
printTextarea(response, "MQTTCRT", "MQTT SSL Client Certificate (*, optional)", _preferences->getString(preference_mqtt_crt).c_str(), TLS_CERT_MAX_SIZE, _network->encryptionSupported(), true);
|
||||
printTextarea(response, "MQTTKEY", "MQTT SSL Client Key (*, optional)", _preferences->getString(preference_mqtt_key).c_str(), TLS_KEY_MAX_SIZE, _network->encryptionSupported(), true);
|
||||
printDropDown(response, "NWHW", "Network hardware", String(_preferences->getInt(preference_network_hardware)), getNetworkDetectionOptions());
|
||||
printCheckBox(response, "NWHWWIFIFB", "Disable fallback to Wifi / WiFi config portal", _preferences->getBool(preference_network_wifi_fallback_disabled));
|
||||
printCheckBox(response, "NWHWWIFIFB", "Disable fallback to Wi-Fi / Wi-Fi config portal", _preferences->getBool(preference_network_wifi_fallback_disabled));
|
||||
printInputField(response, "RSSI", "RSSI Publish interval (seconds; -1 to disable)", _preferences->getInt(preference_rssi_publish_interval), 6);
|
||||
printInputField(response, "NETTIMEOUT", "Network Timeout until restart (seconds; -1 to disable)", _preferences->getInt(preference_network_timeout), 5);
|
||||
printCheckBox(response, "RSTDISC", "Restart on disconnect", _preferences->getBool(preference_restart_on_disconnect));
|
||||
printCheckBox(response, "MQTTLOG", "Enable MQTT logging", _preferences->getBool(preference_mqtt_log_enabled));
|
||||
printCheckBox(response, "CHECKUPDATE", "Check for Firmware Updates every 24h", _preferences->getBool(preference_check_updates));
|
||||
response.concat("</table>");
|
||||
response.concat("* If no encryption is configured for the MQTT broker, leave empty. Only supported for WiFi connections.<br><br>");
|
||||
response.concat("* If no encryption is configured for the MQTT broker, leave empty. Only supported for Wi-Fi connections.<br><br>");
|
||||
|
||||
response.concat("<h3>IP Address assignment</h3>");
|
||||
response.concat("<table>");
|
||||
@@ -926,8 +926,8 @@ void WebCfgServer::buildConfigureWifiHtml(String &response)
|
||||
{
|
||||
buildHtmlHeader(response);
|
||||
|
||||
response.concat("<h3>WiFi</h3>");
|
||||
response.concat("Click confirm to restart ESP into WiFi configuration mode. After restart, connect to ESP access point to reconfigure WiFI.<br><br>");
|
||||
response.concat("<h3>Wi-Fi</h3>");
|
||||
response.concat("Click confirm to restart ESP into Wi-Fi configuration mode. After restart, connect to ESP access point to reconfigure Wi-Fi.<br><br>");
|
||||
buildNavigationButton(response, "Confirm", "/wifimanager");
|
||||
|
||||
response.concat("</BODY></HTML>");
|
||||
@@ -1331,7 +1331,7 @@ const std::vector<std::pair<String, String>> WebCfgServer::getNetworkDetectionOp
|
||||
{
|
||||
std::vector<std::pair<String, String>> options;
|
||||
|
||||
options.push_back(std::make_pair("1", "Wifi only"));
|
||||
options.push_back(std::make_pair("1", "Wi-Fi only"));
|
||||
options.push_back(std::make_pair("2", "Generic W5500"));
|
||||
options.push_back(std::make_pair("3", "M5Stack Atom POE (W5500)"));
|
||||
options.push_back(std::make_pair("4", "Olimex ESP32-POE / ESP-POE-ISO"));
|
||||
|
||||
@@ -57,7 +57,7 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* preferences, const I
|
||||
|
||||
const String WifiDevice::deviceName() const
|
||||
{
|
||||
return "Built-in Wifi";
|
||||
return "Built-in Wi-Fi";
|
||||
}
|
||||
|
||||
void WifiDevice::initialize()
|
||||
@@ -83,7 +83,7 @@ void WifiDevice::initialize()
|
||||
|
||||
if(_startAp)
|
||||
{
|
||||
Log->println(F("Opening WiFi configuration portal."));
|
||||
Log->println(F("Opening Wi-Fi configuration portal."));
|
||||
res = _wm.startConfigPortal();
|
||||
}
|
||||
else
|
||||
@@ -102,7 +102,7 @@ void WifiDevice::initialize()
|
||||
restartEsp(RestartReason::WifiInitFailed);
|
||||
}
|
||||
else {
|
||||
Log->print(F("WiFi connected: "));
|
||||
Log->print(F("Wi-Fi connected: "));
|
||||
Log->println(WiFi.localIP().toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user