代码拉取完成,页面将自动刷新
# This file is executed on every boot (including wake-boot from deepsleep)
# import esp
# esp.osdebug(None)
# import webrepl
# webrepl.start()
import gc
import network
import machine
def connect_wlan(ssid, passwod):
sta_if = network.WLAN(network.STA_IF)
ap_if = network.WLAN(network.AP_IF)
sta_if.active(True)
ap_if.active(False)
if not sta_if.isconnected():
print("Connecting to WLAN ({})...".format(ssid))
sta_if.active(True)
sta_if.connect(ssid, passwod)
while not sta_if.isconnected():
pass
return True
def main():
gc.collect()
ssid = "*****"
password = "*****"
connect_wlan(ssid, password)
import senko
ota = senko.Senko(user="******", repo="micropython-ota-test", working_dir="app", files=["main.py"])
print("ota init")
if ota.update():
print("updated to the latest version!")
machine.reset()
if __name__ == "__main__":
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。