Building an open-source Wi-Fi MAC layer for the ESP32

The ESP32 is a low-cost microcontroller with Wi-Fi connectivity. Currently, the Wi-Fi MAC layer of the ESP32 is closed-source. This project aims to change that: by reverse engineering the hardware registers and software, we can build a networking stack that is open-source up to the hardware, instead of having to use the proprietary MAC layer.

This will improve security auditability, open up the possibility for features not supported in the proprietary implementation (for example, standards-compliant mesh networking), improve interoperability and make research into Wi-Fi networks with lots of nodes more affordable.

The source code is under the esp32-open-mac organisation on GitHub. There are currently two implementations:

  • esp32-open-mac (we know it's confusing that one reference implementation has the same name as the overarching project, but bear with us) This is a reference implementation that demonstrates how the hardware works, written in C and Rust: the hardware abstraction and initialization is written in C; the MAC stack (parsing packets and deciding which packets to send when) is written in Rust. This relies on two FreeRTOS tasks; one to handle the hardware, one to handle the MAC stack.
  • Ferris-on-Air (FoA): this is a reference implementation in pure async Rust. It builds on Embassy and the patches in the esp-hal we submitted to add support for the Wi-Fi peripheral.

If you want to help out with developing or want to contact us, feel free to join the Matrix room