with the following code I can successfully establish a WiFi connection between my ESP8266 and my home Wlan.
Code: Select all
def WLan_verbinden(SSID, passwort):
sta_wlan = network.WLAN(network.STA_IF)
if not sta_wlan.isconnected():
sta_wlan.active(True)
sta_wlan.connect(SSID, passwort)
while not sta_wlan.isconnected():
pass
return sta_wlan.isconnected()
I am wondering, what solutions are you using to restore a WiFi connection?
One solution I am currently thinking of: to use a timer-interrupt to call my function above from time-to-time.