Skip to content

Experiment: ESP32 support#29

Draft
puddly wants to merge 39 commits into
devfrom
puddly/esp32-test
Draft

Experiment: ESP32 support#29
puddly wants to merge 39 commits into
devfrom
puddly/esp32-test

Conversation

@puddly

@puddly puddly commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This is an experimental branch to add support for ESP32 via Embassy.

The majority of the changes are restructuring the stack to be no_std (simple) and rewriting all fire-and-forget background task spawns to instead be persistent, reactive tasks that have defined lifetimes (hard). ESP32 support seems very feasible, I want to try and tunnel the provisional JSON wire format over serial. The only feature missing so far is an energy scanning API in the ESP32 crates.

This PR depends on a tiny fork of abstract-bits that supports no_std: yara-blue/abstract-bits@main...puddly:abstract-bits:puddly/no-std

@tube0013

Copy link
Copy Markdown

Quick question is the ESP32 support targeting a certain variant?

Cool to see the project moving forward.

@puddly

puddly commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

This is targeting the C6 for now because of the built-in radio but the radio backend is intentionally very generic, you could totally split it up between two chips like we do for the host. I'd have to double check what chips Espressif actually supports with their Rust crates. The C6 is RISC-V so I think anything else with that architecture should work identically?

@tube0013

Copy link
Copy Markdown

Got it, thanks. I was wondering if it was a split as you described or all in one radio stack so you answered my question.

@MattWestb

Copy link
Copy Markdown

C6(X) and H2(X) is RISC-V with 15.4 radios that is compatible in there IDF.
On the host part is the C3 and C6 compatible but the C3 is weaker and dont have WiFi (its not bad then C6 its using the same radio path so can only communicating with one network at the time but they is OK if using USB or UART and no WiFi).
S3 is the best for the host side application and is used in Espressives Zigbe / Thread GW example (it shall also working with CX chips) but its not RISC-V so can being little problematic and need more testing for knowing it working OK.

I have the Zigbee/Thread GW with ETH HAT if need testing in the future then its very standard but is having one very hotted S3 module (16M flash) but all modules used on it is original so have good PCB antennas and not like the clones mini board that have lost all RF tuning on the way from the factory (compared with the reference design).

If you need help testing of ESP32 or EFR32 MG1 or MG21 devices give my one sign Puddly !!

@Hedda

This comment was marked as off-topic.

@puddly

puddly commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

The ESP32 experiment is a success! I'm able to run my home network on it with decent performance.

  • The host stack can run entirely on Embassy, requiring Tokio just for serial communication and the WebSocket server. This lets us share even more code between the microcontroller and host builds.
  • The ESP32 HAL Rust crate does not expose a way to control the 802.15.4 ACK "frame pending" bit so it requires a small fork: esp-rs/esp-hal@main...puddly:esp-hal:puddly/frame-pending-bit-api
  • The Seeed XIAO ESP32-C6 dev kit either has a really bad on-board radio or the radio bring-up sequence in this branch is faulty. Both RX and TX are quite poor.

There are a few routing failure edge cases that I'm now running into but I suspect they may have surfaced due to the (artificially?) bad radio on the module.

@MattWestb

Copy link
Copy Markdown

Great work Puddly !!!

For the radio performance i think it can being good documentation what is devices is good and bad.
95% of all stamp size boards is have normally dissent onboard chip (its one folded PCB) antenna but normally is having very much tracks around and / or under it > not working OK in all directions.
The same board oft only having one capacitor (some have places for 2 more but not populated) in the chip - RF path and the reference design is having 3 or more (depends of how good interference filtering shall being done) components (capacitor and coils). Some exceptions can being find but not easy to getting.

The Seeed XIAO ESP32-C6 is having internal ceramic (with very narrow components) and one external connection and both shall working OK but must setting the GPIO right in the firmware for selecting witch RF path shall being used (if selected external without external antenna its being one big mess and can destroying the chip RF part).

Other ESP32 original or good made clones with PCB antennas shall working OK and is (shall) being FCC/CE certed so must have OK RF filtering implemented (but no 100% grantee its in-place and working).
Most modules / board with external antenna shall being better but still no grantee for being perfect and also must having OK RF matching and if having soft / hardware switching it must being correct done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants