You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
506 B

# This file is executed on every boot (including wake-boot from deepsleep)
import esp
import network
import json
with open("config.json", 'r') as f:
config = json.load(f)
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print('connecting to network...')
sta_if.connect(config["wifi"]["ssid"], config["wifi"]["password"])
while not sta_if.isconnected():
print('network config:', sta_if.ifconfig())