Ethernet Component

This ESPHome component enables wired Ethernet connections for ESP32s.

Ethernet for ESP8266 is not supported.

This component and the Wi-Fi component may not be used simultaneously, even if both are physically available.

# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 0

  # Optional manual IP
  manual_ip:
    static_ip: 10.0.0.42
    gateway: 10.0.0.1
    subnet: 255.255.255.0

Configuration variables:

  • type (Required, string): The type of LAN chipset/phy. Must be one of LAN8720, TLK110 or IP101 (see datasheet for more details).

  • mdc_pin (Required, Pin): The MDC pin of the board. Usually this is GPIO23.

  • mdio_pin (Required, Pin): The MDIO pin of the board. Usually this is GPIO18.

  • clk_mode (Optional, string): The clock mode of the data lines. See your board’s datasheet for more details. Must be one of the following values:

    • GPIO0_IN (Default) - External clock

    • GPIO0_OUT - Internal clock

    • GPIO16_OUT - Internal clock

    • GPIO17_OUT - Internal clock

  • phy_addr (Optional, int): The PHY addr type of the Ethernet controller. Defaults to 0.

  • power_pin (Optional, Pin Schema): The pin controlling the power/reset status of the Ethernet controller. Leave unspecified for no power pin (default).

  • manual_ip (Optional): Manually configure the static IP of the node.

    • static_ip (Required, IPv4 address): The static IP of your node.

    • gateway (Required, IPv4 address): The gateway of the local network.

    • subnet (Required, IPv4 address): The subnet of the local network.

    • dns1 (Optional, IPv4 address): The main DNS server to use.

    • dns2 (Optional, IPv4 address): The backup DNS server to use.

  • use_address (Optional, string): Manually override what address to use to connect to the ESP. Defaults to auto-generated value. For example, if you have changed your static IP and want to flash OTA to the previously configured IP address.

  • domain (Optional, string): Set the domain of the node hostname used for uploading. For example, if it’s set to .local, all uploads will be sent to <HOSTNAME>.local. Defaults to .local.

  • id (Optional, ID): Manually specify the ID used for code generation.

Note

If your Ethernet board is not designed with an ESP32 built in, it’s common to attempt to use flying leads, dupont wires, etc. to connect the Ethernet controller to the ESP32. This approach is likely to fail, however, as the Ethernet interface uses a high frequency clock signal that will not travel reliably over these types of connections. For more information and wiring details refer to the link in the See also section.

Configuration for Olimex ESP32-POE

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0
  power_pin: GPIO12

Configuration for Olimex ESP32-EVB

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 0

Configuration for Olimex ESP32-GATEWAY

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

Configuration for LILYGO TTGO T-Internet-POE ESP32-WROOM LAN8270A Chip

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

Configuration for Wireless Tag WT32-ETH01

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16

Configuration for OpenHacks LAN8720

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  phy_addr: 1

Note

This board has an issue that might cause the ESP32 to boot in program mode. When testing, make sure you are monitoring the serial output and reboot the device several times to see if it boots into the program properly.

Configuration for wESP32 board (up to rev.6)

ethernet:
  type: LAN8720
  mdc_pin: GPIO16
  mdio_pin: GPIO17
  clk_mode: GPIO0_IN
  phy_addr: 0

Note

Revision 7 and upwards of the wESP32 board does not have a LAN8720 chip. Until support for the replacement RTL8201 is included in ESPHome, the wESP board rev.7 will not work with the above configuration.

Configuration for ESP32-Ethernet-Kit board

ethernet:
  type: IP101
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO5

See Also