Custom ESP32 board WiFi connection issues

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

Custom ESP32 board WiFi connection issues

Postby matty_t » Thu Mar 18, 2021 6:34 pm

Hello everyone,

I have a custom PCB I've designed that makes use of an ESP32 as both the MCU and a WiFi chip. Am currently trying to get it to connect to an ESP32 WROOM dev kit via WiFi, and I've tried a lot of different configurations with no luck. I'm asking for a rubber ducky to bounce my tests off of, and give any feedback/criticism/advice. Below is a chronological description of the tests I've ran, with a TL;DR at the bottom.



TEST1:

As a sanity check, I've gotten two dev kits to connect. One I set up with the Espressif example code for being an access point (AP), and the other is set up with the Espressif example code for being a station. The dev kits successfully establish a network and connect to each other: great! As expected. Firmware seems functional out of the box.



TEST2:

Next I flash the station code to my board, and the ESP32 gets stuck in a loop, as seen below, and times out.

https://media.discordapp.net/attachment ... height=702



TEST3:

If I flash my board with the AP code, it thinks that it successfully sets up the network, but the network isn't visible on anything (not on the dev kits, nor my cellphone, etc.). This leads me to believe its a HW issue, possibly with the antenna, or matching network.



TEST4:

I used a Particle Argon board to test both antennas (both are PCB antennas on 10cm micro-coax cables), and the Argon can connect to WiFi using both antennas, so I think the antennas are fine. I used the Argon since it uses an ESP32 as its WiFi slave.



QUICK COMMENT:

The next item to check off was the antenna matching network. I designed one according to the ESP32 datasheet, which suggested a CLC pi matching network. Using some online tools I made one. With the wireless not working though, I decided to open up one of the dev kits, and I noticed they use a LCC matching network, or more accurately a tapped capacitor matching network .



REWORK + TEST5:

Fearing my matching was shit, I ripped the dev kits and soldered it to my board. Still though, same results as before: as a station it times out, and as an AP it thinks the network is up, but it can't be seen anywhere.



CONCLUSION:

At this point I'm hesitant to replace the ESP32 chip, since it works in every other way EXCEPT WiFi, so I have a hard time believing only the LNA_IN pin is busted. This being said, what else could it be? The firmware seems to work, the antennas seem to work, and the matching network seemed to work.

Any suggestions/ideas are welcome. I can also provide schematics/PCB pics/IRL pictures and have access to a scope if needed.



TL;DR pretty sure firmware works, pretty sure ESP32 ok, pretty sure matching network is ok, and pretty sure antennas are ok... any help figuring out any possible issues is appreciated

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

Re: Custom ESP32 board WiFi connection issues

Postby WiFive » Fri Mar 19, 2021 12:36 am

Crystal oscillator circuit, check frequency stability

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

Re: Custom ESP32 board WiFi connection issues

Postby matty_t » 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

becorey
Posts: 92
Joined: Sat Mar 28, 2020 4:18 pm

Re: Custom ESP32 board WiFi connection issues

Postby becorey » Sat Mar 20, 2021 6:24 am

Share your schematic.
Often suspect the power supply with wifi issues, it is the highest power draw function.

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

Re: Custom ESP32 board WiFi connection issues

Postby matty_t » Sat Mar 20, 2021 5:05 pm

becorey wrote:
Sat Mar 20, 2021 6:24 am
Share your schematic.
Often suspect the power supply with wifi issues, it is the highest power draw function.
power_supply.PNG
power_supply.PNG (70.27 KiB) Viewed 7711 times
Above is the power supply I used for the board. Its the MAX17243ETPB. It has a 3A limit, so should be well within the specs of my board, since the ESP while TXing is the largest power draw on my board (~500mA from ESP32 datasheet if I remember correctly).

The two jumpers JP1 and JP2 are both grounded on the actual board, so the MAX17243 should be in PFM mode with spread spectrum disabled. This is not a big requirement, and I can modify the jumpers. Will look more closely at the regulator config right now actually.

One thing to note is that currently I'm powering the board from a 9V battery because I am a lowly student and don't have access to a power supply. Possibly the current draw of the ESP32 is just too much for this poor battery.

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

Re: Custom ESP32 board WiFi connection issues

Postby ESP_Sprite » Mon Mar 22, 2021 2:40 am

Yeah, 9V batteries generally have a very poor internal resistance; it would certainly not be my first choice to run an ESP32 off. However, if that were an actual issue, I'd expect the ESP32 to brown out. Still, connecting something else to it (lab PSU? USB power bank?) could give some insight.

Few other questions:
- Have you tried connecting to an existing (non-ESP32) access point?
- Have you tried feeding a stable source of 3.3V directly into the ESP32, bypassing the SMPS? You could use a cheapo LM1117 LDO for this if you don't have a lab PSU.

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

Re: Custom ESP32 board WiFi connection issues

Postby matty_t » Mon Mar 22, 2021 3:13 am

Yeah I haven't been able to get my hands on a good power supply until tomorrow so will give a go. But yeah, I agree that I would have expected the ESP32 to brownout if the power supply was the problem... we shall see tomorrow!
- Have you tried connecting to an existing (non-ESP32) access point?
Yes, and it gives the same results unfortunately.
- Have you tried feeding a stable source of 3.3V directly into the ESP32, bypassing the SMPS? You could use a cheapo LM1117 LDO for this if you don't have a lab PSU.
Unfortunately since this is on a custom PCB it would be pretty tough to change the power supply just like that... additionally I accidentally supplied 3V3 to the board via the flashing cable once, and it broke the regulator, so I'd rather not try and feed the board 3V3 unless its through the regulator. Once again though, tomorrow I'll have access to a more legit power supply, and will report back!

Thanks again for these great insights!

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

Re: Custom ESP32 board WiFi connection issues

Postby matty_t » Mon Mar 22, 2021 8:45 pm

ESP_Sprite wrote:
Mon Mar 22, 2021 2:40 am
Yeah, 9V batteries generally have a very poor internal resistance; it would certainly not be my first choice to run an ESP32 off. However, if that were an actual issue, I'd expect the ESP32 to brown out. Still, connecting something else to it (lab PSU? USB power bank?) could give some insight.

Few other questions:
- Have you tried connecting to an existing (non-ESP32) access point?
- Have you tried feeding a stable source of 3.3V directly into the ESP32, bypassing the SMPS? You could use a cheapo LM1117 LDO for this if you don't have a lab PSU.
Hey, so I finally got around to testing it with a more legit power supply. No dice. Exactly the same results as with the battery. Starting to lose my mind a bit here.

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

Re: Custom ESP32 board WiFi connection issues

Postby WiFive » Mon Mar 22, 2021 10:25 pm

Have you tested for shorts on the antenna trace to all power planes and surrounding pins? If nothing obvious is wrong the best option is probably to assemble another board.

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 2:55 am

WiFive wrote:
Mon Mar 22, 2021 10:25 pm
Have you tested for shorts on the antenna trace to all power planes and surrounding pins? If nothing obvious is wrong the best option is probably to assemble another board.
I have, no shorts RIP.

I do have some interesting new evidence though, and thorough dives into the code haven't given me much, but maybe I'm missing something obvious. The board still fails, but it fails in different ways depending on if there is an AP or not. If there IS an AP, then it gives a loop of:

Code: Select all

I (1090) wifi station: wifi_init_sta finished.
0I (1210) wifi:new:<1,1>, old:<1,0>, ap:<255,255>, sta:<1,1>, prof:1
I (1210) wifi:state: init -> auth (b0)
I (2210) wifi:state: auth -> init (200)
I (2220) wifi:new:<1,0>, old:<1,1>, ap:<255,255>, sta:<1,1>, prof:1
05I (2220) wifi station: retry to connect to the AP
I (2220) wifi station: connect to the AP fail
05I (4270) wifi station: retry to connect to the AP
I (4270) wifi station: connect to the AP fail
I (4390) wifi:new:<1,1>, old:<1,0>, ap:<255,255>, sta:<1,1>, prof:1
I (4390) wifi:state: init -> auth (b0)
I (5400) wifi:state: auth -> init (200)
I (5400) wifi:new:<1,0>, old:<1,1>, ap:<255,255>, sta:<1,1>, prof:1
05I (5400) wifi station: retry to connect to the AP
I (5400) wifi station: connect to the AP fail
05I (7450) wifi station: retry to connect to the AP
I (7450) wifi station: connect to the AP fail
I (7570) wifi:new:<1,1>, old:<1,0>, ap:<255,255>, sta:<1,1>, prof:1
I (7580) wifi:state: init -> auth (b0)
I (8580) wifi:state: auth -> init (200)

If there IS NOT an AP, then it gives a loop of:

Code: Select all

05I (18130) wifi station: retry to connect to the AP
I (18130) wifi station: connect to the AP fail
05I (20180) wifi station: retry to connect to the AP
I (20180) wifi station: connect to the AP fail
05I (22230) wifi station: retry to connect to the AP
I (22230) wifi station: connect to the AP fail
05I (24280) wifi station: retry to connect to the AP
I (24280) wifi station: connect to the AP fail
05I (26340) wifi station: retry to connect to the AP
I (26340) wifi station: connect to the AP fail
05I (28390) wifi station: retry to connect to the AP
I (28390) wifi station: connect to the AP fail
05I (30440) wifi station: retry to connect to the AP
I (30440) wifi station: connect to the AP fail
05I (32500) wifi station: retry to connect to the AP
I (32500) wifi station: connect to the AP fail
05I (34550) wifi station: retry to connect to the AP
I (34550) wifi station: connect to the AP fail
05I (36600) wifi station: retry to connect to the AP
I (36600) wifi station: connect to the AP fail
Any insights?

Who is online

Users browsing this forum: Majestic-12 [Bot] and 77 guests