ESP32 no longer connects to an access point (smartphone) #19118
Replies: 2 comments 1 reply
-
|
I don't know the details of your problems. I was able to connect to my phone's hotspot without any problems. I connected my phone to my home Wi-Fi network, not the mobile data network. My ESP32 is running the latest stable version of MicroPython, which I downloaded from the micropython.org server. The test script: import time, network, socket, ssl
network.WLAN(network.AP_IF).active(False)
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.config(pm=0) # disable power management
wlan.config(txpower=20)
# wlan.connect("Pixel_5192", "gdft352ffs912") # Pixel 6
wlan.connect("Redmi 14C", "rsfwa243afs614") # Xiaomi
time.sleep(5)
print(wlan.ifconfig())
port = 443
for srv in ('github.com', 'micropython.org', 'google.com'):
addr = socket.getaddrinfo(srv, port)[0][-1]
ss = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ss.connect(addr)
print('Connected:', addr)
time.sleep(1)
s = ssl.wrap_socket(ss)
s.write(b'GET /\r\n\r\n')
data = s.read(400)
print('Resquest sent')
for d in data.decode().split('\r\n'):
print(d)
ss.close()
s.close()
time.sleep(1)
print('----------------------------')The log of the test run: I can only conclude that the ESP32 with MicroPython v1.28.0 can connect to phone hotspots without problems. I'm sure you've enabled the hotspot on your phone. On a Xiaomi phone, I disable "Private DNS." I haven't tested it with mobile data. I cannot say whether it would work on mobile data as well as it does on WiFi. |
Beta Was this translation helpful? Give feedback.
-
|
Thank's for help. One question : after many reboot i'am stuck with 'EADDRINUSE' . Exists one trick to avoid that ? Regards |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, in 2022, an ESP32 with MicroPython could connect to an access point
activated by a smartphone (Huawei P20).
Today, it no longer connects, or rather, it connects
erratically and not operationally.
See below:
This is very detrimental to mobility.
How to solve this problem:
Thank you for your help
Beta Was this translation helpful? Give feedback.
All reactions