Custom ESP32 board WiFi connection issues

ESP_Sprite
Posts: 9769
Joined: Thu Nov 26, 2015 4:08 am

Re: Custom ESP32 board WiFi connection issues

Postby ESP_Sprite » Tue Mar 23, 2021 3:56 am

Looks like some issue impacting WiFi reception/transmission... from what I experienced, every step in the WiFi association has a timeout for the other party to respond. If the packet gets lost somehow/somewhere, no response comes, and the association will restart from scratch.

matty_t
Posts: 9
Joined: Thu Feb 04, 2021 12:29 am

Re: Custom ESP32 board WiFi connection issues

Postby matty_t » Tue Mar 23, 2021 4:15 am

ESP_Sprite wrote:
Tue Mar 23, 2021 3:56 am
Looks like some issue impacting WiFi reception/transmission... from what I experienced, every step in the WiFi association has a timeout for the other party to respond. If the packet gets lost somehow/somewhere, no response comes, and the association will restart from scratch.

Interesting... thanks for the info. My theory at the moment is that the board isn't able to transmit. I say the "board" because at this point I'm not sure if its the ESP32 itself, the matching network, or the antenna. I think this makes sense with the previous knowledge:
- board thinks it can set up a network, but network isn't visible anywhere
- board seems to sense the AP is there, but fails to auth
- board can't connect to AP since it can't send necessary packets

If I don't find something in the next day or so, I might try replacing the ESP32 on my board with a different one. Will be a pain. Will report back with findings as they arrive.

matty_t
Posts: 9
Joined: Thu Feb 04, 2021 12:29 am

Re: Custom ESP32 board WiFi connection issues

Postby matty_t » Tue Mar 23, 2021 11:27 pm

ESP_Sprite wrote:
Tue Mar 23, 2021 3:56 am
Looks like some issue impacting WiFi reception/transmission... from what I experienced, every step in the WiFi association has a timeout for the other party to respond. If the packet gets lost somehow/somewhere, no response comes, and the association will restart from scratch.

Aha! It does seem to be a transmission issue! I ran a scan code, and the board can see all WiFi networks, but still can't connect. I have not changed anything from my previous setup, just got some new code. This is the output from this code, which lists all the nearby 2.4GHz WiFis. Unsure what this means for my board as of yet.
Attachments
nearby_wifi.png
nearby_wifi.png (103.36 KiB) Viewed 7814 times

memory_stick
Posts: 2
Joined: Wed Mar 03, 2021 1:40 pm

Re: Custom ESP32 board WiFi connection issues

Postby memory_stick » Tue Mar 30, 2021 1:26 pm

Hi @matty_t

We recently ran in the exact same issue with a custom PCB with an ESP32 and custom Antenna.

long story short:
With our design it was the crystal Oscillator, more precisely the matching of the Load Capacitance. In a Hw revision the used crystal got changed from 26MHz to 40MHz. At the same time, the rated load capacitance of the crystal changed from 8pF to 4pF. With the external Caps at both XTAL_N and XTAL_P to GND at the same value as before, the matching was nowhere near the 4pF required by the new crystal.

Which brings me to the BIG question:
What is the input capacitance of the ESP32 internal Pierce oscillator?

Normally I would expect such a specification in the Datasheet or similar, but there seems to be no mention of it in any document from Espressif and also no information on the forums.

The Input Capacitance of the ESP32 has to be calculated in to the Load matching that the crystal sees.
So:
CL_desired = CL_crystal = ((Cap_XTAL_P + CL_esp_internal_p) * (Cap_XTAL_N + CL_esp_internal_N)) / (Cap_XTAL_P + CL_esp_internal_p + Cap_XTAL_N + CL_esp_internal_N) + CL_traces
Or easier:
CL_desired = CL_crystal = (Cap_XTAL_P + CL_esp_internal_p)//(Cap_XTAL_N + CL_esp_internal_N) + CL_traces

Without information form ESP about ESP32 input capacitance this formula will never be solvable.
Hint: CL_traces are the PCB traces and typically amount to some 2pF.

Any updated from an ESP rep would be welcomed

More theory of needed: https://www.st.com/resource/en/applicat ... ronics.pdf

matty_t
Posts: 9
Joined: Thu Feb 04, 2021 12:29 am

Re: Custom ESP32 board WiFi connection issues

Postby matty_t » Tue Mar 30, 2021 6:33 pm

memory_stick wrote:
Tue Mar 30, 2021 1:26 pm
Hi @matty_t
We recently ran in the exact same issue with a custom PCB with an ESP32 and custom Antenna.
Hi @memory_stick!

Glad to see I'm not the only one with this issue, but not glad that we are both having this issue x)
memory_stick wrote:
Tue Mar 30, 2021 1:26 pm
long story short:
With our design it was the crystal Oscillator, more precisely the matching of the Load Capacitance. In a Hw revision the used crystal got changed from 26MHz to 40MHz. At the same time, the rated load capacitance of the crystal changed from 8pF to 4pF. With the external Caps at both XTAL_N and XTAL_P to GND at the same value as before, the matching was nowhere near the 4pF required by the new crystal.
I'm also very glad you found my post, because this was indeed enlightening. When calculating my crystals load capacitance you are indeed correct when saying that I did not take the ESP32s XTAL pins into consideration. I loaded it to my crystal datasheet's spec, but due to the XTAL pins maybe the capacitance is far too large.
memory_stick wrote:
Tue Mar 30, 2021 1:26 pm
Which brings me to the BIG question:
What is the input capacitance of the ESP32 internal Pierce oscillator?
Anything from an ESP rep on this topic would be quite interesting.

Unfortunately this is for a school project which is finishing in a couple weeks, so we have opted for a different solution since we could not resolve this issue in time. However, with the intent of using the ESP32 in the future, I would love to hear any developments, or if anyone else is having such issues.

Also, I wasn't clear on one thing from your post: did changing the crystals loading fix the issue? Or is it still unresolved for you?

memory_stick
Posts: 2
Joined: Wed Mar 03, 2021 1:40 pm

Re: Custom ESP32 board WiFi connection issues

Postby memory_stick » Thu Apr 01, 2021 9:05 am

Hi matty_t

The adjustment of the load capacitance solved the problem for the time being in our case (Prototype HW, just some FW Devs who need this thing to work somewhat reliably).
We are currently in a tight spot in terms of timeline, and are not directly responsible for the HW.

In our case, with near to no external capacitance we were able to successfully get WiFi and Bluetooth working, although we do still have a start-up issue with the ESP32 sometimes, when the Shutdown / reset is not "clean".
We also noted the crystal had influence on the SPI flash operation, so the Start-up issues are probably caused also by the crystal mismatch / not oscillating right

Hope these insight helps you or anyone else in future projects. And I do hope ESP can elaborate a little on this topic too.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Custom ESP32 board WiFi connection issues

Postby WiFive » Thu Apr 01, 2021 6:44 pm

matty_t wrote:
Fri Mar 19, 2021 8:54 pm
WiFive wrote:
Fri Mar 19, 2021 12:36 am
Crystal oscillator circuit, check frequency stability
Thanks for the idea. Checked the crystal in a scope at its sitting nicely at 39.998MHz, so seems good
Recommended spec is 10ppm but yours is 50ppm.

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Custom ESP32 board WiFi connection issues

Postby ESP_krzychb » Thu Aug 25, 2022 5:29 am

memory_stick wrote:
Tue Mar 30, 2021 1:26 pm
What is the input capacitance of the ESP32 internal Pierce oscillator?
Hi @memory_stick,
The capacitance of pins is provided in the chip datasheet. Below is the value from ESP32 Series Datasheet v3.8
186577357-c2711e2c-a31c-4269-b55e-d176eac238da.png
186577357-c2711e2c-a31c-4269-b55e-d176eac238da.png (86.35 KiB) Viewed 4428 times

Who is online

Users browsing this forum: No registered users and 88 guests