1 Star 1 Fork 0

习惯孤独 / micropython-ota-test

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
boot.py 1002 Bytes
一键复制 编辑 原始数据 按行查看 历史
习惯孤独 提交于 2022-10-08 00:44 . update boot.py.
# 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()
Python
1
https://gitee.com/qtsun/micropython-ota-test.git
git@gitee.com:qtsun/micropython-ota-test.git
qtsun
micropython-ota-test
micropython-ota-test
master

搜索帮助