ESP32 Wifi connection/distance issues

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
digitalblur
Posts: 11
Joined: Mon Jan 13, 2020 5:31 am

ESP32 Wifi connection/distance issues

Post by digitalblur » Mon Nov 16, 2020 2:37 am

Im using a DF robot Beetle ESP32 and am having some Wifi connection issues.

When I have the device plugged into the USB AND connect over the serial port on my computer the device is able to connect to Wifi no problem.

When I have the device plugged into the USB without any connection over the serial port, it is unable to connect to Wifi with the same distance to the router. However, if I move the device closer, it is able to connect.

I've spent the last couple of days racking my brain over this. Can anyone make any sense of this? Any ideas?

Thanks in advance

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ESP32 Wifi connection/distance issues

Post by pythoncoder » Mon Nov 16, 2020 5:47 am

It is probably the presence of a ground lead improving the performance of the antenna. You may find that linking a piece of metal to Gnd has the same effect.

I can't say I've observed this at 2.4GHz but the need for a ground plane is standard at lower frequencies.
Peter Hinch
Index to my micropython libraries.

digitalblur
Posts: 11
Joined: Mon Jan 13, 2020 5:31 am

Re: ESP32 Wifi connection/distance issues

Post by digitalblur » Tue Nov 17, 2020 6:06 am

Thanks for the suggestion.

I tried adding a 12" alligator clip wire to the ground and didn't have a noticeable effect. Also tried attaching a large piece of aluminum foil to ground and also did not seem to help.

Any thoughts on why just connecting to the serial console would make this work?
Literally I have the USB device plugged into my mac and it doesn't connect to wifi on boot, then the only thing I do is connect to the serial port with: screen /dev/tty.wchusbserialfd120 115200

And it is able to connect to the wifi completely fine within seconds.

Any other thoughts?
Thanks

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ESP32 Wifi connection/distance issues

Post by pythoncoder » Tue Nov 17, 2020 6:14 am

I'm baffled. I did a lot of long-term testing of ESP32 (also ESP8266 and Pyboard D) in a remote location. The aim was to prove resilience of my code with a very poor WiFi signal. Devices were powered from a large battery with a step-down converter to produce 5V. This fed the USB connector via a power-only USB lead. I experienced no issues with this method of running.
Peter Hinch
Index to my micropython libraries.

digitalblur
Posts: 11
Joined: Mon Jan 13, 2020 5:31 am

Re: ESP32 Wifi connection/distance issues

Post by digitalblur » Wed Nov 18, 2020 7:17 am

Thanks for your response.

I've done some additional troubleshooting. I added the micropython firmware to another module (adafruit feather esp32), deployed the code to the module and this one does not have any wifi connection issues. It consistently connects to my wifi at a good distance.

I also tested the dfrobot beetle esp32 module again using an RF meter.
1. When I power the module through my USB on the computer, the meter measures a single brief spike between ~1 and ~15 mW/m2 and then nothing
2. While still connected to the USB on my computer, I then connect to the device over the serial port, the RF meter then measures constant activity of more than 11 mW/m2 and the device connects to wifi no problem

It seems the connection to the serial port is triggering something that its not able to do on its own.. very odd

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ESP32 Wifi connection/distance issues

Post by pythoncoder » Wed Nov 18, 2020 2:19 pm

My ESP32 work mainly used the reference board (Espressif ESP32-DEVKITC with ESP-WROOM-32), plus a couple of SPIRAM boards from a Swiss maker.

I have considerably more experience of ESP8266 and can say that they vary hugely in quality, from some which struggled to connect 2 metres from the AP to others with excellent range. In general I find Adafruit products to be of high quality, and I have no complaints about my WeMos D1 mini boards.

I had similar experiences with NRF24L01 radios, where I threw two cheap boards in the bin because connectivity was hopeless. Once again, Adafruit boards work. There's a pattern here ;)

So I'm not surprised that you're seeing this kind of variability. As you probably know, RF design is not easy and some manufacturers clearly don't understand it. I have no commercial interest in Adafruit but, as an electronics design engineer, I think they develop good hardware.
Peter Hinch
Index to my micropython libraries.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: ESP32 Wifi connection/distance issues

Post by davef » Wed Nov 18, 2020 10:23 pm

Hi digitalblur,

Post a link to the schematic and PCB layout of the unit you are having trouble with. I would expect that any antenna configuration used at 2.4GHz would not be relying on any "customer-added" grounding.

Also, as antenna design and matching is a specialist topic I would expect their antenna and matching implementation to be based on a reference design.

digitalblur
Posts: 11
Joined: Mon Jan 13, 2020 5:31 am

Re: ESP32 Wifi connection/distance issues

Post by digitalblur » Thu Nov 19, 2020 5:45 am

Hi davef,

Thanks for taking a look. Here's the schematic link for the dfrobot module: https://github.com/Strictus/DFRobot/raw ... 0)-SCH.PDF

And here's a picture of the module with the PCB antenna. The module sits on top of another PCB that covers the underneath of the of the PCB antenna.
https://dfimg.dfrobot.com/store/data/DF ... /564/h/376

Since the wifi works after a serial console connection from my computer, Im wondering if theres some simple way to test(without computer) with a trigger for the serial boot sequence?

Thanks,
Tom

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: ESP32 Wifi connection/distance issues

Post by davef » Thu Nov 19, 2020 7:07 am

Tom,

Couldn't see anything antenna-related on the schematic.

I meant to ask what piece of gear you were using to measure field strength.

On the ESP modules the printed antenna sits out in free air. How far away is the pcb under the antenna and has that pcb got copper on the side closest to the antenna?

I guess what you have to figure out is the serial cable affecting the radiation pattern of the module or is there some control signal on the serial cable that is enabling the module? Do you see any change in supply current when you connect it to the computer? Is the power level of the ESP32 being messed-with?

digitalblur
Posts: 11
Joined: Mon Jan 13, 2020 5:31 am

Re: ESP32 Wifi connection/distance issues

Post by digitalblur » Fri Nov 20, 2020 5:57 am

Hi davef,

Im using the Cornet handheld unit here, its a basic RF strength meter:
https://radmeters.com/Cornet-ED78S.html

The PCB is directly underneath the antenna. Im not sure if theres copper on the PCB in that area. I'm going to try to carve away the PCB underneath the antenna and see if that helps.

I don't have an easy way to monitor the current on this device right now with USB, I'll need to look into an inline current meter.

I am also wondering about the serial connection doing something special in this case. There is an IC doing the USB -> serial connection on the module but I don't have any insights into it.

Post Reply