From 061d74a40ad595e7284363e6c6819acdd156576d Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Mon, 6 Feb 2023 13:06:33 +0100 Subject: [PATCH 1/2] fix eth issue --- src/TaskEth.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/TaskEth.cpp b/src/TaskEth.cpp index 59d4149..189f3d6 100644 --- a/src/TaskEth.cpp +++ b/src/TaskEth.cpp @@ -17,13 +17,13 @@ void setWiFiLogger(logging::Logger *logger) { void WiFiEvent(WiFiEvent_t event) { switch (event) { - case SYSTEM_EVENT_STA_START: + case ARDUINO_EVENT_WIFI_STA_START: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi Started"); break; - case SYSTEM_EVENT_STA_CONNECTED: + case ARDUINO_EVENT_WIFI_STA_CONNECTED: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi Connected"); break; - case SYSTEM_EVENT_STA_GOT_IP: + case ARDUINO_EVENT_WIFI_STA_GOT_IP: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi MAC: %s", WiFi.macAddress().c_str()); _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi IPv4: %s", WiFi.localIP().toString().c_str()); _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi Gateway: %s", WiFi.gatewayIP().toString().c_str()); @@ -31,19 +31,19 @@ void WiFiEvent(WiFiEvent_t event) { _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi DNS2: %s", WiFi.dnsIP(1).toString().c_str()); _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi Hostname: %s", WiFi.getHostname()); break; - case SYSTEM_EVENT_STA_DISCONNECTED: + case ARDUINO_EVENT_WIFI_STA_DISCONNECTED: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi Disconnected"); break; - case SYSTEM_EVENT_STA_STOP: + case ARDUINO_EVENT_WIFI_STA_STOP: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "WiFi Stopped"); break; - case SYSTEM_EVENT_ETH_START: + case ARDUINO_EVENT_ETH_START: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "ETH Started"); break; - case SYSTEM_EVENT_ETH_CONNECTED: + case ARDUINO_EVENT_ETH_CONNECTED: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "ETH Connected"); break; - case SYSTEM_EVENT_ETH_GOT_IP: + case ARDUINO_EVENT_ETH_GOT_IP: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "ETH MAC: %s", ETH.macAddress().c_str()); _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "ETH IPv4: %s", ETH.localIP().toString().c_str()); _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "ETH Gateway: %s", ETH.gatewayIP().toString().c_str()); @@ -56,11 +56,11 @@ void WiFiEvent(WiFiEvent_t event) { _logger->log(logging::LoggerLevel::LOGGER_LEVEL_INFO, WIFI_EVENT, "ETH Speed: %dMbps", ETH.linkSpeed()); eth_connected = true; break; - case SYSTEM_EVENT_ETH_DISCONNECTED: + case ARDUINO_EVENT_ETH_DISCONNECTED: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_WARN, WIFI_EVENT, "ETH Disconnected"); eth_connected = false; break; - case SYSTEM_EVENT_ETH_STOP: + case ARDUINO_EVENT_ETH_STOP: _logger->log(logging::LoggerLevel::LOGGER_LEVEL_WARN, WIFI_EVENT, "ETH Stopped"); eth_connected = false; break; @@ -87,6 +87,15 @@ bool EthTask::setup(System &system) { constexpr eth_clock_mode_t ETH_CLK = ETH_CLOCK_GPIO17_OUT; // TTGO PoE V1.0 // constexpr eth_clock_mode_t ETH_CLK = ETH_CLOCK_GPIO0_OUT; // TTGO PoE V1.2 + // config for WT32-ETH01 - comment out upper values, proper board support will come later + // constexpr uint8_t ETH_NRST = 5; + // constexpr uint8_t ETH_ADDR = 1; + // constexpr int ETH_POWER_PIN = 16; + // constexpr int ETH_MDC_PIN = 23; + // constexpr int ETH_MDIO_PIN = 18; + // constexpr eth_phy_type_t ETH_TYPE = ETH_PHY_LAN8720; + // constexpr eth_clock_mode_t ETH_CLK = ETH_CLOCK_GPIO0_IN; + pinMode(ETH_NRST, OUTPUT); digitalWrite(ETH_NRST, 0); delay(200); From f765da251736291745adf00c9daf9f3b9eaa5085 Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Mon, 6 Feb 2023 14:02:38 +0100 Subject: [PATCH 2/2] Update LoRa_APRS_iGate.cpp --- src/LoRa_APRS_iGate.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index a6fc270..53bd8e9 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -173,7 +173,6 @@ void setup() { pinMode(userConfig.display.overwritePin, INPUT_PULLUP); } - delay(5000); LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "setup done..."); }