large intermittent MQTT delays related to AMPDU

rich4653
Posts: 1
Joined: Fri Apr 29, 2022 9:13 am

large intermittent MQTT delays related to AMPDU

Postby rich4653 » Fri Apr 29, 2022 10:05 am

I am running a simple application on an esp32 (rev. 1, IDF v4.4) that wakes from deep sleep every 30 seconds, publishes a short message using MQTT (qos=1), before returning to sleep after publication is confirmed

What I've discovered are intermittent delays in the publication of this message. Eventually I also discovered that if I disable AMPDU TX these delays disappear. I created a stripped down app to obtain some statistics, measuring the time interval between publishing a message and verifying its publication (PUBACK)

With AMPDU enabled (min, median, max times): 4, 6, 10708 ms

With AMPDU TX disabled: 5, 6, 12 ms (also see screenshots)

Also see attached screenshots. I performed 100 runs for each; code is at https://github.com/richcarni/esp32-mqtt-ampdu

I couldn't find any mention of this issue online. I understand AMPDU may cause increased latency but I don't think this is that (too intermittent and far too long, 10 seconds in some cases)

Has anyone experienced anything similar? Or know what might be going on? If it's not a bug I was speculating it might be an incompatibility with my WIFI router? (which I can't easily test)

The good thing is I have a solution - mostly I thought it's worth raising it here in case anyone else is in the same boat and this saves them some headache
Attachments
Screen Shot 2022-04-29 at 7.58.51 pm.png
Screen Shot 2022-04-29 at 7.58.51 pm.png (111.97 KiB) Viewed 747 times

Who is online

Users browsing this forum: ESP_Roland, Majestic-12 [Bot], Tomatendose and 105 guests