Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

Error -11 during OTA

Hi everybody,

when using the OTA Update functions im getting the following error response:

Error updating device 9a082c97c4d7d99b445a3765: {
"code": -11,
"message": "-11 Write failed"

I also tried it with mDash (Error Code above) and also over the mos tool with mos call OTA.Update '{"url": "http...."}' and with the ota-http-client library.

In the device log of the device I get the following error code:

What did the error code exactly mean?
Did anybody have an idea of what I'am making wrong?

Thank You and best regards


  • rojerrojer Dublin, Ireland

    hm. could it be that your flash is write protected? or too small? how big is it?

  • Hi Rojer,

    thany You for Your answer. I am using the Wroom 02 Board with a size of 2MB.

    But it is exactley the same firmware I flashed over uart without any Problems. When I upload the same .zip package and try the OTA Update I got this error.

    Thank You

  • If the flash is write protected, how could I see it or change it ? But then I shouldn't be able to flash it over uart but that's not a problem.

  • rojerrojer Dublin, Ireland
    edited December 2018

    in this case the problem is that you used firmware that expects a 4M or larger chip, so when you OTA it's trying to write at offset 0x200000 (2M) and understandably fails.
    OTA is supported on 2M chips but you need to specify 2M flash layout in your manifest:

      FLASH_SIZE: 2097152

    and you were able to flash it over serial because it was writing to the first 2M of the chip.

  • Hi Rojer, thank You for the tip. I tried it out, but unfortunatley it returns the same error.
    Here from the chip Log:

    Do You have any other ideas what I am doing wrong?

    Thank You

  • rojerrojer Dublin, Ireland

    the problem is still the same - firmware is built with wrong flash layout, since it thinks slot 1 is located at 0x200000. the setting didn't have the desired effect. post your mos.yml here.

  • edited December 2018
    author: mongoose-os
    description: A Mongoose OS app skeleton
    version: 1.0
    libs_version: ${mos.version}
    modules_version: ${mos.version}
    mongoose_os_version: ${mos.version}
      FLASH_SIZE: 2097152
      - c
      - src
      - fs
      - ["wifi.ap.enable", true]
      - ["dns_sd.enable", false]
      - ["wifi.ap.keep_enabled", false]
      - ["wifi.sta.connect_timeout", 20]  
      - ["mqtt.enable", true]
      - ["rpc.mqtt.sub_topic", "s", "%.*s/rpc", {title: "Topic to accept incoming frames on.Argumentto the format string is"}]
      - ["mqtt.sub", "s", "%.*s/rpc", {title: "Subscribe topic"}]
      - ["sys.tz_spec", "s", "CET-1CEST,M3.5.0,M10.5.0/3", {title: "See formats for the TZ env var: \"man tzset\". Formats like \":/path/to/file\" are not supported"}]
      - ["", 51.514244]   
      - ["device.location.lon", 7.468429]
      - ["app", "o", {title: "My app custom settings"}]
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
      - origin:
    manifest_version: 2017-09-29
  • I also tried it with the enterprise mos-libs, but it`s the same result.

  • The command when building the firmware is: mos build --platform esp8266 --buil-var FLASH_SIZE=2097152 --clean --local

  • rojerrojer Dublin, Ireland

    FLASH_SIZE: 2097152

    not sure if it's indented properly or not. in any case, check build/gen/mos_final.yml after build - is it present among the build_vars there?

  • Here the extract of mos_final:
    I think the flash size worked but the BOARD placeholder is empty. Must this one also be configured?

  • rojerrojer Dublin, Ireland

    ok, so a simple question: did you reflash the device since? because, you see, what matters is what the firmware already on the device thinks about the flash layout, not the firmware that is being applied.
    so, you will have to reflash the device once, and from then on OTA should work.

  • Hi Rojer,
    excuse my late response.
    Yes I've always reflashed the chip. I also erased it with esptool to be sure that it is empty before reflashing it with the new firmware.
    But unfortunatley there's still the same problem with OTA.

  • Hi, does anybody has an idea regarding to this probleme?

    How can I check, if the firmware is build and flashed with the correct layout for 2MB?

    Thanks in advance.

Sign In or Register to comment.