Прошивка Tasmota Ethernet WT32-ETH01.
ESP32 – LAN8720A Board – Tasmota
Так все работает – Ethernet and Tasmota – ESP32 LAN8720A Board – All is Working.
ESP32 | LAN8720 board |
---|---|
GPIO16 – OSC_ENABLE | NC – Осциллятор ENABLE (белый провод, 4.7K к Ground) |
GPIO22 – EMAC_TXD1 | TX1 |
GPIO19 – EMAC_TXD0 | TX0 |
GPIO21 – EMAC_TX_EN | TX_EN |
GPIO26 – EMAC_RXD1 | RX1 |
GPIO25 – EMAC_RXD0 | RX0 |
GPIO27 – EMAC_CRS_DV | CRS |
GPIO00 – EMAC_CLK (Возле кнопки) | nINT/REFCLK (50MHz) |
GPIO23 – SMI_MDC | MDC |
GPIO18 – SMI_MDIO | MDIO |
GND | GND |
3V3 | VCC |
Tasmota Config Ethernet:
#define USE_ETHERNET // Add support for ethernet (+20k code)
#define USE_WT32_ETH01 // Add support for Wireless-Tag WT32-ETH01
#define ETH_TYPE 0 // [EthType] 0 = ETH_PHY_LAN8720
#define ETH_ADDRESS 1 // [EthAddress] 0 = PHY0 .. 31 = PHY31
#define ETH_CLKMODE 0 // [EthClockMode] 0 = ETH_CLOCK_GPIO0_IN
Блок управления насосом в колодце.
Скоро будет схема и описание.
Tasmota Rules:
BACKLOG SETOPTION114 1;SWITCHMODE 1
RULE
ON SYSTEM#BOOT DO POWER0 OFF ENDON
ON POWER1#STATE=1 DO POWER2 ON ENDON
ON POWER1#STATE=0 DO POWER2 OFF ENDON
ON POWER2#STATE=1 DO POWER1 ON ENDON
ON POWER2#STATE=0 DO POWER1 OFF ENDON
ON MQTT#DISCONNECTED DO POWER0 OFF ENDON
ON SWITCH1#STATE=1 DO POWER2 OFF ENDON
ON SWITCH1#STATE=0 DO POWER1 ON ENDON
RULE2
ON EVENT#MCPINT_D4=0 DO POWER2 OFF ENDON
ON EVENT#MCPINT_D5=0 DO POWER2 OFF ENDON
RULE3
ON EVENT#MCPINT_D3=1 DO POWER1 ON ENDON
ON EVENT#MCPINT_D3=0 DO POWER2 OFF ENDON
Правила для системы авто-полива. Отображения индикации.
RULE
ON EVENT#MCPINT_D3=1 DO POWER1 TOGGLE ENDON
ON EVENT#MCPINT_D3=0 DO POWER1 TOGGLE ENDON
ON EVENT#MCPINT_D4=1 DO POWER2 TOGGLE ENDON
ON EVENT#MCPINT_D4=0 DO POWER2 TOGGLE ENDON
ON EVENT#MCPINT_D5=1 DO POWER3 TOGGLE ENDON
ON EVENT#MCPINT_D5=0 DO POWER3 TOGGLE ENDON
ON SYSTEM#BOOT DO POWER0 0 ENDON
Команды Tasmota and Rules
/tasmota/include/tasmota.h
MAX_FRIENDLYNAMES = 8
SetOption24 Set pressure units : 0 = hPa (default) 1 = mmHg
SetOption146 1 = enable display of ESP32 internal temperature
https://tasmota.github.io/docs/
Rule1
ON system#boot DO backlog var1 0;power0 off ENDON
ON power2#state=1 DO if (var1!=1) ruletimer1 0;var1 1 endif ENDON
ON event#MCPINT_D0=1 DO if (var1==1) var1 2;ruletimer1 10 endif ENDON
ON rules#timer=1 DO Backlog var1 0;power2 off ENDON
Если включить Power2 то включается режим ожидания MCPINT_D0, как только D0=1 то через 10 секунд Power2 выключиться.
Rule1
ON button1#state DO Backlog Power1 %value%; RuleTimer1 600 ENDON
ON Rules#Timer=1 DO Power1 off ENDON
RuleTimer1 600 ENDON
Additionally RuleTimer1 will begin to countdown 10 minutes
ON Rules#Timer=1 DO Power1 off ENDON
After the RuleTimer1 expires the light will be turned off (if you forgot to turn it off)
Выключит Power1 через 10 минут.
When SetOption114 1 all switches are detached from their respective relays and will send MQTT messages instead in the form of {“Switch”:{“Action”:””}}.
SwitchMode 1
Set switch to follow mode (0 = OFF, 1 = ON)
RULE
ON SWITCH1#STATE=1 DO POWER2 OFF ENDON
ON SWITCH1#STATE=0 DO POWER1 ON ENDON
Управление насосом в колодце.
BACKLOG SETOPTION114 1;SWITCHMODE 1
RULE
ON SYSTEM#BOOT DO POWER0 OFF ENDON
ON POWER1#STATE=1 DO POWER2 ON ENDON
ON POWER1#STATE=0 DO POWER2 OFF ENDON
ON POWER2#STATE=1 DO POWER1 ON ENDON
ON POWER2#STATE=0 DO POWER1 OFF ENDON
ON MQTT#DISCONNECTED DO POWER0 OFF ENDON
ON SWITCH1#STATE=1 DO POWER2 OFF ENDON
ON SWITCH1#STATE=0 DO POWER1 ON ENDON