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

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.

I think you need

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

in your mos.yml

Thank you for prompt response,

The respective repository origin has added in mos.yml

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

libs:

Hi and the good day!

I have the same problem, /update/commit returns 400 bad request.
The /update call works fine, the firmware is updated but committed automatically.

Does anyone know why this is happening? I would like to commit manually.