WLAN access point not working micropython 1.19.1
Posted: Wed Sep 07, 2022 3:53 pm
With micropython 1.15 the following code worked to create an accesspoint.
Recently upgraded to micropython 1.19.1 and the network accesspoint does not appear anymore.
I discovered that the following code works, but then how to set the security and password of the accesspoint?
The accesspoint is shown but has no security enabled...
Help would be appreciated.
Code: Select all
def enable_wifi(ssid, password):
""" Enable device as WiFi access point
Parameters
----------
ssid : String
Broadcast WiFi SSID
password: String
WiFi password
"""
if not NetworkHandler.ap:
NetworkHandler.ap = network.WLAN(network.AP_IF)
NetworkHandler.ap.active(0)
NetworkHandler.ap.config(essid=ssid)
NetworkHandler.ap.config(password=password)
NetworkHandler.ap.config(channel=1)
NetworkHandler.ap.config(authmode=4)
NetworkHandler.ap.active(1)
I discovered that the following code works, but then how to set the security and password of the accesspoint?
Code: Select all
if not NetworkHandler.ap:
NetworkHandler.ap = network.WLAN(network.AP_IF)
NetworkHandler.ap.active(0)
NetworkHandler.ap.config(essid=ssid, channel=1)
Help would be appreciated.