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

esp32c6 really bad WiFi range compared to C program #3075

Open
jpdisco opened this issue Jan 30, 2025 · 9 comments
Open

esp32c6 really bad WiFi range compared to C program #3075

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

Comments

@jpdisco
Copy link

jpdisco commented Jan 30, 2025

Bug description

When I make program with C in arduino editor for seeed lab xiao esp32c6 wifi works very well connects instantly and has good range.

when I make program in rust with esp wifi it can take a long time to connect and the range is bad, putting my hand between esp and router stops pings.

To Reproduce

I used the static ip examples from this repo (with and without embassy) and the range was still very bad.

I even try setting power save on wifi to NONE and it still is bad!

Expected behavior

I think range should be like what the arduino C editor gives me.

Environment

esp-hal version = "0.23.1"

RISC-V Chip:
IDCODE: 000000dc25
Version: 0
Part: 13
Manufacturer: 1554 (Espressif Systems (Shanghai) Co Ltd)
Xtensa Chip:
IDCODE: 0000000000
Version: 0
Part: 0
Manufacturer: 0 (Unknown Manufacturer Code)

@jpdisco jpdisco added bug Something isn't working status:needs-attention This should be prioritized labels Jan 30, 2025
@jpdisco
Copy link
Author

jpdisco commented Jan 30, 2025

Also only when using this library my esp gets very hot!

@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 31, 2025

Also only when using this library my esp gets very hot!

That's probably because our examples run at max-CPU-speed by default

According to the schematic your board can switch between the in-built antenna and an U.FL connector.

Image

I assume you are not doing anything special and the default is the U.FL connector (without an antenna attached) - so either connect an antenna or make sure you are using the build-in antenna

@jpdisco
Copy link
Author

jpdisco commented Jan 31, 2025

I also read that but I did what they said and used the GPIO pins to set to internal antenna and I think it is the internal one because when i put finger over the ceramic antenna part it stops working but covering the ufl connector it still works but bad range still.

@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 31, 2025

Image

Your code actively sets GPIO3 to low and GPIO14 to low?

@jpdisco
Copy link
Author

jpdisco commented Jan 31, 2025

Yes I added to my code:

    let mut x = Output::new(peripherals.GPIO3, Level::Low);
    x.set_low();

    Timer::after(Duration::from_secs(1)).await;

    let mut y = Output::new(peripherals.GPIO14, Level::Low);
    y.set_low();

No effect unfortunately, I can still block wifi with my hand. I did not even have to do this with my C code because I think internal antenna is default.

@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 31, 2025

Yeah for the Arduino code you select your board and it initializes things accordingly. So, the big question is what else do they configure differently

Would be interesting what happens to your Arduino code if you select a vanilla ESP32-C6, then

@jpdisco
Copy link
Author

jpdisco commented Jan 31, 2025

I tried a few different esp32c6 boards in the list including the dev board one at the top and they all failed to compile.

@MabezDev MabezDev added 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

bjoernQ commented Jan 31, 2025

t.b.h. I never every used Arduino at all - but it would be even much more helpful if you could run an esp-idf example on that board and see if it works fine ( e.g. https://github.com/espressif/esp-idf/tree/master/examples/wifi/getting_started/station )

@ivmarkov
Copy link

ivmarkov commented Feb 3, 2025

Could it be related to the problem described in #3081 ?

@jpdisco In other words, a quick workaround might be to do:

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

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

4 participants