Benchmarking Latency Throughout Frequent Wi-fi Hyperlinks For MCUs

Though components like bandwidth, energy utilization, and the variety of (kilo)meters attain are necessary concerns with wi-fi communication for microcontrollers, latency must be one other necessary issue to concentrate to. That is very true for tasks like controllers the place round-trip latency and instantaneous response to an enter are important, however the place do you discover the latency quantity in datasheets? That is the place [Michael Orenstein] and [Scott] over at Electrical UI discovered an absence of information, particularly when taking software program stacks under consideration. In different phrases, it was time to do some severe benchmarking.

The query to be answered right here was particularly how briskly a one-way wi-fi consumer interplay might be throughout three ranges of payload sizes (12, 128, and 1024 bytes). The efficient latency is measured from when the enter is offered on the transmitter, and the receiver has processed it and triggered the related output pin. The inner latency was additionally measured by having a variety of framework implementations reply to an exterior interrupt and drive a GPIO pin excessive. Even this take a look at on an STM32F429 MCU already confirmed that, for instance, the STM32 low-level (LL) framework is way sooner than the stm32duino one.

After a bit extra checking for overhead throughout the MCU itself with varied approaches, the precise exams had been carried out. The exams concerned modules for SiK, LoRa, nRF24, Bluetooth SPP (ESP32, HC-5), Bluetooth LE (Bluedroid & NimBLE on ESP32, in addition to the nRF52), ESP-NOW (ESP32), 802.15.4 (utilized by Zigbee, Matter, Thread, and many others.) and naturally WiFi. The software program stack used had a big effect on a few of these, equivalent to for BLE, however WiFi differed quite a bit on the ESP32, whether or not utilizing TCP or overlaying Websockets (about 10x slower).

What’s clear is that to get low latency with wi-fi communication you could do extra than simply decide the best expertise or module, but in addition perceive and work with the complete software program stack to tweak and optimize it for the perfect efficiency. For these within the uncooked knowledge, firmware, and post-processing scripts, these might be discovered on GitHub.

We’ve checked out low-latency hacks earlier than. Testing which protocol is greatest is a staple for RC lovers.

Wireless Latency Benchmark Results. Credit: Electric UI.Credit score: Electrical UI.

Leave a Comment