ESP32 micropython 从NTP服务器同步时间
import ntptime
# function ntp_sync
# void
# void
def ntp_sync():
_t = False
ntptime.host = "ntp4.aliyun.com"
ntptime.NTP_DELTA = 3155644800
while (not _t):
try:
ntptime.settime()
except:
_t = False
else:
_t = True