extra delay when loading webpage on ESP32S3 in softAP mode

Pixellord
Posts: 13
Joined: Wed Feb 15, 2023 8:58 am

extra delay when loading webpage on ESP32S3 in softAP mode

Postby Pixellord » Mon Jan 08, 2024 12:41 pm

I try to create an application on ESP32S3 using ESP-IDF 5.1.2 which first starts WiFi in softAP mode and then starts a REST server. I have combined the softAP example https://github.com/espressif/esp-idf/tr ... ted/softAP and the REST server example https://github.com/espressif/esp-idf/tr ... ful_server. I have replaced the front-end in the example with my own webpage.

mdns, netbios and softAP are enabled and configured the same as the examples in Github. This is how the Main looks like in my application:
  1. void app_main(void)
  2. {
  3.     nvs_flash_init();
  4.     ESP_ERROR_CHECK(esp_netif_init());
  5.     ESP_ERROR_CHECK(esp_event_loop_create_default());
  6.  
  7.     initialise_mdns();
  8.     netbiosns_init();
  9.     netbiosns_set_name(CONFIG_EXAMPLE_MDNS_HOST_NAME);
  10.  
  11.     wifi_init_softap();
  12.    
  13.     ESP_ERROR_CHECK(init_fs());
  14.     ESP_ERROR_CHECK(start_rest_server(CONFIG_EXAMPLE_WEB_MOUNT_POINT));
  15. }

The problem I am experiencing is that the browser needs quite a lot of time to finish loading the webpage. There is some extra delay (typically 10 - 30 seconds) before the browser sends the last request for getting the favicon.ico. The browser keeps spinning for quite a long time (in this case about 30 seconds).
2024-01-08 13_03_56-Window.png
2024-01-08 13_03_56-Window.png (54.11 KiB) Viewed 25354 times
Looking from the wireshark, it seems that there are a lot of DNS requests and ICMP errors generated during this delay.
wireshark-dns.png
wireshark-dns.png (62.03 KiB) Viewed 25354 times
This is how it looks like before the browser requests favicon:
2024-01-08 13_28_42-Window.png
2024-01-08 13_28_42-Window.png (120.36 KiB) Viewed 25354 times
It seems that this extra delay is caused by the DNS requests from browser. So how should I solve this problem and reduce this extra delay? with captive portal? or different configuration in mDNS and AP mode? I am very new in this area, so any suggestion would be appreciated! Many thanks!

Who is online

Users browsing this forum: abbas1375, Bing [Bot] and 122 guests