Hello Eric,
many reasons for this, do you have any powerhungry device connected to the esp?
do you have OLED display connected?
I would do the following test:
- get the device in the same room of the wifi AP you want to connect to. If this solves the issue is signal probably. Try an external antenna maybe…
- change power supply, sometimes bad power supply transformer can cause issues.
- try to add the following code in the wifi section:
wifi:
output_power: 8.5dB
Link to github issue https://github.com/espressif/arduino-esp32/issues/2144#issuecomment-1212591202
4) if nothing helps: do you have a camera or display connected, try a code without those. If this is the case we should look at the code to understand.
Link to other posts similar issue:
Hope it helps.