Exemplo n.º 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()
Exemplo n.º 2
0
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")
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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!")
Exemplo n.º 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()