Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp-wifi: Coex almost not working on ESP32-C6 #3079

Open
bjoernQ opened this issue Jan 31, 2025 · 6 comments
Open

esp-wifi: Coex almost not working on ESP32-C6 #3079

bjoernQ opened this issue Jan 31, 2025 · 6 comments
Labels
bug Something isn't working package:esp-wifi Issues related to the esp-wifi package

Comments

@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 31, 2025

Referencing ivmarkov/rs-matter-embassy#3

Run the wifi_coex example and ping it from another machine - this works great on e.g. ESP32-C2, ESP32-C3 and ESP32-S3 - but barely on ESP32-C6

Given it works fine on C2 it's probably unrelated to the fact it's using a Nimble based driver.

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Jan 31, 2025

Seems like COEX is now also broken on ESP32

@ivmarkov
Copy link

Seems like COEX is now also broken on ESP32

I can confirm that later with rsp-matter-embassy but last time it did work for me in that provisioning worked on the esp32. Anyway, will know for sure later today.

@MabezDev MabezDev added bug Something isn't working package:esp-wifi Issues related to the esp-wifi package and removed status:needs-attention This should be prioritized labels Jan 31, 2025
@bjoernQ
Copy link
Contributor Author

bjoernQ commented Jan 31, 2025

@ivmarkov #3081 should resolve the issue on ESP32-C6 if you set the power-saving-mode to None (hopefully)

@ivmarkov
Copy link

@bjoernQ

I confirm that this "power boost" call:

    controller
        .set_power_saving(esp_wifi::config::PowerSaveMode::None)
        .unwrap();

did fix the issue on the esp32c6!

With that said, here's my dirty little secret: I actually noticed I don't even enable the coex feature on the esp-wifi driver (?!).
Yet, with our without coex, I do need to switch to non-power-saving mode the Wifi adapter - for esp32c6 specifically.

Now, how does it even work without coex being enabled?
Not sure, but perhaps that's because I actually do need "very little coex" so to say. Due to how the Matter protocol works:

  • Initially is is BLE only;
  • At the final BLE stages, the Matter controller asks the Wifi to (a) scan for networks (that's optional, not all controllers do it) and (b) to connect to a specific network
  • Weirdly, both ^^^ seem to work even with "coex" disabled
  • Once the Esp reports successful connection, the BLE connection is abandoned (the controller unsubscribes) and from there on, it is really Wifi only (as in, the controller tries to find the just-provisioned over BLE Matter Node using an mDNS query, and if successful - it hits the device on the Matter UDP port)

So to cut the long story short, I don't think I would be enabling coex for now, and therefore, #3081 is not strictly necessary for me, as the APIs are already available in non-coex mode. But yes, with coex enabled I confirmed the connectivity is just as bad, so I think your PR is actually correct!

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Jan 31, 2025

Wow that's interesting! But I'm glad it works for you - thanks for the update
(Need to try that coex without coex - maybe it's different for other chips)

@ivmarkov
Copy link

This Matter-style "connect" and "scan"-only "coex without coex" seems to work on all chips, but the c6 this needs power boost.
But I'll confirm again in the next hours/days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package:esp-wifi Issues related to the esp-wifi package
Projects
Status: Todo
Development

No branches or pull requests

3 participants