Add periodic NTP resync
This commit is contained in:
17
boot.py
17
boot.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user