Keep running into odd issues it seem..
I have written a small util.py file that only include a function to connect to network
Code: Select all
import network
def wifi_connect():
"""Connect to the configured Wi-Fi network."""
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print('connecting to network...')
sta_if.active(True)
sta_if.connect(CONFIG['WIFI_NAME'], CONFIG['WIFI_PWD'])
while not sta_if.isconnected():
time.sleep(1)
print('network config:', sta_if.ifconfig())

This keep happen also if I disconnect from the computer.
I have to re-flash the unit to get it working again.... I dont have any main.py on the unit that execute anyhting.
Am I doing something wrong or what is causing this?