mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
wifi reconnects renaming
This commit is contained in:
@@ -103,11 +103,13 @@ const NetworkStatus = () => {
|
|||||||
case NetworkConnectionStatus.WIFI_STATUS_NO_SSID_AVAIL:
|
case NetworkConnectionStatus.WIFI_STATUS_NO_SSID_AVAIL:
|
||||||
return 'No SSID Available';
|
return 'No SSID Available';
|
||||||
case NetworkConnectionStatus.WIFI_STATUS_CONNECTED:
|
case NetworkConnectionStatus.WIFI_STATUS_CONNECTED:
|
||||||
return LL.CONNECTED(0) + ' (WiFi) (' + data.connect_count + ')';
|
return LL.CONNECTED(0) + ' (WiFi) (' + data.reconnect_count + ')';
|
||||||
case NetworkConnectionStatus.WIFI_STATUS_CONNECT_FAILED:
|
case NetworkConnectionStatus.WIFI_STATUS_CONNECT_FAILED:
|
||||||
return LL.CONNECTED(1) + ' ' + LL.FAILED(0) + ' (' + data.connect_count + ')';
|
return (
|
||||||
|
LL.CONNECTED(1) + ' ' + LL.FAILED(0) + ' (' + data.reconnect_count + ')'
|
||||||
|
);
|
||||||
case NetworkConnectionStatus.WIFI_STATUS_CONNECTION_LOST:
|
case NetworkConnectionStatus.WIFI_STATUS_CONNECTION_LOST:
|
||||||
return LL.CONNECTED(1) + ' ' + LL.LOST() + ' (' + data.connect_count + ')';
|
return LL.CONNECTED(1) + ' ' + LL.LOST() + ' (' + data.reconnect_count + ')';
|
||||||
case NetworkConnectionStatus.WIFI_STATUS_DISCONNECTED:
|
case NetworkConnectionStatus.WIFI_STATUS_DISCONNECTED:
|
||||||
return LL.DISCONNECTED();
|
return LL.DISCONNECTED();
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export interface NetworkStatusType {
|
|||||||
dns_ip_1: string;
|
dns_ip_1: string;
|
||||||
dns_ip_2: string;
|
dns_ip_2: string;
|
||||||
hostname: string;
|
hostname: string;
|
||||||
connect_count: number;
|
reconnect_count: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NetworkSettingsType {
|
export interface NetworkSettingsType {
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ class ESP8266React {
|
|||||||
return _apSettingsService.getAPNetworkStatus() == APNetworkStatus::ACTIVE;
|
return _apSettingsService.getAPNetworkStatus() == APNetworkStatus::ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t getWifiConnects() {
|
uint16_t getWifiReconnects() {
|
||||||
return _networkSettingsService.getWifiConnects();
|
return _networkSettingsService.getWifiReconnects();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ void NetworkSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
|
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
|
||||||
connectcount_++; // count the number of reconnects
|
connectcount_++; // count the number of WiFi reconnects
|
||||||
emsesp::EMSESP::logger().warning("WiFi disconnected (#%d). Reason: %s (%d)",
|
emsesp::EMSESP::logger().warning("WiFi disconnected (#%d). Reason: %s (%d)",
|
||||||
connectcount_,
|
connectcount_,
|
||||||
disconnectReason(info.wifi_sta_disconnected.reason),
|
disconnectReason(info.wifi_sta_disconnected.reason),
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class NetworkSettingsService : public StatefulService<NetworkSettings> {
|
|||||||
void begin();
|
void begin();
|
||||||
void loop();
|
void loop();
|
||||||
|
|
||||||
uint16_t getWifiConnects() const {
|
uint16_t getWifiReconnects() const {
|
||||||
return connectcount_;
|
return connectcount_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
|
|||||||
root["ssid"] = WiFi.SSID();
|
root["ssid"] = WiFi.SSID();
|
||||||
root["bssid"] = WiFi.BSSIDstr();
|
root["bssid"] = WiFi.BSSIDstr();
|
||||||
root["channel"] = WiFi.channel();
|
root["channel"] = WiFi.channel();
|
||||||
root["connect_count"] = emsesp::EMSESP::esp8266React.getWifiConnects();
|
root["reconnect_count"] = emsesp::EMSESP::esp8266React.getWifiReconnects();
|
||||||
root["subnet_mask"] = WiFi.subnetMask().toString();
|
root["subnet_mask"] = WiFi.subnetMask().toString();
|
||||||
|
|
||||||
if (WiFi.gatewayIP() != INADDR_NONE) {
|
if (WiFi.gatewayIP() != INADDR_NONE) {
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ const network_status = {
|
|||||||
dns_ip_1: '10.10.10.1',
|
dns_ip_1: '10.10.10.1',
|
||||||
dns_ip_2: '0.0.0.0',
|
dns_ip_2: '0.0.0.0',
|
||||||
hostname: 'ems-esp',
|
hostname: 'ems-esp',
|
||||||
connect_count: 1
|
reconnect_count: 1
|
||||||
};
|
};
|
||||||
const list_networks = {
|
const list_networks = {
|
||||||
networks: [
|
networks: [
|
||||||
@@ -4840,7 +4840,7 @@ router
|
|||||||
if (action === 'export') {
|
if (action === 'export') {
|
||||||
// export data
|
// export data
|
||||||
return export_data(content.param);
|
return export_data(content.param);
|
||||||
} else if (action === 'customSupport') {
|
} else if (action === 'getCustomSupport') {
|
||||||
// send custom support
|
// send custom support
|
||||||
return custom_support();
|
return custom_support();
|
||||||
} else if (action === 'checkUpgrade') {
|
} else if (action === 'checkUpgrade') {
|
||||||
|
|||||||
@@ -1366,3 +1366,5 @@ pooltemp
|
|||||||
stoptime
|
stoptime
|
||||||
showertimer
|
showertimer
|
||||||
showeralert
|
showeralert
|
||||||
|
CTKWH
|
||||||
|
wifireconnects
|
||||||
@@ -716,7 +716,7 @@ void System::heartbeat_json(JsonObject output) {
|
|||||||
int8_t rssi = WiFi.RSSI();
|
int8_t rssi = WiFi.RSSI();
|
||||||
output["rssi"] = rssi;
|
output["rssi"] = rssi;
|
||||||
output["wifistrength"] = wifi_quality(rssi);
|
output["wifistrength"] = wifi_quality(rssi);
|
||||||
output["wificonnects"] = EMSESP::esp8266React.getWifiConnects();
|
output["wifireconnects"] = EMSESP::esp8266React.getWifiReconnects();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1167,7 +1167,7 @@ bool System::check_restore() {
|
|||||||
// it's a custom support file - save it to /config
|
// it's a custom support file - save it to /config
|
||||||
new_file.close();
|
new_file.close();
|
||||||
if (LittleFS.rename(TEMP_FILENAME_PATH, EMSESP_CUSTOMSUPPORT_FILE)) {
|
if (LittleFS.rename(TEMP_FILENAME_PATH, EMSESP_CUSTOMSUPPORT_FILE)) {
|
||||||
LOG_DEBUG("Custom support information found");
|
LOG_INFO("Custom support file stored");
|
||||||
return false; // no need to reboot
|
return false; // no need to reboot
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("Failed to save custom support file");
|
LOG_ERROR("Failed to save custom support file");
|
||||||
@@ -1500,7 +1500,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject output
|
|||||||
node["network"] = "WiFi";
|
node["network"] = "WiFi";
|
||||||
node["hostname"] = WiFi.getHostname();
|
node["hostname"] = WiFi.getHostname();
|
||||||
node["RSSI"] = WiFi.RSSI();
|
node["RSSI"] = WiFi.RSSI();
|
||||||
node["WIFIConnects"] = EMSESP::esp8266React.getWifiConnects();
|
node["WIFIReconnects"] = EMSESP::esp8266React.getWifiReconnects();
|
||||||
// node["MAC"] = WiFi.macAddress();
|
// node["MAC"] = WiFi.macAddress();
|
||||||
// node["IPv4 address"] = uuid::printable_to_string(WiFi.localIP()) + "/" + uuid::printable_to_string(WiFi.subnetMask());
|
// node["IPv4 address"] = uuid::printable_to_string(WiFi.localIP()) + "/" + uuid::printable_to_string(WiFi.subnetMask());
|
||||||
// node["IPv4 gateway"] = uuid::printable_to_string(WiFi.gatewayIP());
|
// node["IPv4 gateway"] = uuid::printable_to_string(WiFi.gatewayIP());
|
||||||
|
|||||||
Reference in New Issue
Block a user