mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
network checks - still checking
This commit is contained in:
@@ -312,7 +312,7 @@ void NetworkSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info)
|
|||||||
|
|
||||||
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
|
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
|
||||||
char result[10];
|
char result[10];
|
||||||
emsesp::EMSESP::logger().info("WiFi connected (IP=%s, hostname=%s, TxPower=%s dBm)",
|
emsesp::EMSESP::logger().info("WiFi connected (Local IP=%s, hostname=%s, TxPower=%s dBm)",
|
||||||
WiFi.localIP().toString().c_str(),
|
WiFi.localIP().toString().c_str(),
|
||||||
WiFi.getHostname(),
|
WiFi.getHostname(),
|
||||||
emsesp::Helpers::render_value(result, ((double)(WiFi.getTxPower()) / 4), 1));
|
emsesp::Helpers::render_value(result, ((double)(WiFi.getTxPower()) / 4), 1));
|
||||||
@@ -330,7 +330,7 @@ void NetworkSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info)
|
|||||||
case ARDUINO_EVENT_ETH_GOT_IP:
|
case ARDUINO_EVENT_ETH_GOT_IP:
|
||||||
// prevent double calls to mDNS
|
// prevent double calls to mDNS
|
||||||
if (!emsesp::EMSESP::system_.ethernet_connected()) {
|
if (!emsesp::EMSESP::system_.ethernet_connected()) {
|
||||||
emsesp::EMSESP::logger().info("Ethernet connected (IP=%s, speed %d Mbps)", ETH.localIP().toString().c_str(), ETH.linkSpeed());
|
emsesp::EMSESP::logger().info("Ethernet connected (Local IP=%s, speed %d Mbps)", ETH.localIP().toString().c_str(), ETH.linkSpeed());
|
||||||
emsesp::EMSESP::system_.ethernet_connected(true);
|
emsesp::EMSESP::system_.ethernet_connected(true);
|
||||||
mDNS_start();
|
mDNS_start();
|
||||||
}
|
}
|
||||||
@@ -377,7 +377,6 @@ void NetworkSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
// IPv6 specific - Eth
|
// IPv6 specific - Eth
|
||||||
// This a bug in arduino where this is triggered twice, so we prevent it
|
|
||||||
case ARDUINO_EVENT_ETH_GOT_IP6:
|
case ARDUINO_EVENT_ETH_GOT_IP6:
|
||||||
#if !TASMOTA_SDK && ESP_IDF_VERSION_MAJOR < 5
|
#if !TASMOTA_SDK && ESP_IDF_VERSION_MAJOR < 5
|
||||||
emsesp::EMSESP::logger().info("Local IPv6 (Eth)=%s", ETH.localIPv6().toString().c_str());
|
emsesp::EMSESP::logger().info("Local IPv6 (Eth)=%s", ETH.localIPv6().toString().c_str());
|
||||||
|
|||||||
@@ -789,7 +789,7 @@ void System::network_init(bool refresh) {
|
|||||||
auto clock_mode = (eth_clock_mode_t)eth_clock_mode_;
|
auto clock_mode = (eth_clock_mode_t)eth_clock_mode_;
|
||||||
|
|
||||||
// reset power and add a delay as ETH doesn't not always start up correctly after a warm boot
|
// reset power and add a delay as ETH doesn't not always start up correctly after a warm boot
|
||||||
// TODO check
|
// TODO still experimental
|
||||||
pinMode(eth_power_, OUTPUT);
|
pinMode(eth_power_, OUTPUT);
|
||||||
digitalWrite(eth_power_, LOW);
|
digitalWrite(eth_power_, LOW);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
@@ -1798,7 +1798,7 @@ bool System::load_board_profile(std::vector<int8_t> & data, const std::string &
|
|||||||
bool System::command_format(const char * value, const int8_t id) {
|
bool System::command_format(const char * value, const int8_t id) {
|
||||||
LOG_INFO("Removing all config files");
|
LOG_INFO("Removing all config files");
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
// TODO To replaced with fs.rmdir(FS_CONFIG_DIRECTORY) now we're using IDF 4.2+
|
// TODO To replaced with LittleFS.rmdir(FS_CONFIG_DIRECTORY) now we're using IDF 4.2+
|
||||||
File root = LittleFS.open(EMSESP_FS_CONFIG_DIRECTORY);
|
File root = LittleFS.open(EMSESP_FS_CONFIG_DIRECTORY);
|
||||||
File file;
|
File file;
|
||||||
while ((file = root.openNextFile())) {
|
while ((file = root.openNextFile())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user