snipplets.dev/code/MicroPython/network_ap.py

16 lines
333 B
Python
Raw Normal View History

2024-05-16 20:38:19 +03:00
import time
import network
def connect(essid='ESP', clients=3) -> bool:
print('Starting AP: {0}...'.format(essid))
ap = network.WLAN(network.AP_IF)
ap.active(True)
2024-08-24 15:24:01 +03:00
ap.config(essid=essid, max_clients=clients)
2024-05-16 20:38:19 +03:00
2024-08-24 15:24:01 +03:00
while ap.active() == False:
pass
2024-05-16 20:38:19 +03:00
2024-08-24 15:24:01 +03:00
print('AP "{0}" started'.format(essid))
return True