When running the script below, ap_if.active() wil continuously print False.
However the bug will only appear with sta_if configured with SSID and pasword for your modem/router and with ap_active deactivated on start of the script.
If ap_if.active() returns True, then run ap_if.activate(False) and run the script again. After a few runs the bug will appear.
If I use the time.sleep(0.1) then everything works as expected.
Can someone confirm this bug? (I used the latest 1.12 version from the main Python site)
Code: Select all
import network
import time
ap_if = network.WLAN(network.AP_IF)
ap_if.active(True)
# time.sleep(0.1)
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
while True:
print("AP: ", ap_if.active())
print("STA: ", sta_if.active())
if ap_if.active():
if sta_if.active():
print("All interfaces active")
break
time.sleep(1)