Closed Flamabalistic closed 9 months ago
I remember going through this issue myself when testing my w5100 implementation, but I can't recall if I just deemed it not worth bothering, or if an IDF update eventually fixed it.
Please try to call esp_netif_set_hostname
under ETHERNET_EVENT_START
event.
Changed
case ETHERNET_EVENT_START:
ESP_LOGI(TAG, "Ethernet Started");
break;
to
case ETHERNET_EVENT_START:
ESP_LOGI(TAG, "Ethernet Started");
ESP_ERROR_CHECK(esp_netif_set_hostname(eth_netif_spi, "esphost"));
break;
Still got the same problem. Are there any other logs I can provide that will help diagnose the problem?
I see what is your problem, now. It's not that simple. You need to properly configure all the services to domain name to IP translation worked properly. Frankly speaking, I'm not expert at this domain, so I can provide you just some generic guidance. Either:
1) Use mDNS.
2) or:
Sorry for the long wait - been busy with some other features
I can't seem to get mdns working right now, and the other options sadly won't work for my use case (it needs to work with a static ip, and without modifications to the server)
@kostaond I'm no expert in this either, so if esp_netif_set_hostname
actually is behaving as expected, feel free to close this issue.
with new version on v5.2.1 this issue resolved in our side, we have disabled w5500 int pin to do polling method work. IRQ pin = -1 and poll interval were set to 100ms in menuconfig. After that the hostname is apperaing in modem control panel which we set. The ethernet speed is also improved x10 than old interrupt version of ethernet w5500 for OTA and TCP connections.
The ethernet speed is also improved x10 than old interrupt version of ethernet w5500 for OTA and TCP connections.
Unrelated, but interesting, especially considering the 100ms RX polling interval. Care to elaborate on this now that you mentioned it?
The ethernet speed is also improved x10 than old interrupt version of ethernet w5500 for OTA and TCP connections.
Unrelated, but interesting, especially considering the 100ms RX polling interval. Care to elaborate on this now that you mentioned it?
We have multiple designs for w5500 on another projects using with STM32 based MCU's. For new project we decided to make it with ESP32 but we figured out that w5500 driver need interrupt pin to work. (SDK <5.2.1)..
As i mentioned on STM32 based projects, we used poll method to drive w5500 macraw with SOCK0 with 16 kb rx/tx payload buffer. Until this time, we have no issue with w5500, mac address and hostname is everytime set correctly.
But when switched to ESP32, there was a bugs like exists( Hostname set failed, bad TCP performance, OTA takes 3 min for 1.15 mb bin file etc.). We configured w5500 spi pins, reset, irq and cs pin to drive with ESP32 gpios.
#define CONFIG_EXAMPLE_USE_SPI_ETHERNET 1
#define CONFIG_EXAMPLE_SPI_ETHERNETS_NUM 1
#define CONFIG_EXAMPLE_USE_W5500 1
#define CONFIG_EXAMPLE_ETH_SPI_HOST 1
#define CONFIG_EXAMPLE_ETH_SPI_SCLK_GPIO 18
#define CONFIG_EXAMPLE_ETH_SPI_MOSI_GPIO 23
#define CONFIG_EXAMPLE_ETH_SPI_MISO_GPIO 19
#define CONFIG_EXAMPLE_ETH_SPI_CLOCK_MHZ 20
#define CONFIG_EXAMPLE_ETH_SPI_CS0_GPIO 5
#define CONFIG_EXAMPLE_ETH_SPI_INT0_GPIO 36
#define CONFIG_EXAMPLE_ETH_SPI_PHY_RST0_GPIO 25
#define CONFIG_EXAMPLE_ETH_SPI_PHY_ADDR0 1
SCK frequency tested on every frequency ( 20,10,5 Mhz) but TCP performance too bad on ethernet side. I can say that the OTA with ethernet takes 3 - 5 minute for 1.2 mb bin file (sometimes its failed) but wifi takes only 30 seconds to perform OTA. I was know there is anything wrong with our side.
I have waited to poll method support for next SDK's, Today i have upgraded my SDK to v5.2.1 and configured irq pin to -1 and poll interval to 100 ms and ta ta...
OTA and TCP performance improved x10. OTA takes 28 second on ethernet which is perfect. TCP uploads for 1.2 mb takes 12 seconds( without SDK upgrade this was around 1.5 minute).
Hostname is not stable appeared the modem control panel when older SDK. But now is stable.
I just wanted to share that who has that issue.
The symptoms sound suspicious. Are you sure the interrupt line was properly connected and configured when not using poll mode? The thing is, it could have work even with incorrectly configured INT line because there used to be 1 sec timeout when no INT hit. Therefore, it could explain your poor performance.
while (1) {
/* check if the task receives any notification */
if (ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(1000)) == 0 && // if no notification ...
gpio_get_level(emac->int_gpio_num) != 0) { // ...and no interrupt asserted
continue; // -> just continue to check again
}
The ethernet speed is also improved x10 than old interrupt version
It improved 10 times, 100 ms is 10 times shorter interval than ulTaskNotifyTake
1 sec timeout...
The ethernet speed is also improved x10 than old interrupt version
It improved 10 times, 100 ms is 10 times shorter interval than
ulTaskNotifyTake
1 sec timeout...
you are right, we found it, the int pin is our old daughter boards not connected with ESP32 in our side. thank you. we fixed.
Answers checklist.
IDF version.
v5.1
Espressif SoC revision.
ESP32-S3
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
Custom PCB
Power Supply used.
USB
What is the expected behavior?
esp_netif_set_hostname
before initializing the interface, should set the hostname.What is the actual behavior?
ip
and nbtstat -Aip
, neither show up with any hostnameesp_netif_set_hostname
Steps to reproduce.
Short version:
Long version:
Below is all of the relevant code, with
w5500_init
being ran on start-upDebug Logs.