miniserver.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:esp-webui 作者: MarkR42 项目源码 文件源码
def periodic_tasks():
    # Called every few seconds
    # Check if the time has been set.
    epoch = time.mktime((2016,1,1,0,0,0,0,0,0))
    time_is_set = ( time.time() > epoch )
    if not time_is_set:
        # Check if the network STA is configured.
        sta = network.WLAN(network.STA_IF)
        if sta.isconnected():
            #Trying to sync with ntp
            try:
                ntptime.settime()
            except OSError:
                print("Failed to sync with ntp")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号