Finally
i get the solution. I had seen that a guy is waiting 1.5 s after boot to activate Wifi and his comment is for 5V line stabilisation.
I have inserted a time.sleep(5) before wlan.active(True)
IT'S WORK
Wifi AP crash when activated (ESP32 DEVKIT V1 board)
Re: Wifi AP crash when activated (ESP32 DEVKIT V1 board)
Glad to hear you got it working. I can see that I didn't recognise the actual problem you were having. One year down the track I would have suggested other things as I have also had some grief in this area.
If it is a matter of 5V stabilisation then there are hardware fixes for this. If the 5V to 3V3 regulator (AMS31117?) can supply the peak current required when you make the WiFi active then a 1000uF electro on the 5V DC input should sort it. This is if you are supplying the board from external 5V.
If the 5V to 3V3 regulator struggles to provide peak current than I would try 470 to 1000uF on the 3V3 line. If you supply the board from an external 3V3 maybe it has enough surge capacity.
Could you post a link?
Even with those hardware "fixes" I find I still have to:
Maybe it is the utime.sleep(1) that makes it work! I often see that it requires 2-3 attempts before connecting.
If it is a matter of 5V stabilisation then there are hardware fixes for this. If the 5V to 3V3 regulator (AMS31117?) can supply the peak current required when you make the WiFi active then a 1000uF electro on the 5V DC input should sort it. This is if you are supplying the board from external 5V.
If the 5V to 3V3 regulator struggles to provide peak current than I would try 470 to 1000uF on the 3V3 line. If you supply the board from an external 3V3 maybe it has enough surge capacity.
Could you post a link?
Even with those hardware "fixes" I find I still have to:
Code: Select all
if not sta_if.isconnected():
print('connecting to hotspot...')
sta_if.active(True)
sta_if.ifconfig((config.WiFi_device, '255.255.255.0', config.gateway, '8.8.8.8'))
sta_if.connect(config.hotspot, config.password)
while (count < 5):
count += 1
if (sta_if.isconnected()):
count = 0
break
print('.', end = '')
utime.sleep(1)