23 lines
542 B
Python
23 lines
542 B
Python
|
# This file is executed on every boot (including wake-boot from deepsleep)
|
||
|
#import esp
|
||
|
#esp.osdebug(None)
|
||
|
import uos, machine
|
||
|
#uos.dupterm(None, 1) # disable REPL on UART(0)
|
||
|
import gc
|
||
|
#import webrepl
|
||
|
#webrepl.start()
|
||
|
gc.collect()
|
||
|
|
||
|
# SSID=xxx, PASSPHRASE=yyy
|
||
|
from wifi import *
|
||
|
import network
|
||
|
import utime as time
|
||
|
|
||
|
sta_if = network.WLAN(network.STA_IF)
|
||
|
sta_if.active(True)
|
||
|
sta_if.connect(SSID, PASSPHRASE)
|
||
|
print('\nconnecting...')
|
||
|
while not sta_if.isconnected():
|
||
|
print('.')
|
||
|
time.sleep(1)
|
||
|
print("ifconfig: {}".format(sta_if.ifconfig()))
|