Add periodic NTP resync

This commit is contained in:
2017-08-26 00:45:57 +03:00
parent c2f7272a04
commit 9eb83d2b1c
3 changed files with 38 additions and 12 deletions

17
boot.py
View File

@@ -1,17 +1,16 @@
# Just in case prevent boot loops
from time import sleep
print("Press Ctrl-C to stop boot script...")
sleep(1)
# Disable AP
import network
ap_if = network.WLAN(network.AP_IF)
ap_if.active(False)
print("Access point disabled")
# Connect to wireless network as client
import network
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect("Robootikaklubi", "u4HNj3sgYK")
# Synchronize clock
import ntptime
ntptime.settime()
while not sta_if.isconnected():
pass
# Clean up
import gc