esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

[ETH RTL8201] Static IP stop working after update to 2024.5.0 #5798

Closed kzajac83 closed 5 months ago

kzajac83 commented 5 months ago

The problem

After toady (15.05.2024) update ESPHome to 2024.5.0 static IP configuration stop working and switch into DHCP for ethernet module RTL8201.

Which version of ESPHome has the issue?

2024.5.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.5.3

What platform are you using?

ESP32

Board

ESP32DEV lilygo-eth

Component causing the issue

etherent

Example YAML snippet

esphome:
  name: esphome--lilygo-eth

esp32:
  board: esp32dev
  framework:
    type: arduino

ethernet:
  type: RTL8201
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  power_pin: GPIO12
  phy_addr: 0
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.15.25
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.15.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0

ota:
  password: #####

psram:
  mode: quad
  speed: 80MHz

logger:
  id: component_logger
  level: VERBOSE
  #baud_rate: 115200

time:
#  - platform: sntp
#    id: sntp_time
#    timezone: Europe/Warsaw
#    - servers:
#      0.pool.ntp.org
#      1.pool.ntp.org
#      2.pool.ntp.org
  #platform: sntp
  #servers: 192.168.13.1 
  #id: time_sntp
   platform: homeassistant
   id: homeassistant_time
#   timezone: Europe/Warsaw

external_components:
 # - source: github://oxan/esphome-stream-server
  - source: github://SzczepanLeon/esphome-components@main
    refresh: 0d
    components: [ wmbus ]

wmbus:
  frequency: 868.950
  sync_mode: True
  log_unknown: True
  miso_pin: GPIO13
  mosi_pin: GPIO14
  clk_pin:  GPIO15
  cs_pin:   GPIO32
  gdo0_pin: GPIO33
  gdo2_pin: GPIO34
  #led_pin:
  #  number: GPIO5
  #led_blink_time: "300ms"
  clients:
      name: "HA"
      ip_address: "192.168.15.5"
      port: 1234
      #format: HEX

api:
  encryption:
    key: "CbH3NgcR+ZfqlldGXymtYvdCMOmsTMepQ3LL2CWsLyg="

sensor:
  - platform: wmbus
    meter_id: 0x0123456
    type: apator162
    key: "00000000000000000000000000000000"
    lqi:
      name: "lqi"
    rssi:
      name: "RSSI"
    total_water_m3:
      name: "CWU Lok"
      filters:
       - offset: 0.0

text_sensor:
  - platform: wmbus
    name: "Text debug for Apator 16-2"

Anything in the logs that might be useful for us?

After connect serial adapter (without PoE eth) got:

▒▒▒▒▒▒ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
[     8][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, A                                                                                                                                   PB: 80000000 Hz
[   456][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
[I][logger:156]: Log initialized
[C][ota:483]: There have been 1 suspected unsuccessful boot attempts.
[D][esp32.preferences:114]: Saving 1 preferences to flash...
[V][esp32.preferences:126]: sync: key: 233825507, len: 4
[D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written,                                                                                                                                    0 failed
[I][app:029]: Running through setup()...
[V][app:030]: Sorting components by setup priority...
[C][ethernet:034]: Setting up Ethernet...
[V][ethernet:617]: Hardware default RTL8201 RMII Mode Register is: 0x0FFA
[V][ethernet:624]: Setting RTL8201 RMII Mode Register to: 0x1FFA
[V][ethernet:376][sys_evt]: [Ethernet event] ETH started (num=0)
[V][ethernet:433]: DHCP Client Status: 0
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[V][ethernet:433]: DHCP Client Status: 2
[...]

should not be DHCP but static IP 192.168.15.25.

Additional information

Can be connected with:

Add PHY register writes to enable external clock on Ethernet with RTL8201 #6704 therefore call @jesserockz to confirm or deny.

UPDATE: After connect to PoE/Ethernet

  1. Checking DHCP server - no DHCP request in logs of DHCP server
  2. Assign static IP in laptop 192.168.15.26/24 and via PoE adapter connect to the device - cannot ping 192.168.15.25 (static IP from yaml config).

General ETH RTL8201 stop working after the update.

Back to v2024.4.2 where working fine eth.

console08 commented 5 months ago

I'm running into the same problem after updating to 2024.5.0 and I also use "clk_mode: GPIO0_IN". I have an esp32dev board running the esp32_ble_tracker component with the esp-idf framework and it uses an RTL8201F [M91CT21 GN07B]. It's a Gemmy "Orchestra of Lights" Smart Hub board with an RTL8201 and 25MHz crystal.

I believe pin 12 is floating after checking with a magnifier but have not verified with an oscilloscope. ESPHome initializes and prints all of the normal component startup log messages to the serial port and the ethernet link comes up at 100Mbps, but then the ethernet component is returning an "insufficient TX buffer size" error and the esp32 does not respond to external connection attempts over the wired ethernet network.

... [C][api:139]: API Server: [C][api:140]: Address: 192.168.xxx.65:6053 [C][api:142]: Using noise encryption: YES [D][esp-idf:000][tiT]: E (11152) esp.emac: emac_esp32_transmit(229): insufficient TX buffer size [D][esp-idf:000][tiT]: E (64507) esp.emac: emac_esp32_transmit(229): insufficient TX buffer size [D][esp-idf:000][tiT]: E (124507) esp.emac: emac_esp32_transmit(229): insufficient TX buffer size [D][esp-idf:000][tiT]: E (184507) esp.emac: emac_esp32_transmit(229): insufficient TX buffer size

matwho commented 5 months ago

I have:

ethernet:
  type: RTL8201
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  power_pin: GPIO12
  phy_addr: 0

It too has the link come up but does not respond to any connection on wired ethernet.

And see this in log on serial port:

[12:21:08][W][ethernet:241]: Connecting via ethernet failed! Re-connecting...
[12:21:08][D][esp-idf:000][tiT]: E (39970) esp.emac: emac_esp32_transmit(229): insufficient TX buffer size
kzajac83 commented 5 months ago

@heythisisnate can we upgrade from earlier version 2024.4.2 to 2024.5.1? Issue is fixed in current release?

https://github.com/esphome/esphome/pull/6704

UPDATE. The same question to 2024.5.2.

heythisisnate commented 5 months ago

@console08 @matwho Do you know for sure if the board you are using has an external clock? you may try setting clk_mode: GIPO_OUT and see if that helps.

@kzajac83 the change I made in https://github.com/esphome/esphome/pull/6704 is included in 2024.5 already. Its possible that this change caused problems on other boards with this RTL8201 chip.

heythisisnate commented 5 months ago

@kzajac83 have you been able to resolve this by changing clk_mode setting?

If no, can you share a link to the schematic for your hardware?

kzajac83 commented 5 months ago

@heythisisnate This is PoE board with module CC1101 (868 MHz) and I placed it in very hard accessible place to the best received signals from antenna then if you can check without touching it then maybe help this links:

https://www.lilygo.cc/products/t-eth-lite?variant=43120887038133

https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-Series

kzajac83 commented 5 months ago

PS. Hope will help:

https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-Series/blob/master/schematic/T-ETH-Lite-ESP32.pdf https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-Series/tree/master/schematic

heythisisnate commented 5 months ago

@kzajac83 will you please enable VERBOSE logging on the Ethernet component and look for two lines like this:

[16:39:42][V][ethernet:615]: Hardware default RTL8201 RMII Mode Register is: 0x0FFA
[16:39:42][V][ethernet:622]: Setting RTL8201 RMII Mode Register to: 0x1FFA

And please share them here. I am interested in the initial value of the register.

kzajac83 commented 5 months ago

Set to VERBOSE but cannot found what you asking in logs hence send all

INFO ESPHome 2024.4.2
INFO Reading configuration /config/esphome/wmbusreder-nowy.yaml...
INFO Updating https://github.com/SzczepanLeon/esphome-components.git@main
WARNING GPIO12 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Detected timezone 'Europe/Warsaw'
WARNING GPIO15 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Compiling app...
Processing esphome--lilygo-eth (board: esp32dev; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
|-- noise-c @ 0.1.4
|-- SPI @ 2.0.0
|-- SmartRC-CC1101-Driver-Lib @ 2.5.7+sha.b8c6af4
|-- wmbus-drivers @ 0.0.0+20240516003403.sha.1ad30e4
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/api_frame_helper.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/api_pb2.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/api_pb2_service.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/proto.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/subscribe_state.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/api/user_services.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/esp32/core.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/esp32/gpio.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/esp32/preferences.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/ethernet/esp_eth_phy_jl1101.c.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/ethernet/ethernet_component.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/homeassistant/time/homeassistant_time.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/logger/logger.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/logger/logger_esp32.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/logger/logger_esp8266.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/logger/logger_host.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/logger/logger_libretiny.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/logger/logger_rp2040.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/md5/md5.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/mdns/mdns_component.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/mdns/mdns_esp32.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/mdns/mdns_host.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/mdns/mdns_libretiny.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/mdns/mdns_rp2040.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/network/util.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/ota/ota_backend_arduino_libretiny.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/ota/ota_backend_arduino_rp2040.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/ota/ota_component.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/psram/psram.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/sensor/automation.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/sensor/filter.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/sensor/sensor.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/socket/lwip_sockets_impl.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/socket/socket.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/text_sensor/filter.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/text_sensor/text_sensor.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/time/automation.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/time/real_time_clock.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/wmbus/aes.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/wmbus/crc.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/wmbus/decode3of6.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/wmbus/mbus.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/wmbus/rf_cc1101.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/wmbus/utils.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/components/wmbus/wmbus.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/application.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/color.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/component.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/component_iterator.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/controller.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/entity_base.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/helpers.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/log.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/ring_buffer.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/scheduler.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/string_ref.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/time.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/esphome/core/util.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/src/main.cpp.o
Building .pioenvs/esphome--lilygo-eth/bootloader.bin
Creating esp32 image...
Successfully created esp32 image.
Generating partitions .pioenvs/esphome--lilygo-eth/partitions.bin
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFi.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFiAP.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFiClient.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFiGeneric.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFiMulti.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFiSTA.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFiScan.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFiServer.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib64d/WiFi/WiFiUdp.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/lib915/ESPmDNS/ESPmDNS.cpp.o
Archiving .pioenvs/esphome--lilygo-eth/lib64d/libWiFi.a
Compiling .pioenvs/esphome--lilygo-eth/libbc6/Update/HttpsOTAUpdate.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/libbc6/Update/Updater.cpp.o
Archiving .pioenvs/esphome--lilygo-eth/lib915/libESPmDNS.a
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_core/ed25519/core_ed25519.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_core/ed25519/core_ristretto255.c.o
Archiving .pioenvs/esphome--lilygo-eth/libbc6/libUpdate.a
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_hash/crypto_hash.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_hash/sha256/hash_sha256.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_onetimeauth/crypto_onetimeauth.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_scalarmult/crypto_scalarmult.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_stream/chacha20/stream_chacha20.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_stream/crypto_stream.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/crypto_verify/sodium/verify.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/sodium/codecs.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/sodium/core.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/sodium/runtime.c.o
Compiling .pioenvs/esphome--lilygo-eth/libba0/libsodium/sodium/utils.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/openssl/cipher-aesgcm.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/ref/cipher-aesgcm.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/ref/cipher-chachapoly.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/ref/dh-curve25519.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/ref/hash-blake2b.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/ref/hash-blake2s.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/ref/hash-sha256.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/sodium/cipher-aesgcm.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/sodium/cipher-chachapoly.c.o
Archiving .pioenvs/esphome--lilygo-eth/libba0/libsodium.a
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/sodium/dh-curve25519.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/sodium/hash-blake2b.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/backend/sodium/hash-sha256.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/aes/rijndael-alg-fst.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/blake2/blake2b.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/blake2/blake2s.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/chacha/chacha.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/donna/curve25519-donna-c64.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/donna/curve25519-donna.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/donna/poly1305-donna.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/sha2/sha256.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/sha2/sha512.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/crypto/x25519/x25519.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/cipherstate.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/dhstate.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/errors.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/handshakestate.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/hashstate.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/internal.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/names.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/patterns.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/rand_os.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/rand_sodium.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/randstate.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/signstate.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/symmetricstate.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib722/noise-c/protocol/util.c.o
Compiling .pioenvs/esphome--lilygo-eth/lib6b4/SPI/SPI.cpp.o
Archiving .pioenvs/esphome--lilygo-eth/lib722/libnoise-c.a
Compiling .pioenvs/esphome--lilygo-eth/lib536/SmartRC-CC1101-Driver-Lib/ELECHOUSE_CC1101_SRC_DRV.cpp.o
Archiving .pioenvs/esphome--lilygo-eth/lib6b4/libSPI.a
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/Esp.cpp.o
Archiving .pioenvs/esphome--lilygo-eth/lib536/libSmartRC-CC1101-Driver-Lib.a
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/FirmwareMSC.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/HWCDC.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/IPAddress.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/IPv6Address.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/MD5Builder.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/Print.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/Stream.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/StreamString.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/Tone.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/USB.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/USBCDC.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/USBMSC.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/WMath.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/WString.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/base64.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/cbuf.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-adc.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-bt.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-cpu.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-dac.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-gpio.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-i2c-slave.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-i2c.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-ledc.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-matrix.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-misc.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-psram.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-rgb-led.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-rmt.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-spi.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-time.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-timer.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-tinyusb.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-touch.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/esp32-hal-uart.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/firmware_msc_fat.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/libb64/cdecode.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/libb64/cencode.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/main.cpp.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/stdlib_noniso.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/wiring_pulse.c.o
Compiling .pioenvs/esphome--lilygo-eth/FrameworkArduino/wiring_shift.c.o
Archiving .pioenvs/esphome--lilygo-eth/libFrameworkArduino.a
Linking .pioenvs/esphome--lilygo-eth/firmware.elf
RAM:   [=         ]  11.4% (used 37308 bytes from 327680 bytes)
Flash: [====      ]  41.6% (used 762765 bytes from 1835008 bytes)
Building .pioenvs/esphome--lilygo-eth/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin([".pioenvs/esphome--lilygo-eth/firmware.bin"], [".pioenvs/esphome--lilygo-eth/firmware.elf"])
Wrote 0xca8d0 bytes to file /data/build/esphome--lilygo-eth/.pioenvs/esphome--lilygo-eth/firmware-factory.bin, ready to flash to offset 0x0
======================== [SUCCESS] Took 116.24 seconds ========================
INFO Successfully compiled program.
INFO Connecting to 192.168.15.25
INFO Uploading /data/build/esphome--lilygo-eth/.pioenvs/esphome--lilygo-eth/firmware.bin (764112 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 4.75 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.15.25 using esphome API
INFO Successfully connected to esphome--lilygo-eth @ 192.168.15.25 in 7.178s
INFO Successful handshake with esphome--lilygo-eth @ 192.168.15.25 in 0.363s
[12:39:14][I][app:100]: ESPHome version 2024.4.2 compiled on May 24 2024, 12:38:06
[12:39:14][C][logger:166]: Logger:
[12:39:14][C][logger:167]:   Level: VERBOSE
[12:39:14][C][logger:169]:   Log Baud Rate: 115200
[12:39:14][C][logger:170]:   Hardware UART: UART0
[12:39:14][C][psram:020]: PSRAM:
[12:39:14][C][psram:021]:   Available: YES
[12:39:14][C][psram:024]:   Size: 4095 KB
[12:39:14][C][homeassistant.time:010]: Home Assistant Time:
[12:39:14][C][homeassistant.time:011]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[12:39:14][C][ethernet:294]: Ethernet:
[12:39:14][C][ethernet:467]:   IP Address: 192.168.15.25
[12:39:14][C][ethernet:468]:   Hostname: 'esphome--lilygo-eth'
[12:39:14][C][ethernet:469]:   Subnet: 255.255.255.0
[12:39:14][C][ethernet:470]:   Gateway: 192.168.15.1
[12:39:14][C][ethernet:475]:   DNS1: 0.0.0.0
[12:39:14][C][ethernet:476]:   DNS2: 0.0.0.0
[12:39:14][C][ethernet:493]:   MAC Address: FC:B4:67:CF:27:E7
[12:39:14][C][ethernet:498]:   Is Full Duplex: YES
[12:39:14][C][ethernet:503]:   Link Speed: 100
[12:39:14][C][ethernet:306]:   Power Pin: 12
[12:39:14][C][ethernet:308]:   MDC Pin: 23
[12:39:14][C][ethernet:309]:   MDIO Pin: 18
[12:39:14][C][ethernet:310]:   PHY addr: 0
[12:39:14][C][ethernet:312]:   Type: RTL8201
[12:39:14][C][mdns:115]: mDNS:
[12:39:14][C][mdns:116]:   Hostname: esphome--lilygo-eth
[12:39:14][V][mdns:117]:   Services:
[12:39:14][V][mdns:119]:   - _esphomelib, _tcp, 6053
[12:39:14][V][mdns:121]:     TXT: version = 2024.4.2
[12:39:14][V][mdns:121]:     TXT: mac = fcb467cf27e4
[12:39:14][V][mdns:121]:     TXT: platform = ESP32
[12:39:14][V][mdns:121]:     TXT: board = esp32dev
[12:39:14][V][mdns:121]:     TXT: network = ethernet
[12:39:14][V][mdns:121]:     TXT: api_encryption = Noise_NNpsk0_25519_ChaChaPoly_SHA256
[12:39:14][C][ota:096]: Over-The-Air Updates:
[12:39:14][C][ota:097]:   Address: 192.168.15.25:3232
[12:39:14][C][ota:100]:   Using Password.
[12:39:14][C][ota:103]:   OTA version: 2.
[12:39:14][C][api:139]: API Server:
[12:39:14][C][api:140]:   Address: 192.168.15.25:6053
[12:39:14][C][api:142]:   Using noise encryption: YES
[12:39:14][C][wmbus:372]: wM-Bus v3.2.1:
[12:39:14][C][wmbus:374]:   Clients:
[12:39:14][C][wmbus:381]:     HA: 192.168.15.5:1234 TCP [rtl-wmbus]
[12:39:14][C][wmbus:389]:   CC1101 frequency: 868.950 MHz
[12:39:14][C][wmbus:390]:   CC1101 SPI bus:
[12:39:14][C][wmbus:391]:     MOSI Pin: GPIO14
[12:39:14][C][wmbus:392]:     MISO Pin: GPIO13
[12:39:14][C][wmbus:393]:     CLK Pin:  GPIO15
[12:39:14][C][wmbus:394]:     CS Pin:   GPIO32
[12:39:14][C][wmbus:395]:     GDO0 Pin: GPIO33
[12:39:14][C][wmbus:396]:     GDO2 Pin: GPIO34
[12:39:14][C][wmbus:403]:   Available drivers:  amiplus, apator08, apator162, apatoreitn, bmeters, c5isf, compact5, dme07, elf, evo868, fhkvdataiii, flowiq2200, hydrocalm3, hydrus, iperl, itron, izar, kamheat, mkradio3, mkradio4, mkradio4a, multical21, qheat, qwater, rfmtx1, sharky774, topaseskr, ultrimis, unismart, vario451
[12:39:14][C][wmbus:421]:   Meter:

[........ METERS CONFIG.......]

[12:39:17][V][rxLoop:167]: Have 191 bytes from CC1101 Rx, RSSI: -62 dBm LQI: 129
[12:39:17][V][rxLoop:172]: Synchronus mode enabled.
[12:39:17][D][mbus:034]: Processing T1 A frame
[12:39:17][V][mbus:045]: Frame: 6B271C58D59A34B39696C58B599593671A4E4E6CA3596696B19B0E656C5CA4BD0E4EC4F4363965B26B31D0B64E716A5A7346A5671D259A32CD7265936744F464D9964E65B498E4F4CB28D664BCAC34E7343B13743723B2D239B17327198ECA7169C38D9639A9C969594DA94EC65D166536664F1671659A692E5C99665363A5A2D64D9C8D8CEB252CB65C97499A65AB1994B356C99B19D0B4E5A744E5CB49669533725B27198EC5B2CA9A4D6714DA2DAC535B239668D2CB6B1CB4D13D192DA5 (191) [RAW]
[12:39:17][V][mbus:052]: Frame: 6E4401061320980305075DF27AEB0060858250D4F3C2787C1B998A8DC35240F64C695DC9AB314A075C7C51A07A0CA27CEEB053E8124C2D1C1E2ECBAD4E45B8FD64219BAFE0957692D9C0575A7D5D55FF39E5591BF63075E1B28933549CA656859310E585C379FC79EC9A971E0E45B80EEFF15D7636D70E2061336DECC7C536 (127) [with CRC]
[12:39:17][V][mbus:095]: Validating CRC for Block1
[12:39:17][V][crc:031]:     calculated: 0x5DF2, read: 0x5DF2
[12:39:17][V][mbus:115]: Validating CRC for Block2
[12:39:17][V][crc:031]:     calculated: 0xC352, read: 0xC352
[12:39:17][V][mbus:115]: Validating CRC for Block3
[12:39:17][V][crc:031]:     calculated: 0xA27C, read: 0xA27C
[12:39:17][V][mbus:115]: Validating CRC for Block4
[12:39:17][V][crc:031]:     calculated: 0x6421, read: 0x6421
[12:39:17][V][mbus:115]: Validating CRC for Block5
[12:39:17][V][crc:031]:     calculated: 0x591B, read: 0x591B
[12:39:17][V][mbus:115]: Validating CRC for Block6
[12:39:17][V][crc:031]:     calculated: 0xC379, read: 0xC379
[12:39:17][V][mbus:115]: Validating CRC for Block7
[12:39:17][V][crc:031]:     calculated: 0x0E20, read: 0x0E20
[12:39:17][V][mbus:115]: Validating CRC for Block8
[12:39:17][V][crc:031]:     calculated: 0xC536, read: 0xC536
[12:39:17][V][mbus:062]: Frame: 6E4401061320980305077AEB0060858250D4F3C2787C1B998A8D40F64C695DC9AB314A075C7C51A07A0CEEB053E8124C2D1C1E2ECBAD4E45B8FD9BAFE0957692D9C0575A7D5D55FF39E5F63075E1B28933549CA656859310E585FC79EC9A971E0E45B80EEFF15D7636D761336DECC7 (111) [without CRC]
[12:39:17][D][wmbus:097]: Using driver 'apator162' for ID [0x08767345] RSSI: -62 dBm LQI: 129 Frame: T1 A T: 6E4401061320980305077AEB0060858250D4F3C2787C1B998A8D40F64C695DC9AB314A075C7C51A07A0CEEB053E8124C2D1C1E2ECBAD4E45B8FD9BAFE0957692D9C0575A7D5D55FF39E5F63075E1B28933549CA656859310E585FC79EC9A971E0E45B80EEFF15D7636D761336DECC7 (111)
[12:39:17][V][utils:291]: 2F2F check after decrypting - OK
[12:39:17][D][wmbus:104]: Decrypted T : 6E4401061320980305077AEB0060852F2F0F2478B598080000438403830015AC58951501935E7410830000007B01430000004300000043000000430000004300000043000000430000004300000043000000430000004300000043000000A0208B3A04FFFFFFFFFFFFFFFFFFFFF586 (111)
[12:39:17][V][sensor:043]: '0x8767345 CWU lqi': Received new state 129.000000
[12:39:17][D][sensor:094]: '0x8767345 CWU lqi': Sending state 129.00000  with 0 decimals of accuracy
[12:39:17][V][sensor:043]: '0x8767345 CWU RSSI': Received new state -62.000000
[12:39:17][D][sensor:094]: '0x8767345 CWU RSSI': Sending state -62.00000 dBm with 0 decimals of accuracy
[12:39:17][V][wmbus:121]: Publishing 'total_water_m3' = 0.1310
[12:39:17][V][sensor:043]: '0x8767345 CWU Lok 9': Received new state 0.131000
[12:39:17][D][sensor:094]: '0x8767345 CWU Lok 9': Sending state 0.13100 m³ with 3 decimals of accuracy
[12:39:17][V][wmbus:228]: Will send RTLWMBUS telegram to 192.168.15.5:1234 via TCP
[12:39:17][W][component:237]: Component wmbus took a long time for an operation (411 ms).
[12:39:17][W][component:238]: Components should block for at most 30 ms.
heythisisnate commented 5 months ago

This is compiled on 2024.4.2. The change was made on 2024.5.0. can you compile on 2024.5.x and provide the same log?

kzajac83 commented 5 months ago

Sorry but now cannot do then (maybe in weekend but not promise) because probably ETH communication will stop working and I will need use 5m ladder in a non-conformist place to catch the device and connect to USB port.

Maybe @console08 @matwho can help and deliver the logs?

heythisisnate commented 5 months ago

I totally understand. I will try to buy one of the Lilygo for my own testing.

heythisisnate commented 5 months ago

I just purchased one Lilygo T-Eth-lite with RTL8201 from AliExpress. I will try to solve this problem after it arrives. It may be a couple weeks. Thanks for your patience.

SzczepanLeon commented 5 months ago

And please share them here. I am interested in the initial value of the register.

I think You have it in first post:

[C][ethernet:034]: Setting up Ethernet... 
[V][ethernet:617]: Hardware default RTL8201 RMII Mode Register is: 0x0FFA 
[V][ethernet:624]: Setting RTL8201 RMII Mode Register to: 0x1FFA
heythisisnate commented 5 months ago

You have it in first post

Ah yes you're right. I missed that. Ok the initial hardware default is the same in my hardware ... so I don't know yet what the problem is. I will troubleshoot more when I receive the Lilygo board.

egiljae commented 5 months ago

Setting clk_mode to GPIO0_OUT seems to get LilyGo T-eth-lite connected to ethernet.

[V][ethernet:433]: DHCP Client Status: 0
[V][ethernet:376][sys_evt]: [Ethernet event] ETH connected (num=2)
[V][ethernet:383][sys_evt]: [Ethernet event] ETH Got IP 192.168.0.230
[I][ethernet:235]: Connected via Ethernet!

Full config:

ethernet:
  type: RTL8201
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_OUT
  phy_addr: 0
  power_pin: GPIO12

However, there is a massive packet loss. Tested over ethernet.

--- 192.168.0.230 ping statistics ---
92 packets transmitted, 44 packets received, 52% packet loss
heythisisnate commented 5 months ago

However, there is a massive packet loss

Interesting. This is exactly the problem we had with the Konnected/wESP32 design that the change in https://github.com/esphome/esphome/pull/6704 fixed. Once I get my hands on the Lilygo I will work on a solution that works for both designs.

heythisisnate commented 5 months ago

For those of you having this problem, I'm interested if you can see the first letter of the date code on the RTL8201 on your board? Here's an example, this batch code starts with M. What we noticed was a change in the default behavior of the chip from batch codes starting with N and later. I am interested if these boards have older or newer chips. 20240507_144635

console08 commented 5 months ago

I have an "M" batch RTL8201F on all of my "Orchestra of Lights" Smart Hub boards and I'm seeing the same behavior as above with VERBOSE logging in "GPIO0_IN" mode on 2024.5.2:

[V][ethernet:617]: Hardware default RTL8201 RMII Mode Register is: 0x0FFA
[V][ethernet:624]: Setting RTL8201 RMII Mode Register to: 0x1FFA

No wired ethernet comms work at that point. Trying "GPIO0_OUT" mode (The RMII Mode Register does not get modified in this case) allows the wired connection to come up and get a DHCP lease as @egiljae noted, but pings show 85% packet loss.

Yes, this board does have a 25MHz crystal and associated capacitors connected directly to pins 31/32 of the RTL8201F.

SzczepanLeon commented 5 months ago

Maybe it is perfect time to revert esphome/esphome#6704 ?

egiljae commented 5 months ago

I have both M and N revision, and I have tried various configurations. I see no difference in behavior between them, ie. no connection with clk_mode: GPIO0_IN, connection but with packet loss with clk_mode: GPIO0_OUT.

The documentation for T-eth-lite mentions that the board uses IO0 as clock input.

heythisisnate commented 5 months ago

Ok I think the best approach here is to revert the change that automatically sets the register value, and instead add an option to set arbitrary register values in ESPHome configs at build time. For example:

ethernet:
  type: RTL8201
  set_phy_register:
    - page: 7
      value: 0x1FFA

This should make everyone happy and be compatible with the wide range of PHY configurations.

I'm away from work this weekend (it's a holiday weekend now in the U.S.) but I will work on it when I'm back next week.

Sorry for any headache caused!

heythisisnate commented 5 months ago

I've just opened a PR esphome/esphome#6836 that reverts the previous change that automatically sets the PHY register values and adds new config options to arbitrarily set PHY registers as needed. This is better because we don't make assumptions about your hardware configuration and allow full flexibility for firmware developers to tweak register settings very easily.

kzajac83 commented 5 months ago

@heythisisnate I understood that the change has been implement in 2024.5.5 therefore what I should change in my config in current version 2024.5.5 to working ethernet? Right now working config for 2024.4.2 is:

ethernet:
  type: RTL8201
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  power_pin: GPIO12
  phy_addr: 0
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.15.25
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.15.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0
heythisisnate commented 5 months ago

@kzajac83 The change has been merged but not released yet. It looks like it will make it into the 2024.6.x release. You do not need to change anything in your config. It should work again starting on the 2024.6 release.

egiljae commented 4 months ago

I'm still experiencing packet loss with esphome version 2024.6.1 on LilyGo T-eth-lite. Does this board require additional ethernet configuration now?

console08 commented 4 months ago

@egiljae I don't have a LilyGo T-eth-lite to test but can you verify you rolled your clk_mode back to GPIO0_IN after changing it for testing earlier? No new config options should be needed. I didn't see any packet loss on my RTL8201 board after about 20 minutes of continuous pinging on 2024.6.1 just now. Can you increase the log level and see if any errors are thrown when packets are dropped?

kzajac83 commented 4 months ago

I have lilygo PoE and from smartphone via WiFi ping 360x and only one ping lost, but can be also due to WiFi, for me general working for last release ESPhome.

egiljae commented 4 months ago

Yes, I changed it back to GPIO0_IN. I can't see any obvious errors or warning related to the issue in the logs, even with level set to VERY_VERBOSE. However, the issue seems to only be present on the N revision. The M revision of the Realtek chip has 0% packet loss.

M-revision:

--- 192.168.0.119 ping statistics ---
58 packets transmitted, 58 received, 0% packet loss, time 59183ms
rtt min/avg/max/mdev = 0.235/0.268/0.355/0.019 ms

N-revision:

--- 192.168.0.230 ping statistics ---
65 packets transmitted, 24 received, 63.0769% packet loss, time 66489ms
rtt min/avg/max/mdev = 0.238/0.291/0.513/0.067 ms
egiljae commented 4 months ago

Actually, using

esp32:
  board: esp32dev
  framework:
    type: esp-idf

instead of type: arduino solves the issue on the N-revision board as well.