First import

This commit is contained in:
2020-05-09 13:03:13 -04:00
commit 4013d38a31
5 changed files with 68 additions and 0 deletions

1
wifi/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
creds

8
wifi/README.md Normal file
View File

@@ -0,0 +1,8 @@
# README.md
To deploy :
```bash
mipy cp creds.ini
mipy -ir cp main.py
```

0
wifi/creds.example Normal file
View File

15
wifi/main.py Normal file
View File

@@ -0,0 +1,15 @@
import network
file = open('creds', 'r')
wifi_ssid = file.readline().rstrip("\n")
wifi_pass = file.readline().rstrip("\n")
file.close()
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect(wifi_ssid, wifi_pass)
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig())