Update boot.py
This commit is contained in:
parent
425511d41f
commit
14a70cb024
19
src/boot.py
19
src/boot.py
|
@ -1,19 +1,8 @@
|
|||
import settings
|
||||
import wifi
|
||||
import time
|
||||
from settings import Settings
|
||||
|
||||
print(wifi.ap('qwerty'))
|
||||
s = Settings()
|
||||
|
||||
|
||||
settings = Settings()
|
||||
ssid = settings.get('wifi', {}).get('ssid', None)
|
||||
password = settings.get('wifi', {}).get('password', None)
|
||||
ip = settings.get('wifi', {}).get('ip', None)
|
||||
gateway = settings.get('wifi', {}).get('gateway', None)
|
||||
|
||||
for i in range(10):
|
||||
config = wifi.connect(ssid, password, ip, gateway)
|
||||
if config:
|
||||
print(config)
|
||||
break
|
||||
time.sleep(0.1)
|
||||
name = s.get('name', 'led')
|
||||
wifi.ap(name, '')
|
||||
|
|
Loading…
Reference in New Issue