Hi ESP-Lovers!
I have a Wifi issue that seems to be related with the QOS negotation.
Although wifi is being reported as connected (including wifi_sta_connect_status_() == WiFiSTAConnectStatus::CONNECTED so the gotIp Event has been tracked) I am unable to use TCP communication UNTIL the wifi:<ba-add> ..... has been emitted.
After starting the module this sometimes happens quickly ....
I (3686) wifi:security: WPA2-PSK, phy: bgn, rssi: -63
I (3686) wifi:pm start, type: 0
E (3686) WIFI: event_handler 4
I (3706) wifi:<ba-add>idx:0 (ifx:0, b4:1c:30:a5:22:83), tid:0, ssn:0, winSize:64
I (3746) wifi:AP's beacon interval = 102400 us, DTIM period = 1
E (4696) WIFI: event_handler 0
I (4696) esp_netif_handlers: sta ip: 192.168.0.142, mask: 255.255.255.0, gw: 192.168.0.1
I (4746) wifi_esp32: Event: Got IP static_ip=192.168.000.142 gateway=192.168.000.001
I (4746) wifi_esp32: WiFi Connected!
I (4746) EMPESP32: connected ... waiting a little
I (14746) EMPESP32: ... done
I (14746) webserver: Starting HTTP Server
E (14746) MQTT: setting last will iotas/ESP_A57388/$online
but sometimes it takes minutes until I am able to connect to MQTT broker or get a ping reply.....
.... minutes of waiting after is_connected() ....
(3836) WIFI: event_handler 4
I (3886) wifi:AP's beacon interval = 102400 us, DTIM period = 1
E (4836) WIFI: event_handler 0
I (4836) esp_netif_handlers: sta ip: 192.168.0.142, mask: 255.255.255.0, gw: 192.168.0.1
I (4846) wifi_esp32: Event: Got IP static_ip=192.168.000.142 gateway=192.168.000.001
I (4846) wifi_esp32: WiFi Connected!
I (4846) EMPESP32: connected ... waiting a little
I (14856) EMPESP32: ... done
I (14856) webserver: Starting HTTP Server
E (14856) MQTT: setting last will iotas/ESP_A57388/$online
I (15856) mqtt: Event dispatched from event loop base=MQTT_EVENTS, event_id=7
I (15856) mqtt: MQTT_EVENT_BEFORE CONNECT
E (17876) esp-tls: [sock=57] select() timeout
E (17876) transport_base: Failed to open a new connection: 32774
E (17876) mqtt_client: Error transport connect
I (17876) mqtt: Event dispatched from event loop base=MQTT_EVENTS, event_id=0
I (17886) mqtt: MQTT_EVENT_ERROR
I (17896) mqtt: Last errno string (Success)
I (17896) mqtt: Event dispatched from event loop base=MQTT_EVENTS, event_id=2
E (17906) mqtt: MQTT_EVENT_DISCONNECTED
I (22906) mqtt: Event dispatched from event loop base=MQTT_EVENTS, event_id=7
I (22906) mqtt: MQTT_EVENT_BEFORE CONNECT
E (24926) esp-tls: [sock=57] select() timeout
E (24926) transport_base: Failed to open a new connection: 32774
E (24926) mqtt_client: Error transport connect
I (24926) mqtt: Event dispatched from event loop base=MQTT_EVENTS, event_id=0
I (24936) mqtt: MQTT_EVENT_ERROR
......
I (234996) mqtt: Event dispatched from event loop base=MQTT_EVENTS, event_id=7
I (234996) mqtt: MQTT_EVENT_BEFORE CONNECT
I (235016) wifi:<ba-add>idx:0 (ifx:0, d8:47:32:a2:c7:96), tid:0, ssn:3, winSize:64
I (236376) mqtt: Event dispatched from event loop base=MQTT_EVENTS, event_id=1
I (236376) mqtt: MQTT_EVENT_CONNECTED
and after wifi:<ba-add> MQTT connects immediately and pinging is successful.
Has this got todo with QOS negotiation or what is my mistake ?
BR, Tom
Edit: I forgot to mention:
ESP32-D0WD-V3 (revision v3.11)
esp-idf-v5.1.2
Attached screenshot showing that tcp-stack is NOT available until the <ba-add> info/warning appears.
That means sometimes it takes several minutes
- <ba-add> vs connectivity
- WifiConnect.jpg (507.38 KiB) Viewed 4542 times