Created
March 16, 2022 14:37
-
-
Save standarddeviant/9fa47b6d7ec509e81225abdc20c5cacc to your computer and use it in GitHub Desktop.
Make a wifi connect utility for micropython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -m mpy_cross wifi_connect.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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