OTA update does not work

tsvetan.filevtsvetan.filev Sofia, Bulgaria
edited December 2016 in Mongoose Networking Library

Hi.

I tested OTA with c_hello example and got Wrong platform response.

Could you give it a try ?

Comments

  • Hi Tsvetan,

    What platform do you use?

  • tsvetan.filevtsvetan.filev Sofia, Bulgaria

    It happens on cc3200. It seems ESP works fine.

  • Confirmed. We'll write here once we fix it; thanks for the reporting.

  • Fixed in the master branch of https://github.com/cesanta/mongoose-iot , please try it.

    Thanks again for reporting.

  • tsvetan.filevtsvetan.filev Sofia, Bulgaria
    edited December 2016

    Hi.

    OTA now works fine,but I noticed two things.

    1) I get this message:

    make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
    make[1]: Leaving directory '/opt/mbedtls/library'
    

    during compilation, but I can compile successfully.
    What does it mean ?

    2) When I try to upload a FW for ESP for e.g. I get a "Wrong platform" response which is OK.
    But then when I try to upload a correct FW for cc3200 I get this message again and then the device reboots. Could you have a look as well ?

    Regards.

  • tsvetan.filevtsvetan.filev Sofia, Bulgaria

    Hi again.

    OTA works fine consider 2) as invalid.

    Thanks.

  • rojerrojer Dublin
    edited January 13

    (1) is benign, but i fixed it anyway (6aa74)

  • tsvetan.filevtsvetan.filev Sofia, Bulgaria
    edited January 13

    Hi.

    With the latest mongoose I get an error when trying to perform OTA several times.
    The first time it works fine but the second time I get "Failed to create file" as a HTTP result and the console log is:

    ...
    
    context_save_unprocessed Added 0 bytes to cached data
    handle_update_post   updater_process res: 0
    handle_update_post   MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048
    context_update       Added 2048, size: 2048
    updater_process_int  Skipping 2048 bytes, 191640 total
    context_remove_data  Consumed 2048, 0 left
    context_save_unprocessed Added 0 bytes to cached data
    handle_update_post   updater_process res: 0
    handle_update_post   MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048
    context_update       Added 2048, size: 2048
    updater_process_int  Skipping 2048 bytes, 193688 total
    context_remove_data  Consumed 2048, 0 left
    context_save_unprocessed Added 0 bytes to cached data
    handle_update_post   updater_process res: 0
    handle_update_post   MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048
    context_update       Added 2048, size: 2048
    updater_process_int  Skipping 172 bytes, 193860 total
    context_remove_data  Consumed 172, 1876 left
    updater_set_status   Update status 5 -> 6
    updater_process_int  Has descriptor : 0
    updater_set_status   Update status 6 -> 3
    context_save_unprocessed Added 1876 bytes to cached data
    parse_zip_file_header Filename len = 26 bytes, extras len = 0 bytes
    parse_zip_file_header Compression method=0
    parse_zip_file_header File name: dinrelay-2017011309/fs.img
    parse_zip_file_header File name to use: fs.img
    parse_zip_file_header File size: 98368
    parse_zip_file_header General flag=0
    parse_zip_file_header CRC32: 0x0d118abc
    context_remove_data  Consumed 56, 1820 left
    prepare_to_write     Storing fs.img 98368 -> spiffs.img.1.0 98368 (97dba5afa6a1bce2f1925e5fee9e5bcd5d1376c5)
    mgos_upd_file_begin  err = -64
    updater_set_status   Update status 3 -> 9
    updater_finish       Update finished: -1 Failed to create file, mem free 28504
    context_remove_data  Consumed 1820, 0 left
    handle_update_post   updater_process res: -1
    handle_update_post   MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048
    handle_update_post   MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048
    ...
    
    handle_update_post   MG_EV_HTTP_MULTIPART_REQUEST_END: 20036928 0
    

    Do you have any idea what is wrong ?

    With the web config example I don't have this issue.

  • tsvetan.filevtsvetan.filev Sofia, Bulgaria
    edited January 13

    P.S. I tested with another project of ours and OTA works fine. So there must be something with the size of the FW.

    The working FW zip contents:

    -rw-r--r-- 1 ceco users    781 Jan 13 13:14 cert.der
    -rw-r--r-- 1 ceco users  98368 Jan 13 13:14 fs.img
    -rw------- 1 ceco users   2105 Jan 13 13:14 manifest.json
    -rw-r--r-- 1 ceco users  10868 Jan 13 13:14 mg-boot.bin
    -rw-r--r-- 1 ceco users    512 Jan 13 13:14 mg-boot.cfg.0
    -rw-r--r-- 1 ceco users    512 Jan 13 13:14 mg-boot.cfg.1
    -rw-r--r-- 1 ceco users  28236 Jan 13 13:14 ota_1.0.1.6-2.7.0.0.ucf
    -rw-r--r-- 1 ceco users    256 Jan 13 13:14 ota_1.0.1.6-2.7.0.0.ucf.sign
    -rw-r--r-- 1 ceco users 166753 Jan 13 13:14 smart-sensor.bin
    

    The problematic FW zip contents:

    -rw-r--r-- 1 ceco users    781 Jan 13 13:21 cert.der
    -rw-r--r-- 1 ceco users 193860 Jan 13 13:21 dinrelay.bin
    -rw-r--r-- 1 ceco users  98368 Jan 13 13:21 fs.img
    -rw-r--r-- 1 ceco users    846 Jan 13 13:21 hwinfo_struct_defaults.json
    -rw------- 1 ceco users   2284 Jan 13 13:21 manifest.json
    -rw-r--r-- 1 ceco users  10868 Jan 13 13:21 mg-boot.bin
    -rw-r--r-- 1 ceco users    512 Jan 13 13:21 mg-boot.cfg.0
    -rw-r--r-- 1 ceco users    512 Jan 13 13:21 mg-boot.cfg.1
    -rw-r--r-- 1 ceco users  28236 Jan 13 13:21 ota_1.0.1.6-2.7.0.0.ucf
    -rw-r--r-- 1 ceco users    256 Jan 13 13:21 ota_1.0.1.6-2.7.0.0.ucf.sign
    
  • rojerrojer Dublin

    hm. no, the size should not be an issue. can you show the beginning of the log for the failing update? in the fragment you posted it already says "skipping", so it decided to skip the file, but before that it should say why.

  • tsvetan.filevtsvetan.filev Sofia, Bulgaria

    Here is the beginning. It happens on the second try. The first try is OK.


    mongoose_ev_handler 20036760 HTTP connection from 192.168.33.2:41612 updater_context_create Starting update (timeout 300) handle_update_post MG_EV_HTTP_PART_BEGIN: 20036928 upgrade_file dinrelay-cc3200-last.zip handle_update_post MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 332 context_update Added 332, size: 332 updater_set_status Update status 0 -> 1 parse_zip_file_header Filename len = 33 bytes, extras len = 0 bytes parse_zip_file_header Compression method=0 parse_zip_file_header File name: dinrelay-2017011607/manifest.json parse_zip_file_header File name to use: manifest.json parse_zip_file_header File size: 2284 parse_zip_file_header General flag=0 parse_zip_file_header CRC32: 0xc085f3a4 context_remove_data Consumed 63, 269 left updater_set_status Update status 1 -> 2 context_save_unprocessed Added 269 bytes to cached data handle_update_post updater_process res: 0 handle_update_post MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048 context_update Added 2048, size: 2317 parse_manifest FW: dinrelay cc3200 2017011607 20170116-071749/181-bump-to-mongoose-6954955@d430502b+ -> 2017011607 20170116-071749/181-bump-to-mongoose-6954955@d430502b+ context_remove_data Consumed 2284, 33 left updater_set_status Update status 2 -> 3 parse_zip_file_header Filename len = 28 bytes, extras len = 0 bytes handle_update_post updater_process res: 0 mongoose_poll New heap free LWM: 28528 mongoose_poll New heap free LWM: 27496 handle_update_post MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048 context_update Added 2048, size: 2081 parse_zip_file_header Filename len = 28 bytes, extras len = 0 bytes parse_zip_file_header Compression method=0 parse_zip_file_header File name: dinrelay-2017011607/cert.der parse_zip_file_header File name to use: cert.der parse_zip_file_header File size: 781 parse_zip_file_header General flag=0 parse_zip_file_header CRC32: 0xf25200ef context_remove_data Consumed 58, 2023 left updater_set_status Update status 3 -> 5 updater_process_int Skipping 781 bytes, 781 total context_remove_data Consumed 781, 1242 left updater_set_status Update status 5 -> 6 updater_process_int Has descriptor : 0 updater_set_status Update status 6 -> 3 parse_zip_file_header Filename len = 32 bytes, extras len = 0 bytes parse_zip_file_header Compression method=0 parse_zip_file_header File name: dinrelay-2017011607/dinrelay.bin parse_zip_file_header File name to use: dinrelay.bin parse_zip_file_header File size: 193860 parse_zip_file_header General flag=0 parse_zip_file_header CRC32: 0x8fc14c48 context_remove_data Consumed 62, 1180 left prepare_to_write Digest matched for dinrelay.bin.1 193860 (c2551427b039c06c9a9483c7c1d1a3adb9cf531f) updater_set_status Update status 3 -> 5 updater_process_int Skipping 1180 bytes, 1180 total context_remove_data Consumed 1180, 0 left context_save_unprocessed Added 0 bytes to cached data handle_update_post updater_process res: 0 mongoose_poll New heap free LWM: 27392 handle_update_post MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048 context_update Added 2048, size: 2048 updater_process_int Skipping 2048 bytes, 3228 total context_remove_data Consumed 2048, 0 left context_save_unprocessed Added 0 bytes to cached data handle_update_post updater_process res: 0 handle_update_post MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048 context_update Added 2048, size: 2048 updater_process_int Skipping 2048 bytes, 5276 total context_remove_data Consumed 2048, 0 left context_save_unprocessed Added 0 bytes to cached data handle_update_post updater_process res: 0 handle_update_post MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048 context_update Added 2048, size: 2048 updater_process_int Skipping 2048 bytes, 7324 total context_remove_data Consumed 2048, 0 left context_save_unprocessed Added 0 bytes to cached data handle_update_post updater_process res: 0 handle_update_post MG_EV_HTTP_PART_DATA: 20036928 upgrade_file dinrelay-cc3200-last.zip 2048 context_update Added 2048, size: 2048 updater_process_int Skipping 2048 bytes, 9372 total context_remove_data Consumed 2048, 0 left ...
Sign In or Register to comment.