Skip to content

Instantly share code, notes, and snippets.

@paulhayes
Created March 28, 2021 17:03
Show Gist options
  • Save paulhayes/803dbea25cd94b27da3126520c5db6c9 to your computer and use it in GitHub Desktop.
Save paulhayes/803dbea25cd94b27da3126520c5db6c9 to your computer and use it in GitHub Desktop.
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
#import webrepl
#webrepl.start()
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect(ssid, passkey)
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment