Open AndySymons opened 6 months ago
I am sorry that no one has responded to this issue yet :-(
Shooting in the dark, but in an attempt to narrow down the main issue, I did several more tests and recorded the log files, which are attached.
As in my original posting…
I removed the definition of the interrupt pin, wondering if it is necessary because the ESPHome documentation says it is optional and the AZ-Delivery example with Arduino does not use it. Result: no new errors. Same errors as the initial state. Conclusion: not sure. Maybe there is a default? Still need to actually cut the wire (test 3).
I removed the definition of the reset pin, wondering if it is necessary because the ESPHome documentation says it is optional, although the AZ-Delivery example with Arduino does use it. Result: ‘reset’ errors and could not load the program at all. Conclusion: reset is mandatory.
I restored the reset pin, and physically cut the wire to the interrupt pin because the ESPHome documentation says it is optional and the AZ-Delivery example with Arduino does not use it.
(It is till not defined in the config since test 1).
Result: still fails but gives different errors [Ethernet: 237]
Conclusion: inconclusive, but these errors look more serious (?), so I will continue to assume for now that the interrupt pin is mandatory.
I restored the config to the initial state, i.e. all six pins physically connected and configured, no manual IP and default clock frequency. I ran it to get a fresh log of the errors. There are many, and it is hard to see which is the most fundamental error and which are knock-on errors. I checked by doing a manual reset after the initial load but that made no difference -- same errors again.
I previously had the impression that the device connected better when a manual IP was specified. I tried specifying a manual IP, but it made no difference this time. The errors are the same. I therefore withdrew the manual IP again.
I previously noted that the clock speed cannot be set to 80MHz. I verified that by putting it in the config, installing it and keeping the log file. I withdrew the clock_speed entry from the config.
I have cleared up some side issues, and eliminated some causes, but still not found the central problem. If no one has an answer, I would at least like some guidance on how to proceed with further diagnostics. It would help a lot if someone could tell me some more about what the error messages in the log mean. (I cannot find any list online). The following look like they may be important. They occur several times, with variations in the numbers in brackets (what do they mean?). In all cases except the removal of reset, the configuration was successfully compiled and uploaded. The error messages occur after the line ‘[C][ethernet:034]: Setting up Ethernet…’.
[D][esp-idf:000]: E (679) w5500.mac: w5500_send_command(123): send command timeout [D][esp-idf:000]: E (680) w5500.mac: emac_w5500_start(279): issue OPEN command failed [D][esp-idf:000]: E (690) w5500.mac: emac_w5500_set_link(422): w5500 start failed [D][esp-idf:000]: E (700) esp_eth: eth_on_state_changed(121): ethernet mac set link failed [D][esp-idf:000]: E (711) w5500.phy: w5500_update_link_duplex_speed(84): change link failed [D][esp-idf:000]: E (721) w5500.phy: w5500_get_link(108): update link duplex speed failed [D][esp-idf:000]: E (721) esp_eth: esp_eth_start(272): phy get link status failed [D][esp-idf:000]: E (2517) w5500.mac: emac_w5500_transmit(534): issue SEND command failed
So the problem is presumably somewhere in the Ethernet setup. But where?? I would very much appreciate any help an expert may be able to give to determine whether there is a bug in the ESPHome code or something I can do differently in the config.
240513 0850 test 2 log - error when RST not defined.txt 240513 0901 test 3 log - error after INT wire snipped.txt 240513 0913 test 4 log - INT restored (back to original).txt 240513 0924 test 5 log - manual IP added (no difference).txt 240513 0939 test 6 log - clock speed set to 80MHz.txt
19 May. I tried a different W5500 component, the USR-E1 (a nice little module), this time with an ESP32-S2, and got the same result -- the program compiles and loads, the device has an IP address, but it does not respond to Ethernet signals.
I guess either there is something missing in the libraries, or in the documentation? This is a shame because W5500 is a widely-used platform in quite cheap products.
BTW, between my original posting and this one, I got a WT32-EH01 board working with no problem at all. The Ethernet Component is great when it works!
My failed W5500 config below, and log file attached ...
esphome:
name: hardware-alarm-interface-3
friendly_name: Hardware Alarm Interface 3
esp32:
board: esp32-s2-saola-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "o6O/pTaTUYUGrab9xftGr46QnvFTVvXvkpaj0UeGBN8="
ota:
password: "73e414cd91ef846e8c757e5f02ce39d6"
ethernet:
type: W5500
reset_pin: GPIO8
interrupt_pin: GPIO9
cs_pin: GPIO10
mosi_pin: GPIO11
clk_pin: GPIO12
miso_pin: GPIO13
Please contact us on the Discord channel linking to this isdue.
Done
Works now for you?
Why? Has there been a fix? What version of the code do I need?
It looks like I accidentally closed "Update ethernet.rst #3846". I suspect that was due to inexperience in using Github? In any case my proposed document change was only to say the W5500 is not working at the moment.
I have recently got a different W5500 module working -- the USR-ES1. I will retest soon with the AZDelivery W5500 board and close this issue if it works.
@AndySymons: I am thinking also to buy the module for my project. Did you get it working meanwhile?
I used a different solution for my project, but will re-test the AZDelivery board when I get the opportunity. The problem may be more related to the fact that I was using an ESP32-S2 processor than the AZDelivery board itself?
My LilyGO-T-ETH with the 5500 seems to have the same problem. I did find that using the Arduino framework worked but this isn't a good solution for me.
Can confirm that the same problem exists with the Adafruit Ethernet FeatherWing, which is also using the W5500 chip, in ESPHome 2024.10.3.
Thank you for all your detective work so far @AndySymons
Edit: It seems that it is working with clock_speed: 16 Mhz
in my case. The MCU in use is the Adafruit ESP32 Feather V2. Used framework is arduino
.
The problem
I am trying to configure an AZDelivery W5500 Ethernet module.
The configuration yaml compiles and loads correctly, but after that all requests are timed out. Attempts to reinstall the code over ethernet, or to access the module from a browser also give timeout errors.
Which version of ESPHome has the issue?
2024.4.1
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
core-2024.5.3, but I did not get as far as connecting to Home Assistant via Ethernet. It works fine when connected by WiFi.
What platform are you using?
Debian Linux (running natively)
Board
Espressif Devkit v4 AZDelivery W5500 Ethernet module
Component causing the issue
Ethernet W5500 SPI
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
During set-up I observed the following. I do not know if these are connected issues or just documentation errors.