mirror of
https://github.com/c0de-archive/pixoPython.git
synced 2024-12-22 13:22:40 +00:00
27 lines
508 B
Python
27 lines
508 B
Python
|
# Setup network
|
||
|
import network
|
||
|
import time
|
||
|
|
||
|
# Hardcoded network credentials
|
||
|
try:
|
||
|
import creds
|
||
|
except ImportError:
|
||
|
class creds:
|
||
|
WIFI_NETWORKS = [
|
||
|
('', '')
|
||
|
]
|
||
|
|
||
|
# We will attempt connections for this many seconds
|
||
|
MAX_WAIT = 15
|
||
|
|
||
|
# Setup the wifi connection
|
||
|
STA_IF = network.WLAN(network.STA_IF)
|
||
|
|
||
|
if not STA_IF.isconnected():
|
||
|
for network in creds.WIFI_NETWORKS:
|
||
|
if STA_IF.isconnected():
|
||
|
break
|
||
|
STA_IF.connect(network[0], network[1])
|
||
|
|
||
|
import uftpd
|