ESP32 As a Wireless Co-processor: Turning a Cheap Espressif Module Into a Linux Wi-Fi Card

Translated by a model; the original is in Russian.

· Linux and open source
The esp-hosted project lets you hang a cheap ESP32 off a single-board computer over SDIO or SPI and get Wi-Fi and Bluetooth backed by partly open firmware — instead of an all-blob proprietary card.

cover.svg

Powerful Linux single-board computers often skimp on wireless, and the Wi-Fi cards themselves come with baggage: proprietary firmware, ephemeral drivers, glitches left unresolved for years, and binary blobs that sometimes even expire. A Hackaday writer offers an unusual fix — press an ESP32 module into service as a Wi-Fi/Bluetooth card, wired to the board over SDIO or SPI. That is what the esp-hosted project enables.

Two flavours

esp-hosted comes in two forms. esp-hosted-mcu (formerly First Generation) keeps connection management on the ESP32: the module stays on your networks even while the host reboots or is fully off. esp-hosted-linux (formerly New Generation) leaves the wireless stack on the Linux side, with the ESP32 acting as a thin proxy — behaving most like a native card. The author went with this one.

Support spans the ESP32-WROOM and most newer chips: S2, S3, C2, C3, C5, C6/C61. The author chose the C6 but calls it a mistake: despite the lower number, the C5 is simply better — notably, it does 5 GHz.

Wiring and bring-up

SDIO beats SPI on speed. It is a fast parallel bus with a command line, a clock, and four (or just one) data lines; the traces need careful layout, with a continuous ground return beneath them and length-matching. EN is wired up for resets, and the ESP32's USB port must be exposed for a one-time firmware flash. The 3.3 V rail needs 300–400 mA.

Three steps follow: free the SDIO interface (on a Raspberry Pi, a config.txt edit, plus disabling the onboard card's Bluetooth), build and flash the firmware (better done on a desktop — on a Pi Zero, cmake will almost certainly hang the board on memory, or just grab a prebuilt GitHub release), and build the driver. Firmware and driver must match by commit. On boards with 512 MB of RAM or less, swap make -j8 for -j2 or -j1 in the build script. Once it loads, a wlan interface appears.

Why bother

The author lists four reasons. First, it is the only card he knows that carries Bluetooth over SDIO without tying up a UART. Second, esp-hosted survives hardware power switches gracefully — the module disconnects and reconnects with no driver crashes. Third and fourth, it is essentially an open-firmware card: only the RF part is a blob, the rest is open and fixable, and projects are already working to liberate the RF bits too. Finally, after SDIO is wired up the ESP32 still has plenty of free pins — enough to add a LoRa modem for Meshtastic, and newer chips do Zigbee and Thread natively. The author relishes the idea of turning the ubiquitous, dirt-cheap ESP32 into a Swiss-army communications co-processor for any Linux CPU.


Source: Lobsters

Comments

Sign in, to comment.

  • No comments yet.