diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0d8dac0af..94275b2bd 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -52,7 +52,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c ## Changelog -### Version 8.3.1.4 +### Version 8.3.1.5 - Change IRremoteESP8266 library updated to v2.7.7 - Change Adafruit_SGP30 library from v1.0.3 to v1.2.0 (#8519) @@ -63,6 +63,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add command ``Time 4`` to display timestamp using milliseconds (#8537) - Add command ``SetOption94 0/1`` to select MAX31855 or MAX6675 thermocouple support (#8616) - Add commands ``LedPwmOn 0..255``, ``LedPwmOff 0..255`` and ``LedPwmMode1 0/1`` to control led brightness by George (#8491) +- Add ESP32 ethernet commands ``EthType 0/1``, ``EthAddress 0..31`` and ``EthClockMode 0..3`` - Add support for unique MQTTClient (and inherited fallback topic) by full Mac address using ``mqttclient DVES_%12X`` (#8300) - Add more functionality to ``Switchmode`` 11 and 12 (#8450) - Add wildcard pattern ``?`` for JSON matching in rules diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 4e0cdc436..330a9f966 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -1,5 +1,9 @@ ## Unreleased (development) +### 8.3.1.5 20200616 + +- Add ESP32 ethernet commands ``EthType 0/1``, ``EthAddress 0..31`` and ``EthClockMode 0..3`` + ### 8.3.1.4 20200615 - Add basic support for ESP32 ethernet adding commands ``Wifi 0/1`` and ``Ethernet 0/1`` both default ON diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index d0f1acc87..73fab1f70 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index f787c3c5b..9eed4e08f 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 6eec835c2..b24d9679a 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index e0ad92d4f..1533346fe 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 3525083fe..3011c2aa1 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 6f1ef896c..430099098 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index fcc007188..d4dbbb695 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index c4752b7a6..cb3a83d7c 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index 0e85e9933..d7aa3b36b 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index 10af70597..c82ca66f4 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -672,7 +672,7 @@ #define D_SENSOR_HM10_TX "HM10 - TX" #define D_SENSOR_LE01MR_RX "LE-01MR - RX" #define D_SENSOR_LE01MR_TX "LE-01MR - TX" -#define D_SENSOR_BL0940_RX "BL0940 - Rx" +#define D_SENSOR_BL0940_RX "BL0940 - RX" #define D_SENSOR_CC1101_GDO0 "CC1101 - GDO0" #define D_SENSOR_CC1101_GDO2 "CC1101 - GDO2" #define D_SENSOR_HRXL_RX "HRXL - RX" @@ -693,8 +693,11 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" -#define D_SENSOR_TCP_TXD "TCP Tx" -#define D_SENSOR_TCP_RXD "TCP Rx" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" +#define D_SENSOR_TCP_TXD "TCP - TX" +#define D_SENSOR_TCP_RXD "TCP - RX" // Units #define D_UNIT_AMPERE "A" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index 23084ea59..55137c085 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index f0700450f..faf3a35da 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index 026d4e682..28be27c64 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index f19d63577..9ee7e4066 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index 32a3b509c..424e7dd80 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index c173cde0d..a45798e13 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 6415e61d2..26e9064f1 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 8171d967f..211f070dd 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index af6b6eeed..ffb393796 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index c65b7a71c..f11bddaa0 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index 00e0cf013..d6dea2da6 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index e1e784f53..e83253105 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 3c093a7c3..fbf7e3e4c 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -693,6 +693,9 @@ #define D_GPIO_WEBCAM_PSCLK "CAM_PSCLK" #define D_GPIO_WEBCAM_HSD "CAM_HSD" #define D_GPIO_WEBCAM_PSRCS "CAM_PSRCS" +#define D_SENSOR_ETH_PHY_POWER "ETH POWER" +#define D_SENSOR_ETH_PHY_MDC "ETH MDC" +#define D_SENSOR_ETH_PHY_MDIO "ETH MDIO" #define D_SENSOR_TCP_TXD "TCP Tx" #define D_SENSOR_TCP_RXD "TCP Rx" diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index f2cf90b18..1e8d59881 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -730,10 +730,15 @@ #ifdef ESP32 -//#define USE_ETHERNET // Add support for ethernet (Currently fixed for Olimex ESP32-PoE) -//#define USE_SPI // Add support for hardware SPI -//#define USE_MI_ESP32 // Add support for ESP32 as a BLE-bridge (+9k2 mem, +292k flash) -//#define USE_WEBCAM // Add support for webcam +//#define USE_ETHERNET // Add support for ethernet (Currently fixed for Olimex ESP32-PoE) + // Olimex ESP32-PoE + #define ETH_TYPE 0 // [EthType] 0 = ETH_PHY_LAN8720, 1 = ETH_PHY_TLK110 + #define ETH_ADDR 0 // [EthAddress] 0 = PHY0 .. 31 = PHY31 + #define ETH_CLKMODE 3 // [EthClockMode] 0 = ETH_CLOCK_GPIO0_IN, 1 = ETH_CLOCK_GPIO0_OUT, 2 = ETH_CLOCK_GPIO16_OUT, 3 = ETH_CLOCK_GPIO17_OUT + +//#define USE_SPI // Add support for hardware SPI +//#define USE_MI_ESP32 // Add support for ESP32 as a BLE-bridge (+9k2 mem, +292k flash) +//#define USE_WEBCAM // Add support for webcam #endif diff --git a/tasmota/settings.h b/tasmota/settings.h index db19c1199..80507e97b 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -392,12 +392,13 @@ struct { #else // ESP32 myio my_gp; // 3AC - 2 x 40 bytes (ESP32) mytmplt user_template; // 3FC - 2 x 37 bytes (ESP32) + uint8_t eth_type; // 446 + uint8_t eth_clk_mode; // 447 - uint8_t free_esp32_446[6]; // 446 + uint8_t free_esp32_448[4]; // 448 WebCamCfg webcam_config; // 44C - - uint8_t free_esp32_450[1]; // 450 + uint8_t eth_address; // 450 #endif // ESP8266 - ESP32 char serial_delimiter; // 451 diff --git a/tasmota/settings.ino b/tasmota/settings.ino index 1b2dca82d..a294e2813 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -800,6 +800,11 @@ void SettingsDefaultSet2(void) // Ethernet flag4.network_ethernet |= 1; +#ifdef ESP32 + Settings.eth_type = ETH_TYPE; + Settings.eth_clk_mode = ETH_CLKMODE; + Settings.eth_address = ETH_ADDR; +#endif // Wifi flag4.network_wifi |= 1; @@ -1447,6 +1452,13 @@ void SettingsDelta(void) Settings.flag4.network_wifi = 1; Settings.flag4.network_ethernet = 1; } + if (Settings.version < 0x08030105) { +#ifdef ESP32 + Settings.eth_type = ETH_TYPE; + Settings.eth_clk_mode = ETH_CLKMODE; + Settings.eth_address = ETH_ADDR; +#endif + } Settings.version = VERSION; SettingsSave(1); diff --git a/tasmota/support_features.ino b/tasmota/support_features.ino index 8564aed3e..5e582b0f9 100644 --- a/tasmota/support_features.ino +++ b/tasmota/support_features.ino @@ -579,14 +579,15 @@ void GetFeatures(void) feature6 |= 0x00008000; // xdrv_40_telegram.ino #endif #ifdef USE_HP303B - feature6 |= 0x00010000; // xsns_73_hp303b.ino + feature6 |= 0x00010000; // xsns_73_hp303b.ino +#endif +#ifdef USE_TCP_BRIDGE + feature6 |= 0x00020000; // xdrv_41_tcp_bridge.ino #endif #ifdef USE_TELEINFO - feature6 |= 0x00020000; // xnrg_15_teleinfo.ino + feature6 |= 0x00040000; // xnrg_15_teleinfo.ino #endif -// feature6 |= 0x00020000; -// feature6 |= 0x00040000; // feature6 |= 0x00080000; // feature6 |= 0x00100000; @@ -602,9 +603,9 @@ void GetFeatures(void) // feature6 |= 0x10000000; // feature6 |= 0x20000000; #ifdef USE_ETHERNET - feature6 |= 0x40000000; + feature6 |= 0x40000000; // xdrv_82_ethernet.ino #endif #ifdef USE_WEBCAM - feature6 |= 0x80000000; + feature6 |= 0x80000000; // xdrv_81_webcam.ino #endif } diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index a7430dfbb..4843cd884 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -922,7 +922,7 @@ void Every250mSeconds(void) global_state.network_down = (global_state.wifi_down && global_state.eth_down); - if (!Settings.flag.global_state) { // Problem blinkyblinky enabled - SetOption31 - Control link led blinking + if (!Settings.flag.global_state && !global_state.network_down) { // SetOption31 - Control link led blinking if (global_state.data &0x03) { // Any problem if (global_state.mqtt_down) { blinkinterval = 7; } // MQTT problem so blink every 2 seconds (slowest) if (global_state.network_down) { blinkinterval = 3; } // Network problem so blink every second (slow) diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 4a35d4327..2c93f1b88 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -322,6 +322,9 @@ void setup(void) { XdrvCall(FUNC_INIT); XsnsCall(FUNC_INIT); +#ifdef USE_SCRIPT + Run_Scripter(">BS",3,0); +#endif rules_flag.system_init = 1; } diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index a99e34143..0543fc7cd 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -234,10 +234,10 @@ enum UserSelectablePins { GPIO_BOILER_OT_TX, // OpenTherm Boiler TX pin GPIO_WINDMETER_SPEED, // WindMeter speed counter pin GPIO_BL0940_RX, // BL0940 serial interface - GPIO_TELEINFO_RX, // BL0940 serial interface - GPIO_TELEINFO_ENABLE, // BL0940 serial interface GPIO_TCP_TX, // TCP Serial bridge GPIO_TCP_RX, // TCP Serial bridge + GPIO_TELEINFO_RX, // TELEINFO serial interface + GPIO_TELEINFO_ENABLE,// TELEINFO Enable PIN GPIO_SENSOR_END }; // Programmer selectable GPIO functionality @@ -329,8 +329,8 @@ const char kSensorNames[] PROGMEM = D_SENSOR_BOILER_OT_RX "|" D_SENSOR_BOILER_OT_TX "|" D_SENSOR_WINDMETER_SPEED "|" D_SENSOR_BL0940_RX "|" - D_SENSOR_TELEINFO_RX "|" D_SENSOR_TELEINFO_ENABLE "|" - D_SENSOR_TCP_TXD "|" D_SENSOR_TCP_RXD + D_SENSOR_TCP_TXD "|" D_SENSOR_TCP_RXD "|" + D_SENSOR_TELEINFO_RX "|" D_SENSOR_TELEINFO_ENABLE ; const char kSensorNamesFixed[] PROGMEM = @@ -580,6 +580,10 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_SBR_TX, // Serial Bridge Serial interface GPIO_SBR_RX, // Serial Bridge Serial interface #endif +#ifdef USE_TCP_BRIDGE + GPIO_TCP_TX, // TCP Serial bridge + GPIO_TCP_RX, // TCP Serial bridge +#endif #ifdef USE_ZIGBEE GPIO_ZIGBEE_TX, // Zigbee Serial interface GPIO_ZIGBEE_RX, // Zigbee Serial interface @@ -688,14 +692,14 @@ const uint8_t kGpioNiceList[] PROGMEM = { #ifdef USE_AS3935 GPIO_AS3935, #endif -#ifdef USE_TELEINFO - GPIO_TELEINFO_RX, - GPIO_TELEINFO_ENABLE, -#endif #ifdef USE_TCP_BRIDGE AGPIO(GPIO_TCP_TX), // TCP Serial bridge AGPIO(GPIO_TCP_RX), // TCP Serial bridge #endif +#ifdef USE_TELEINFO + GPIO_TELEINFO_RX, + GPIO_TELEINFO_ENABLE, +#endif }; /********************************************************************************************/ diff --git a/tasmota/tasmota_template_ESP32.h b/tasmota/tasmota_template_ESP32.h index 769980939..d85ec1a6f 100644 --- a/tasmota/tasmota_template_ESP32.h +++ b/tasmota/tasmota_template_ESP32.h @@ -129,9 +129,10 @@ enum UserSelectablePins { GPIO_WINDMETER_SPEED, // WindMeter speed counter pin GPIO_KEY1_TC, // Touch pin as button GPIO_BL0940_RX, // BL0940 serial interface + GPIO_TCP_TX, GPIO_TCP_RX, // TCP to serial bridge + GPIO_ETH_PHY_POWER, GPIO_ETH_PHY_MDC, GPIO_ETH_PHY_MDIO, // Ethernet GPIO_TELEINFO_RX, // Teleinfo telemetry data receive pin GPIO_TELEINFO_ENABLE, // Teleinfo Enable Receive Pin - GPIO_TCP_TX, GPIO_TCP_RX, // TCP to serial bridge GPIO_SENSOR_END }; enum ProgramSelectablePins { @@ -222,8 +223,10 @@ const char kSensorNames[] PROGMEM = D_SENSOR_BOILER_OT_RX "|" D_SENSOR_BOILER_OT_TX "|" D_SENSOR_WINDMETER_SPEED "|" D_SENSOR_BUTTON "_tc|" D_SENSOR_BL0940_RX "|" - D_SENSOR_TELEINFO_RX "|" D_SENSOR_TELEINFO_ENABLE "|" - D_SENSOR_TCP_TXD "|" D_SENSOR_TCP_RXD + D_SENSOR_TCP_TXD "|" D_SENSOR_TCP_RXD "|" + D_SENSOR_ETH_PHY_POWER "|" D_SENSOR_ETH_PHY_MDC "|" D_SENSOR_ETH_PHY_MDIO "|" + D_SENSOR_TCP_TXD "|" D_SENSOR_TCP_RXD "|" + D_SENSOR_TELEINFO_RX "|" D_SENSOR_TELEINFO_ENABLE ; const char kSensorNamesFixed[] PROGMEM = @@ -238,6 +241,7 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_KEY1_NP) + MAX_KEYS, AGPIO(GPIO_KEY1_INV) + MAX_KEYS, AGPIO(GPIO_KEY1_INV_NP) + MAX_KEYS, + AGPIO(GPIO_KEY1_TC) + MAX_KEYS, // Touch button AGPIO(GPIO_SWT1) + MAX_SWITCHES, // User connected external switches AGPIO(GPIO_SWT1_NP) + MAX_SWITCHES, AGPIO(GPIO_REL1) + MAX_RELAYS, // Relays @@ -420,6 +424,10 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_SBR_TX), // Serial Bridge Serial interface AGPIO(GPIO_SBR_RX), // Serial Bridge Serial interface #endif +#ifdef USE_TCP_BRIDGE + AGPIO(GPIO_TCP_TX), // TCP Serial bridge + AGPIO(GPIO_TCP_RX), // TCP Serial bridge +#endif #ifdef USE_ZIGBEE AGPIO(GPIO_ZIGBEE_TX), // Zigbee Serial interface AGPIO(GPIO_ZIGBEE_RX), // Zigbee Serial interface @@ -557,11 +565,11 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_WEBCAM_HSD) + MAX_WEBCAM_HSD, AGPIO(GPIO_WEBCAM_PSRCS), #endif -#ifdef USE_TCP_BRIDGE - AGPIO(GPIO_TCP_TX), // TCP Serial bridge - AGPIO(GPIO_TCP_RX), // TCP Serial bridge +#ifdef USE_ETHERNET + AGPIO(GPIO_ETH_PHY_POWER), + AGPIO(GPIO_ETH_PHY_MDC), + AGPIO(GPIO_ETH_PHY_MDIO), // Ethernet #endif - AGPIO(GPIO_KEY1_TC) + MAX_KEYS }; //******************************************************************************************** @@ -676,6 +684,15 @@ const mytmplt kModules PROGMEM = 0 // Flag }; +/*********************************************************************************************\ + Known templates + +{"NAME":"AITHINKER CAM","GPIO":[4992,65504,65504,65504,65504,5088,65504,65504,65504,65504,65504,65504,65504,65504,5089,5090,0,5091,5184,5152,0,5120,5024,5056,0,0,0,0,4928,65504,5094,5095,5092,0,0,5093],"FLAG":0,"BASE":1} +{"NAME":"Olimex ESP32-PoE","GPIO":[65504,65504,65504,65504,65504,65504,0,0,5536,65504,65504,65504,65504,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,65504,65504,65504,65504,65504,0,0,65504],"FLAG":0,"BASE":1} + +\*********************************************************************************************/ + + #endif // ESP32 #endif // _TASMOTA_TEMPLATE_ESP32_H_ diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index e01e1bcce..69146852c 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,7 +20,7 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x08030104; +const uint32_t VERSION = 0x08030105; // Lowest compatible version const uint32_t VERSION_COMPATIBLE = 0x07010006; diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index e21d3566b..5313d8ffb 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -2482,7 +2482,8 @@ void HandleInformation(void) if (static_cast(EthernetLocalIP()) != 0) { WSContentSend_P(PSTR("}1" D_HOSTNAME "}2%s%s"), EthernetHostname(), (Mdns.begun) ? ".local" : ""); WSContentSend_P(PSTR("}1" D_MAC_ADDRESS "}2%s"), EthernetMacAddress().c_str()); - WSContentSend_P(PSTR("}1" D_IP_ADDRESS "}2%s"), EthernetLocalIP().toString().c_str()); + WSContentSend_P(PSTR("}1" D_IP_ADDRESS " (eth)}2%s"), EthernetLocalIP().toString().c_str()); + WSContentSend_P(PSTR("}1
}2
")); } #endif #endif @@ -2498,7 +2499,8 @@ void HandleInformation(void) #endif if (static_cast(WiFi.localIP()) != 0) { WSContentSend_P(PSTR("}1" D_MAC_ADDRESS "}2%s"), WiFi.macAddress().c_str()); - WSContentSend_P(PSTR("}1" D_IP_ADDRESS "}2%s"), WiFi.localIP().toString().c_str()); + WSContentSend_P(PSTR("}1" D_IP_ADDRESS " (wifi)}2%s"), WiFi.localIP().toString().c_str()); + WSContentSend_P(PSTR("}1
}2
")); } } if (!global_state.network_down) { @@ -2507,8 +2509,9 @@ void HandleInformation(void) WSContentSend_P(PSTR("}1" D_DNS_SERVER "}2%s"), IPAddress(Settings.ip_address[3]).toString().c_str()); } if (static_cast(WiFi.softAPIP()) != 0) { + WSContentSend_P(PSTR("}1
}2
")); WSContentSend_P(PSTR("}1" D_MAC_ADDRESS "}2%s"), WiFi.softAPmacAddress().c_str()); - WSContentSend_P(PSTR("}1" D_IP_ADDRESS "}2%s"), WiFi.softAPIP().toString().c_str()); + WSContentSend_P(PSTR("}1" D_IP_ADDRESS " (AP)}2%s"), WiFi.softAPIP().toString().c_str()); WSContentSend_P(PSTR("}1" D_GATEWAY "}2%s"), WiFi.softAPIP().toString().c_str()); } WSContentSend_P(PSTR("}1}2 ")); // Empty line diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index 7fc893ffc..208f7211c 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -120,8 +120,6 @@ uint32_t DecodeLightId(uint32_t hue_id); #endif #endif // USE_UNISHOX_COMPRESSION -#define USE_SCRIPT_TIMER - #ifdef USE_SCRIPT_TIMER #include Ticker Script_ticker1; diff --git a/tasmota/xdrv_82_ethernet.ino b/tasmota/xdrv_82_ethernet.ino index 6d9725332..e20cde4e5 100644 --- a/tasmota/xdrv_82_ethernet.ino +++ b/tasmota/xdrv_82_ethernet.ino @@ -21,13 +21,53 @@ #ifdef USE_ETHERNET /*********************************************************************************************\ * Ethernet support for ESP32 + * + * Dedicated fixed Phy pins + * GPIO17 - EMAC_CLK_OUT_180 + * GPIO19 - EMAC_TXD0(RMII) + * GPIO21 - EMAC_TX_EN(RMII) + * GPIO22 - EMAC_TXD1(RMII) + * GPIO25 - EMAC_RXD0(RMII) + * GPIO26 - EMAC_RXD1(RMII) + * GPIO27 - EMAC_RX_CRS_DV + * + * {"NAME":"Olimex ESP32-PoE","GPIO":[65504,65504,65504,65504,65504,65504,0,0,5536,65504,65504,65504,65504,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,65504,65504,65504,65504,65504,0,0,65504],"FLAG":0,"BASE":1} + * \*********************************************************************************************/ #define XDRV_82 82 +/* // Olimex ESP32-PoE -#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT -#define ETH_PHY_POWER 12 +#define ETH_CLKMODE ETH_CLOCK_GPIO17_OUT +#define ETH_POWER_PIN 12 + +//******************************************************************************************** + +#ifndef ETH_ADDR +#define ETH_ADDR 0 // esp_eth.h eth_phy_base_t: 0 = PHY0 .. 31 = PHY31 +#endif + +#ifndef ETH_TYPE +#define ETH_TYPE ETH_PHY_LAN8720 // ETH.h eth_phy_type_t: 0 = ETH_PHY_LAN8720, 1 = ETH_PHY_TLK110 +#endif + +#ifndef ETH_CLKMODE +#define ETH_CLKMODE ETH_CLOCK_GPIO0_IN // esp_eth.h eth_clock_mode_t: 0 = ETH_CLOCK_GPIO0_IN, 1 = ETH_CLOCK_GPIO0_OUT, 2 = ETH_CLOCK_GPIO16_OUT, 3 = ETH_CLOCK_GPIO17_OUT +#endif +*/ + +#ifndef ETH_POWER_PIN +#define ETH_POWER_PIN -1 +#endif + +#ifndef ETH_MDC_PIN +#define ETH_MDC_PIN 23 +#endif + +#ifndef ETH_MDIO_PIN +#define ETH_MDIO_PIN 18 +#endif #include @@ -75,7 +115,13 @@ void EthernetInit(void) { snprintf_P(Eth.hostname, sizeof(Eth.hostname), PSTR("%s_eth"), my_hostname); WiFi.onEvent(EthernetEvent); - ETH.begin(); + + int eth_power = (PinUsed(GPIO_ETH_PHY_POWER)) ? Pin(GPIO_ETH_PHY_POWER) : ETH_POWER_PIN; + int eth_mdc = (PinUsed(GPIO_ETH_PHY_MDC)) ? Pin(GPIO_ETH_PHY_MDC) : ETH_MDC_PIN; + int eth_mdio = (PinUsed(GPIO_ETH_PHY_MDIO)) ? Pin(GPIO_ETH_PHY_MDIO) : ETH_MDIO_PIN; + if (!ETH.begin(Settings.eth_address, eth_power, eth_mdc, eth_mdio, (eth_phy_type_t)Settings.eth_type, (eth_clock_mode_t)Settings.eth_clk_mode)) { + AddLog_P2(LOG_LEVEL_DEBUG, PSTR("ETH: Bad PHY type or init error")); + }; } IPAddress EthernetLocalIP(void) { @@ -94,11 +140,15 @@ String EthernetMacAddress(void) { * Commands \*********************************************************************************************/ +#define D_CMND_ETHADDRESS "EthAddress" +#define D_CMND_ETHTYPE "EthType" +#define D_CMND_ETHCLOCKMODE "EthClockMode" + const char kEthernetCommands[] PROGMEM = "|" // No prefix - D_CMND_ETHERNET; + D_CMND_ETHERNET "|" D_CMND_ETHADDRESS "|" D_CMND_ETHTYPE "|" D_CMND_ETHCLOCKMODE; void (* const EthernetCommand[])(void) PROGMEM = { - &CmndEthernet }; + &CmndEthernet, &CmndEthAddress, &CmndEthType, &CmndEthClockMode }; void CmndEthernet(void) { @@ -109,6 +159,33 @@ void CmndEthernet(void) ResponseCmndStateText(Settings.flag4.network_ethernet); } +void CmndEthAddress(void) +{ + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 31)) { + Settings.eth_address = XdrvMailbox.payload; + restart_flag = 2; + } + ResponseCmndNumber(Settings.eth_address); +} + +void CmndEthType(void) +{ + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { + Settings.eth_type = XdrvMailbox.payload; + restart_flag = 2; + } + ResponseCmndNumber(Settings.eth_type); +} + +void CmndEthClockMode(void) +{ + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 3)) { + Settings.eth_clk_mode = XdrvMailbox.payload; + restart_flag = 2; + } + ResponseCmndNumber(Settings.eth_clk_mode); +} + /*********************************************************************************************\ * Interface \*********************************************************************************************/ diff --git a/tasmota/xdsp_04_ili9341.ino b/tasmota/xdsp_04_ili9341.ino index f5c485e6f..21981ff76 100644 --- a/tasmota/xdsp_04_ili9341.ino +++ b/tasmota/xdsp_04_ili9341.ino @@ -93,7 +93,7 @@ void Ili9341InitDriver(void) #ifdef ESP8266 tft = new Adafruit_ILI9341(Pin(GPIO_SPI_CS), Pin(GPIO_SPI_DC)); #else // ESP32 - tft = new Adafruit_ILI9341(Pin (GPIO_TFT_CS), Pin (GPIO_TFT_DC), Pin (GPIO_TFT_MOSI), Pin (GPIO_TFT_CLK), Pin (GPIO_TFT_RST), Pin(GPIO_TFT_MISO)); + tft = new Adafruit_ILI9341(Pin(GPIO_SPI_CS), Pin(GPIO_SPI_DC), Pin(GPIO_SPI_MOSI), Pin(GPIO_SPI_CLK), -1, Pin(GPIO_SPI_MISO)); #endif tft->begin(); diff --git a/tools/decode-status.py b/tools/decode-status.py index 095e23e71..d0be84459 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -206,7 +206,7 @@ a_features = [[ "USE_IAQ","USE_DISPLAY_SEVENSEG","USE_AS3935","USE_PING", "USE_WINDMETER","USE_OPENTHERM","USE_THERMOSTAT","USE_VEML6075", "USE_VEML7700","USE_MCP9808","USE_BL0940","USE_TELEGRAM", - "USE_HP303B","","","", + "USE_HP303B","USE_TCP_BRIDGE","","", "","","","", "","","","", "","","USE_ETHERNET","USE_WEBCAM"