From 0ede075843c71c7438db86296abae443f6d1e4d4 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Tue, 17 Aug 2021 18:48:11 -0500 Subject: [PATCH] Add esp32-wt32-eth01 ethernet board (#1064) * Add esp32-wt32-eth01 ethernet board --- docs/prerequisites/board.md | 1 + main/User_config.h | 22 +++++++++++++++++++++- main/main.ino | 2 -- platformio.ini | 17 +++++++++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/docs/prerequisites/board.md b/docs/prerequisites/board.md index 56f4c5c..89fa396 100644 --- a/docs/prerequisites/board.md +++ b/docs/prerequisites/board.md @@ -16,6 +16,7 @@ The boards below doesn't need hardware modification (or a lite one). |Sonoff RF Bridge (*) |![](../img/OpenMQTTGateway_boards_sonoff_rfbridge.png)|X|[mod](https://1technophile.blogspot.com/2018/02/adding-infrared-emitter-to-sonoff-rf.html)|-|-|-|-|-| |All bare ESP32|-|-|-|X|-|X|-|X| |OLIMEX ESP32 Ethernet|-|-|-|X|-|X|-|X| +|ESP32-WT32-ETH01 Ethernet|-|-|-|X|-|X|-|X| |[M5Stack Basic](M5)|![](../img/OpenMQTTgateway_M5_Stack_Board_Display_Text.png)|-|-|X|-|X|X|X| |M5Stick|-|-|send|X|-|X|-|X| |[M5Stick C](M5)|![](../img/OpenMQTTgateway_M5_StickC_Board_Display_Text.png)|-|send|X|-|X|X|X| diff --git a/main/User_config.h b/main/User_config.h index 34b8dfc..2a36c19 100644 --- a/main/User_config.h +++ b/main/User_config.h @@ -83,7 +83,27 @@ const byte ip[] = {192, 168, 1, 99}; const byte mac[] = {0xDE, 0xED, 0xBA, 0xFE, 0x54, 0x95}; //W5100 ethernet shield mac adress #endif -//#define ESP32_ETHERNET=true // Uncomment to use Ethernet module on OLIMEX ESP32 Ethernet gateway +//#define ESP32_ETHERNET=true // Uncomment to use Ethernet module on ESP32 Ethernet gateway and adapt the settings to your board below, the default parameter are for OLIMEX ESP32 Gateway +#ifdef ESP32_ETHERNET +# ifndef ETH_PHY_ADDR +# define ETH_PHY_ADDR 0 +# endif +# ifndef ETH_PHY_TYPE +# define ETH_PHY_TYPE ETH_PHY_LAN8720 +# endif +# ifndef ETH_PHY_POWER +# define ETH_PHY_POWER 12 +# endif +# ifndef ETH_PHY_MDC +# define ETH_PHY_MDC 23 +# endif +# ifndef ETH_PHY_MDIO +# define ETH_PHY_MDIO 18 +# endif +# ifndef ETH_CLK_MODE +# define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT +# endif +#endif #if defined(ESPWifiManualSetup) // for nodemcu, weemos and esp8266 # ifndef wifi_ssid diff --git a/main/main.ino b/main/main.ino index c8cffce..6188b97 100644 --- a/main/main.ino +++ b/main/main.ino @@ -196,8 +196,6 @@ static String ota_server_cert = ""; # include # ifdef ESP32_ETHERNET -# define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT -# define ETH_PHY_POWER 12 # include void WiFiEvent(WiFiEvent_t event); static bool esp32EthConnected = false; diff --git a/platformio.ini b/platformio.ini index 173d606..656b281 100644 --- a/platformio.ini +++ b/platformio.ini @@ -46,6 +46,7 @@ extra_configs = ;default_envs = esp32-lolin32lite-ble ;default_envs = esp32-olimex-gtw-ble-eth ;default_envs = esp32-olimex-gtw-ble-wifi +;default_envs = esp32-wt32-eth01-ble-eth ;default_envs = esp32-m5stick-ble ;default_envs = esp32-m5stack-ble ;default_envs = esp32-m5stick-c-ble @@ -431,6 +432,22 @@ build_flags = '-DESP32_ETHERNET=true' '-DGateway_Name="OpenMQTTGateway_ESP32_OLM_GTWE"' +[env:esp32-wt32-eth01-ble-eth] +platform = ${com.esp32_platform} +board = esp32-gateway +board_build.partitions = min_spiffs.csv +lib_deps = + ${com-esp.lib_deps} + ${libraries.ble} +build_flags = + ${com-esp.build_flags} + '-DZgatewayBT="BT"' + '-DESP32_ETHERNET=true' + '-DETH_PHY_ADDR=1' + '-DETH_PHY_POWER=16' + '-Ddefine ETH_CLK_MODE=ETH_CLOCK_GPIO0_IN' + '-DGateway_Name="OpenMQTTGateway_ESP32_WT32-ETH01"' + [env:esp32-olimex-gtw-ble-wifi] platform = ${com.esp32_platform} board = esp32-gateway