feat: added file upload

This commit is contained in:
Elias Renman
2023-05-21 21:24:02 +02:00
parent a9a1915a5e
commit 7cb963bb24
8 changed files with 86 additions and 46 deletions

22
pico-w/src/boot.py Normal file
View File

@@ -0,0 +1,22 @@
import network
import time
from config import ssid, password
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)
max_wait = 10
while max_wait > 0:
if wlan.status() < 0 or wlan.status() >= 3:
break
max_wait -= 1
print('Attempting to connect to Wifi...')
time.sleep(1)
if wlan.status() != 3:
raise RuntimeError('Wifi connection failed')
else:
print('Wifi connection established')
status = wlan.ifconfig()
print('ip:' + status[0])