What is the meaning of this warning "wifi: <ba-add>idx ..."?

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

What is the meaning of this warning "wifi: <ba-add>idx ..."?

Postby mbratch » Sun Oct 24, 2021 2:02 pm

I occasionally get the following warning message on the console for my ESP32 application:

Code: Select all

W (39179) wifi:<ba-add>idx:3 (ifx:0, 3c:84:6a:82:57:68), tid:4, ssn:0, winSize:64
The MAC address shown is that of my wifi router. What is this warning trying to say that makes it a warning? I tried rummaging through the ESP-IDF component source but couldn't find it.

NRollo
Posts: 21
Joined: Fri Jan 22, 2021 1:04 pm

Re: What is the meaning of this warning "wifi: <ba-add>idx ..."?

Postby NRollo » Wed Jan 05, 2022 10:49 pm

I have been searching for the same answer, spending a lot of time on a wifi issue it would be nice to know what this warning is about. It shows up randomly and seems not to disturb the wifi connection - maybe this is a wrongly classified debug log entry?

Any comments from the Guru's?

Thanks!

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: What is the meaning of this warning "wifi: <ba-add>idx ..."?

Postby WiFive » Thu Jan 06, 2022 2:17 am

Yes it is wrongly classified as a warning

Charles-S
Posts: 16
Joined: Sat Jul 30, 2022 9:25 pm

Re: What is the meaning of this warning "wifi: <ba-add>idx ..."?

Postby Charles-S » Thu Mar 09, 2023 4:18 pm

I know I'm late, but for future readers....

My (5 mins worth of) research suggests that wifi:<ba-add> is the "Add BlockAck exchange" part of a QoS handshake event for a technique known as the BlockAck Mechanism. Going farther, tid is the "Traffic ID," and ssn is the "Start Sequence Number." You can read more about the details HERE.

But, in short and simple terms, the ESP32 wifi stack is trying to negotiate QoS with your access point.

It's appearance as a Warning is most likely because it is failing; which won't harm the wifi connection, only theoretically degrade performance of anything relying on QoS. Being honest, the applications that actually use QoS are few and far between. Even more so for our humble ESP32. Point of fact, I am getting this error because I don't even have QoS enabled in my access point/router.

Bottom line, unless you are specifically trying to play with QoS, you can just ignore this warning.

ViennaTom
Posts: 4
Joined: Tue Dec 19, 2023 9:19 pm

Re: What is the meaning of this warning "wifi: <ba-add>idx ..."?

Postby ViennaTom » Tue Dec 19, 2023 9:33 pm

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 :-(
WifiConnect.jpg
<ba-add> vs connectivity
WifiConnect.jpg (507.38 KiB) Viewed 4723 times

ViennaTom
Posts: 4
Joined: Tue Dec 19, 2023 9:19 pm

Re: What is the meaning of this warning "wifi: <ba-add>idx ..."?

Postby ViennaTom » Mon Jan 01, 2024 2:33 pm

The issue was resolved.
I did not realize, that the ESP connected to another router within my MESH like network from time to time.
I included the bssid in the AP-config and now it works as expected.

Who is online

Users browsing this forum: Bing [Bot] and 102 guests