Skip to content

Instantly share code, notes, and snippets.

@standarddeviant
Created March 16, 2022 14:37
Show Gist options
  • Save standarddeviant/9fa47b6d7ec509e81225abdc20c5cacc to your computer and use it in GitHub Desktop.
Save standarddeviant/9fa47b6d7ec509e81225abdc20c5cacc to your computer and use it in GitHub Desktop.
Make a wifi connect utility for micropython
python -m mpy_cross wifi_connect.py
# wifi_connect.py
import network
def wifi_connect():
sta_if = network.WLAN(network.STA_IF)
# ap_if = network.WLAN(network.AP_IF)
sta_if.active(True)
sta_if.connect('<SSID_HERE>', '<PASSWORD_HERE>')
return sta_if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment