Gpy / Fipy OTA issues



  • Hi, I have been trying to modify the OTA solution provided on github (https://github.com/pycom/pycom-libraries/tree/master/examples/OTA) (see attached file)
    to support OTA updates communicating over LTE CAT-M1, but I get the below exceptions (<ota_server_address> replaces the actual OTA server IP address):

    Connecting to OTA
    Requesting: manifest.json?current_ver=1.0.0
    Requesting: 1.0.4/flash/lib/microWebCli.py
    Requesting: 1.0.4/boot.py
    [Errno 19] ENODEV
    Error downloading `http://<ota_server_address>:8000/1.0.4/boot.py` retrying...
    Requesting: 1.0.4/boot.py
    [Errno 19] ENODEV
    Error downloading `http://<ota_server_address>:8000/1.0.4/boot.py` retrying...
    Requesting: 1.0.4/boot.py
    [Errno 19] ENODEV
    Error downloading `http://<ota_server_address>:8000/1.0.4/boot.py` retrying...
    Requesting: 1.0.4/boot.py
    [Errno 19] ENODEV
    Error downloading `http://<ota_server_address>/1.0.4/boot.py` retrying...
    Requesting: 1.0.4/boot.py
    [Errno 19] ENODEV
    Error downloading `http://<ota_server_address>:8000/1.0.4/boot.py` retrying...
    Traceback (most recent call last):
      File "/flash/main.py", line 798, in <module>
      File "/flash/main.py", line 789, in <module>
      File "/flash/lib/OTA.py", line 69, in update
    Exception: Failed to download `http://<ota_server_address>:8000/1.0.4/boot.py`
    Pycom MicroPython 1.18.2 [v1.8.6-849-07a52e4] on 2019-02-08; FiPy with ESP32
    

    If I understand it correctly, this error indicates that the device’s filesystem probably are corrupt.
    I therefore tried to reformat the filesystem with os.mkfs('/flash'), but it didn’t help.

    Below is how the OTA update function is initiated and called:

    from OTA import LTEOTA
    import OTA
    from umqttsimple import MQTTClient
    import json
    import struct
    import socket
    import pycom
    import urequests
    from config import LTE_APN, OTA_SERVER_IP, OTA_SERVER_PORT
    from device_settings import MQTT_DEVICE_ID, MQTT_DEVICE_TOKEN, NOICE_WLAN_SSID, NOICE_WLAN_Password
    import ubinascii
    
    #Connect to LTE CAT-M1 network provider and MQTT broker
    connect_internet()
    client = connect_MQTT_Broker()
    client.set_callback(messageReceived)
    
    # Setup OTA
    ota = LTEOTA(lte=lte, apn=LTE_APN, ip=OTA_SERVER_IP, port=OTA_SERVER_PORT)
    ota.connect()
    ota.update()
    

    I can successfully download files from the OTA server from my PC’s browser, e.g. http://<ota_server_address>:8000/1.0.4/boot.py.

    Any suggestions to resolve this issue?.
    OTA functionality is a must-have feature for us, and we need to have it working ASAP, since we will be installing a large amount of devices in the near future.

    One thought: Could the Pybytes/Legacy firmware be a solution (OTA update from Pybytes, data communication to custom IoT platform (Thingsboard)?
    If so please point me in the right direction, I have not been able to find any documentation about the Pybytes/Legacy firmware yet. Please take a look at the attached file: OTA.py


Log in to reply
 

Pycom on Twitter