no password required with ESP32 as WLAN AP

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
cyrano1960
Posts: 39
Joined: Fri Mar 29, 2019 7:08 pm

no password required with ESP32 as WLAN AP

Post by cyrano1960 » Sun Mar 07, 2021 2:04 pm

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? :?

cyrano1960
Posts: 39
Joined: Fri Mar 29, 2019 7:08 pm

Re: no password required with ESP32 as WLAN AP

Post by cyrano1960 » Sun Mar 07, 2021 3:01 pm

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)

MrExplore
Posts: 3
Joined: Sat Mar 06, 2021 1:57 pm

Re: no password required with ESP32 as WLAN AP

Post by MrExplore » Sun Mar 07, 2021 7:50 pm

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')

Post Reply