Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

How to do the OTA update on the new dashboard?

  • Is ota-shadow library now REQUIRED? (It wasn't necessary with the older version of the dashboard)
  • Is AWS IoT REQUIRED? (I'm using GCP and not importing "aws" library which conflicts with "gcp" library)
  • I get "Invalid content-length, perhaps chunked-encoding" on reported.ota.message when I try to do the OTA update on the new dashboard. What does that mean? I only changed a boolean flag on config1.json on the uploaded firmware.

Comments

  • I'm using the latest mos version on Mac

    The Mongoose OS command line tool
    Version: latest
    Build ID: 20171226-161209/master@2bfb56d3+
    Update channel: latest

  • SergeySergey Dublin, Ireland

    both these libraries are not required.
    Could you elaborate on your problem ? please follow https://forum.mongoose-os.com/discussion/1464/how-to-ask-questions#latest

  • @Sergey

    I have switched my mos back to release channel. I'm now on 1.23.

    Describe your goal

    • Update firmware using the functionality on dash.mongoose-os.com

    Describe what you do to achieve the goal - show code, show command, etc

    1. Git cloned empty app and modified like this: https://github.com/its-iot-system/empty/commit/14f11f0d4aed6e863a2828ec147066a1e9ef6c80
      *fs_secret/ contains wifi pass and dash token

    2. Flashed the device and checked on the dashboard

    3. Changed init.js like this: https://github.com/its-iot-system/empty/commit/df4035aef4c79f04a7f8919d07195abcf201cc96

    4. Uploaded the fm.zip (filename changed to fm_AFTER.zip) to the dashboard, initiated an OTA update (by selecting the device, selecting fm_AFTER.zip from the dropdown, and hitting "Start OTA Update" button)

    Describe the result you expect

    • Can see "==== this is AFTER the OTA ====" on the console on the dashboard

    Describe the result you see - show logs, output, observed behavior

    • Device console is still outputting "==== this is BEFORE the OTA ===="
    • Below is what I got on the "Shadow" on the device list. Nothing happens after this.
    {
      "desired": {
        "ota": {
          "url": "https://dash.mongoose-os.com/api/v1/ota/github_its-iot-system/fw_AFTER.zip"
        }
      },
      "reported": {
        "online": true,
        "stats": {
          "ram_free": 205160,
          "ram_lwm": 187140,
          "ram_total": 294132
        }
      },
      "delta": {
        "ota": {
          "url": "https://dash.mongoose-os.com/api/v1/ota/github_its-iot-system/fw_AFTER.zip"
        }
      }
    }
    

    I posted the original question about libs required because I found the below statement on https://mongoose-os.com/docs/reference/dashboard.html under the section "OTA firmware update".

    The ota-shadow library catches the shadow event and triggers on OTA.

    This is why I was wondering if I need to include any other lib to do the OTA update on the new dashboard.
    I got the "Invalid content-length, perhaps chunked-encoding" error message when I included ota-shadow, but if it's not required, I will just forget about this error for now.

  • SergeySergey Dublin, Ireland

    That's correct, ota-shadow library catches such shadow update - that works as intended.
    I think the update did not happen, as there is no firmware information in the "ota" section.

    Thanked by 1weizenbock
  • That's correct, ota-shadow library catches such shadow update

    Let me confirm this because I'm a bit confused as you mentioned "ota-shadow is not required" before.
    Are you saying that ota-shadow takes care of the ota, but it is included in the os and we don't need to explicitly include it in mos.yml?

    I think the update did not happen, as there is no firmware information in the "ota" section.

    I did what I described as "Uploaded the fm.zip (filename changed to fm_AFTER.zip) to the dashboard, initiated an OTA update (by selecting the device, selecting fm_AFTER.zip from the dropdown, and hitting "Start OTA Update" button)"
    Am I supposed to do anything else? Like manually manipulating the shadow section somehow?

  • SergeySergey Dublin, Ireland
    1. In order to do the OTA via the dashboard, the dash library in sufficient.
    2. Pressing on the button should have changed your "desired" section in the shadow, pointing to the URI. Please include screenshot or animated gif of what is happening when you press a button.
  • sh4nnongohsh4nnongoh Singapore
    edited January 10

    Same issue here.

    The desired state reflected the change upon clicking the OTA button.
    The delta state reflected the change as well.
    But nothing happens.

    The only way to update is to send a RPC to the device to pull the update.

Sign In or Register to comment.