예제 #1
0
def main():
    """Main function. Runs after board boot, before main.py
    Connects to Wi-Fi and checks for latest OTA version.
    """

    gc.collect()
    gc.enable()

    # Wi-Fi credentials
    SSID = ""
    PASSWORD = ""

    connect_wlan(SSID, PASSWORD)

    # Install Senko from PyPi
    upip.install("micropython-senko")

    import senko
    OTA = senko.Senko(user="******",
                      repo="senko",
                      working_dir="examples",
                      files=["main.py"])

    if OTA.update():
        print("Updated to the latest version! Rebooting...")
        machine.reset()
예제 #2
0
파일: boot.py 프로젝트: icheered/SlothIOT
def main():
    """Main function. Runs after board boot, before main.py
    Connects to Wi-Fi and checks for latest OTA version.
    """
    esp.osdebug(None)

    gc.collect()
    gc.enable()

    # Wi-Fi credentials
    SSID = wifi_ssid
    PASSWORD = wifi_pass

    connect_wlan(SSID, PASSWORD)

    import senko
    from config import GITHUB_USER, GITHUB_REPO, GITHUB_DIR, GITHUB_BRANCH
    OTA = senko.Senko(user=GITHUB_USER,
                      repo=GITHUB_REPO,
                      working_dir=GITHUB_DIR,
                      branch=GITHUB_BRANCH,
                      files=["main.py", "boot.py", "devices.py"])

    print("Checking for update")

    # For debugging, otherwise it'll try to get updates
    return

    if OTA.update():
        print("Updated to the latest version! Rebooting...")
        machine.reset()
    else:
        print("No update")
예제 #3
0
def main():
    """Main function. Runs after board boot, before main.py
    Connects to Wi-Fi and checks for latest OTA version.
    """

    gc.collect()
    gc.enable()

    if USE_SENKO:
        connect_wlan(secrets.WIFI_SSID, secrets.WIFI_PASSWORD)

        OTA = senko.Senko(user="******",
                          repo="led-clock",
                          files=[
                              "boot.py",
                              "main.py",
                              "lib/constants.py",
                              "lib/nettime.py",
                              "lib/s7digit.py",
                              "lib/s7display.py",
                              "lib/s7segment.py",
                              "lib/senko.py",
                              "lib/urequests.py",
                          ])

        if OTA.update():
            print("Updated to the latest version! Rebooting...")
            machine.reset()
예제 #4
0
def boot():
    GITHUB_URL = "https://github.com/hrysto97/esp-upython/blob/main/"
    OTA = senko.Senko(url=GITHUB_URL, files=["main.py"])

    # Connect to Wi-Fi network.
    connect_wlan(secrets.WIFI_SSID, secrets.WIFI_PASSWORD)

    if OTA.update():
        print("Updated to the latest version! Rebooting...")
        machine.reset()
예제 #5
0
def main():
    gc.collect()
    gc.enable()
    GITHUB_URL = "https://raw.githubusercontent.com/yohannafrans/esp32-test/master/example/"
    OTA = senko.Senko(GITHUB_URL, ["main.py"])
    if OTA.fetch():
        print("A newer version is available!")
        if OTA.update():
            print("updated to the latest version! Rebooting...")
            machine.reset()
    else:
        print("Up to date!")
예제 #6
0
def main():
    """Main function. Runs after board boot, before main.py
    Connects to Wi-Fi and checks for latest OTA version.
    """

    gc.collect()
    gc.enable()

    SSID = ""
    PASSWORD = ""

    connect_wlan(SSID, PASSWORD)

    GITHUB_URL = "https://raw.githubusercontent.com/RangerDigital/senko/master/examples/"
    OTA = senko.Senko(GITHUB_URL, ["main.py"])

    if OTA.update():
        print("Updated to the latest version! Rebooting...")
        machine.reset()