Page 1 of 1

no password required with ESP32 as WLAN AP

Posted: Sun Mar 07, 2021 2:04 pm
by cyrano1960
Hello, I have tried the following code snippet to implement a simple WLAN AP with an ESP 32 WifiKit:

Code: Select all

import network

ssid = 'esp32_AP'
password = '123456789'

ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid=ssid, password=password)

print(ap.ifconfig())
After that I can see the WiFi network on my Smartphone, but it doesn´t ask for a password. If I run the same snippet on an ESP8266 that I got a dialog to enter the password. I have tried it several times with different passsords and essids, restarted the ESP32 module but it is still the same result. Any ideas? :?

Re: no password required with ESP32 as WLAN AP

Posted: Sun Mar 07, 2021 3:01 pm
by cyrano1960
Update:
I found a solution for this but perhaps someone else is running into the same problem.

The password query on ESP32 is only active if the autmode is specified, so this will work for me:

Code: Select all

ap.config(essid=ssid, authmode=network.AUTH_WPA_WPA2_PSK, password=password)

Re: no password required with ESP32 as WLAN AP

Posted: Sun Mar 07, 2021 7:50 pm
by MrExplore
I actually had the exact same problem this weekend and came to the same conclusion.

This does NOT work:

Code: Select all

AP = network.WLAN(network.AP_IF)
AP.active(True)
AP.config(essid='esp32', password='12345678')
This does:

Code: Select all

AP = network.WLAN(network.AP_IF)
AP.active(True)
AP.config(essid='esp32', authmode=3, password='12345678')