Cannot perform ota /update/revert and /update/commit

#1

If you are asking a question, please follow this template:

  1. My goal is: Performing the OTA Update
  2. My actions are: cannot do /update/revert and /update/commit
  3. The result I see is: I can able to update the device over OTA by using the http://IP_address/update
  4. My expectation & question is: I cannot perform the /update/revert or /update/commit

My code:

$("#previousFirmware").on("click", function () {
  $.ajax({
    url: "/update/revert",
    type: "POST",
    data: JSON.stringify({}),
    contentType: "application/json",
    success: function (response) {
      console.log("Rooling Back To Previous Firmware");
    }
  })
})

When I perform the above request, I get the error 400 BAD REQUEST

Can anyone please suggest to achieve this.

#2

I think you need

- origin: https://github.com/mongoose-os-libs/ota-http-server

in your mos.yml

#3

Thank you for prompt response,

The respective repository origin has added in mos.yml

#4

Here is my mos.yml file configuration part: Preformatted text

libs: