Esphome with esp32 38pins and lan8720 ethernet module why loss connection?

hello bro, I hope you are well i want to ask about a problem
this problem connects disconnect for a moment and back and this makes the signal onto the system slow and sometimes

wiring guide

ESP32 | NC | 22 | 19 | 21 | 26 | 25 | 27 | 17 | 23 | 18 | GND | 3V3

LAN8720 | NC | TX1 | TX0 | TX_EN | RX1 | RX0 | CRS | nINT/REFCLK | MDC | MDIO | GND | VCC

ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 1 # 0 or 1 for LAN8720

</>
[18:49:24][C][logger:185]: Logger:
[18:49:24][C][logger:186]:   Level: DEBUG
[18:49:24][C][logger:188]:   Log Baud Rate: 115200
[18:49:24][C][logger:189]:   Hardware UART: UART0
[18:49:24][C][switch.gpio:068]: GPIO Switch 'GPIO4 HQ4F'
[18:49:24][C][switch.gpio:076]:   Inverted: YES
[18:49:24][C][switch.gpio:091]:   Restore Mode: always OFF
[18:49:24][C][switch.gpio:031]:   Pin: GPIO4
[18:49:24][C][switch.gpio:068]: GPIO Switch 'GPIO33 HQ4F'
[18:49:24][C][switch.gpio:076]:   Inverted: YES
[18:49:24][C][switch.gpio:091]:   Restore Mode: always OFF
[18:49:24][C][switch.gpio:031]:   Pin: GPIO33
[18:49:24][C][switch.gpio:068]: GPIO Switch 'GPIO13 HQ4F'
[18:49:24][C][switch.gpio:076]:   Inverted: YES
[18:49:24][C][switch.gpio:091]:   Restore Mode: always OFF
[18:49:24][C][switch.gpio:031]:   Pin: GPIO13
[18:49:24][C][switch.gpio:068]: GPIO Switch 'GPIO16 HQ4F'
[18:49:24][C][switch.gpio:076]:   Inverted: YES
[18:49:24][C][switch.gpio:091]:   Restore Mode: always OFF
[18:49:24][C][switch.gpio:031]:   Pin: GPIO16
[18:49:24][C][ethernet:323]: Ethernet:
[18:49:24][C][ethernet:505]:   IP Address: 10.200.224.121
[18:49:24][C][ethernet:506]:   Hostname: 'hq4fe'
[18:49:24][C][ethernet:507]:   Subnet: 255.255.255.0
[18:49:24][C][ethernet:508]:   Gateway: 10.200.224.4
[18:49:24][C][ethernet:513]:   DNS1: 8.8.8.8
[18:49:24][C][ethernet:514]:   DNS2: 8.8.4.4
[18:49:24][C][ethernet:526]:   MAC Address: C8:F0:9E:9E:D0:80
[18:49:24][C][ethernet:527]:   Is Full Duplex: YES
[18:49:24][C][ethernet:528]:   Link Speed: 100
[18:49:24][C][ethernet:337]:   MDC Pin: 23
[18:49:24][C][ethernet:338]:   MDIO Pin: 18
[18:49:24][C][ethernet:339]:   PHY addr: 1
[18:49:24][C][ethernet:341]:   Type: LAN8720
[18:49:24][C][web_server:153]: Web Server:
[18:49:24][C][web_server:154]:   Address: 10.200.224.121:80
[18:49:24][C][mdns:116]: mDNS:
[18:49:24][C][mdns:117]:   Hostname: hq4fe
[18:49:24][C][esphome.ota:073]: Over-The-Air updates:
[18:49:24][C][esphome.ota:074]:   Address: 10.200.224.121:3232
[18:49:24][C][esphome.ota:075]:   Version: 2
[18:49:24][C][esphome.ota:078]:   Password configured
[18:49:24][C][safe_mode:018]: Safe Mode:
[18:49:24][C][safe_mode:020]:   Boot considered successful after 60 seconds
[18:49:24][C][safe_mode:021]:   Invoke after 10 boot attempts
[18:49:24][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[18:49:24][C][api:140]: API Server:
[18:49:24][C][api:141]:   Address: 10.200.224.121:6053
[18:49:24][C][api:143]:   Using noise encryption: YES
[18:49:30][D][switch:012]: 'GPIO13 HQ4F' Turning ON.
[18:49:30][D][switch:055]: 'GPIO13 HQ4F': Sending state ON
WARNING hq4fe @ 10.200.224.121: Connection error occurred: [Errno 104] Connection reset by peer
INFO Processing unexpected disconnect from ESPHome API for hq4fe @ 10.200.224.121
WARNING Disconnected from API
INFO Successfully connected to hq4fe @ 10.200.224.121 in 0.003s
INFO Successful handshake with hq4fe @ 10.200.224.121 in 0.076s
[18:50:18][D][switch:012]: 'GPIO16 HQ4F' Turning ON.
[18:50:18][D][switch:055]: 'GPIO16 HQ4F': Sending state ON
WARNING hq4fe @ 10.200.224.121: Connection error occurred: [Errno 104] Connection reset by peer
INFO Processing unexpected disconnect from ESPHome API for hq4fe @ 10.200.224.121
WARNING Disconnected from API
INFO Successfully connected to hq4fe @ 10.200.224.121 in 0.003s
INFO Successful handshake with hq4fe @ 10.200.224.121 in 0.068s
[18:51:07][D][api:103]: Accepted 10.200.224.21
[18:51:07][D][api.connection:1446]: Home Assistant 2024.10.4 (10.200.224.21): Connected successfully
</>

Full yaml please.

Also, exactly which device?

</>
esphome:
name: ethernetesp32
friendly_name: ethernetesp32

esp32:
board: esp32dev
framework:
type: arduino

Enable logging

logger:
level: debug

web_server:
port: 80

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

manual_ip:
static_ip: 192.168.1.164 # Corrected IP address
gateway: 192.168.1.254
subnet: 255.255.255.0
dns1: 8.8.8.8

api:
encryption:
key: “1FvLQBjKjWm2gitNekwyDP9NMtFpCJq0oxvk0mCeFgA=”

Enable OTA updates (Uncomment if you need it)

ota:
password: “bc978e49e429e5ac54a03c98cc4b1cc9”

switch:

  • platform: gpio
    pin: GPIO13 # Pin for Switch 1 (Light 1)
    name: “Light 1”
    id: switch_1

  • platform: gpio
    pin: GPIO32 # Pin for Switch 2 (Light 2)
    name: “Light 2”
    id: switch_2
    inverted : true

  • platform: gpio
    pin: GPIO14 # Pin for Switch 3 (Light 3)
    name: “Light 3”
    id: switch_3
    inverted : true

  • platform: gpio
    pin: GPIO33 # Pin for Switch 4 (Light 4)
    name: “Light 4”
    id: switch_4
    inverted : true
    </>

No one can respond to that. Please read How to help us help you - or How to ask a good question, particularly point 11.

Also you didn’t respond regarding what device you are using.

esp32 38 pins

Did you wire the lan8720 yourself, or did you buy a board with it included?

If you wired it yourself, perhaps (likely) this is the problem:

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.

If you bought a completed board with the lan8720 built in, then

is inadequate to help.

Also please post your yaml properly, as I already requested.

I bought it separately and connected it on my own using wires
If you connect the wires using tin welding, can it solve this problem?
or some Solutions? or replace the cables to solid wires with welding?

I don’t know.

I assume you mean soldering, not welding.

I wouldn’t attempt it at all, so someone else will need to advise on soldering such high frequency components.

In the meantime, given that you can’t be bothered fixing your yaml, I am out of here.

2 Likes