Hi everybody,
I’m trying to set my ESP32 in Acces point mode , and i’m using the code bellow, the ESP32 AP ssid gives the acces to clients without demanding password . the acces stay open. can you help me please to resolve this issue?
Thanks.
from machine import Pin
import network
import esp
esp.osdebug(None)
import gc
gc.collect()
ssid = ‘on-AP’
password= ‘12345678’
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid=ssid, password=password)
while ap.active() == False:
pass
print(‘Connection successful’)
print(ap.ifconfig())
Hi.
Can you provide more details about your project?
Do you have a boot.py and a main.py file?
Are you sure you are uploading all the necessary files if that’s the case?
Regards,
Sara
Hi Sara,
I’m using the same code provided in the tutorial “MicroPython: ESP32/ESP8266 Access Point (AP)” without make any changes in order to see the hello world ! page .
the issue is that when i check the status of the network with ssid = ‘on-AP’ the network stays open without requesting the password .
in this case everyone can connect to the Acces point(esp32) without need of password.
Regards,
Ilyas
Hi Ilyas.
I tested the code and got the same result as yours.
I’m not sure why that is happening. Maybe it is related to some update on the firmware because it was working before.
Can you try adding the following line
ap.config(authmode=3)
after this:
ap.config(essid=ssid, password=password)
Then, let me know the result.
Regards,
Sara
It Works , thank you very much Sara !!
Should i use a precise firmware version in order to have better comptibility with your tutorials code ?
Thanks
Hi.
It is always better to use the most updated version.
Most of the things keep compatible with older versions.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara