Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

OTA HTTP PUSH method not working

jstevewoodjstevewood California
edited August 2018 in Mongoose OS

I have an ESP-32 module set up as a wireless AP. It appears to be functioning completely properly except for OTA. I am trying to update the firmware with the following command and I receive the indicated responses:

C:\Mong\demo-jsmod>curl -v -F file=@build/fw.zip -F commit_timeout=60 http://192.168.4.1/update
*   Trying 192.168.4.1...
* TCP_NODELAY set
* Connected to 192.168.4.1 (192.168.4.1) port 80 (#0)
> POST /update HTTP/1.1
> Host: 192.168.4.1
> User-Agent: curl/7.55.1
> Accept: */*
> Content-Length: 1776077
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------fff1205114fc6cba
>
* Done waiting for 100-continue
< HTTP/1.1 200 OK
< Server: Mongoose/6.12
< Content-Type: text/plain
< Connection: close
<
Update applied, finalizing
* Closing connection 0

At this point, the ESP32 module reboots, and starts running the new, updated code for approximately 60 seconds (or whatever number of seconds that the commit_timeout variable is set to ). Then as follows:

[Aug 28 15:06:52.096] Now 1234567950.038277 Tick uptime: 61.918178 {"free_ram":56792,"total_ram":183780}
[Aug 28 15:06:52.100] mgos_upd_watchdog_cb Update commit timeout expired
[Aug 28 15:06:52.106] mgos_upd_boot_revert Reverting to slot 0

...and then system reboots and runs the old (prior to update) firmware.

It seems that the firmware update is actually being performed properly, but something else must be done to prevent a reversion to the prior firmware.

What is this extra step?

Thanks for your help,

JSW

Comments

  • jstevewoodjstevewood California

    I figured it out. You have to send:

    curl 192.168.4.1/rpc/OTA.Commit

    within the commit timeout. it's working now.

Sign In or Register to comment.