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.

Commit by using curl returns Error

ulsoulso Stockholm

I wonder why I get an "Error" response after issuing the following commit command:
curl http://192.168.2.115/update/commit
Previously I received the expected "Ok" response.
It still seems to work ok though.

Comments

  • rojerrojer Dublin, Ireland

    which arch do you use?

  • ulsoulso Stockholm

    CC3200

  • rojerrojer Dublin, Ireland

    tested OTA with delayed commit and it works fine for me:

    [rojer@nbmbp ~/go/src/cesanta.com/fw/examples/c_hello mos6]$ curl -v -F file=@build/fw.zip -F commit_timeout=120 http://192.168.11.8/update
    *   Trying 192.168.11.8...
    * Connected to 192.168.11.8 (192.168.11.8) port 80 (#0)
    > POST /update HTTP/1.1
    > Host: 192.168.11.8
    > User-Agent: curl/7.47.0
    > Accept: */*
    > Content-Length: 324255
    > Expect: 100-continue
    > Content-Type: multipart/form-data; boundary=------------------------ba154300b1b08e44
    > 
    * Done waiting for 100-continue
    < HTTP/1.1 200 OK
    < Server: Mongoose/6.7
    < Content-Type: text/plain
    < Connection: close
    < 
    Update applied, finalizing
    * Closing connection 0
    [rojer@nbmbp ~/go/src/cesanta.com/fw/examples/c_hello mos6]$ curl -v http://192.168.11.8/update/commit                                                                                                                                                        
    *   Trying 192.168.11.8...
    * Connected to 192.168.11.8 (192.168.11.8) port 80 (#0)
    > GET /update/commit HTTP/1.1
    > Host: 192.168.11.8
    > User-Agent: curl/7.47.0
    > Accept: */*
    > 
    < HTTP/1.1 200 OK
    < Server: Mongoose/6.7
    < Content-Type: text/html
    < Connection: close
    < 
    Ok
    * Closing connection 0
    

    btw, commit will return "Error" if there is nothing to commit, i.e. if update was done without delayed commit.
    double check that you actually specify commit_timeout. if yes, then i'll need a console log at debug.level=3 to tell what's going on.

  • ulsoulso Stockholm

    Don't know how/where to set the debug level. Until then, I just rebuilt the firmware and tried to update and commit and got the following responses.
    `* Trying 192.168.2.115...
    * TCP_NODELAY set
    * Connected to 192.168.2.115 (192.168.2.115) port 80 (#0)

    POST /update HTTP/1.1
    Host: 192.168.2.115
    User-Agent: curl/7.51.0
    Accept: /
    Content-Length: 324155
    Expect: 100-continue
    Content-Type: multipart/form-data; boundary=------------------------8db9b864f99fbff5

    * Done waiting for 100-continue
    < HTTP/1.1 200 OK
    < Server: Mongoose/6.7
    < Content-Type: text/plain
    < Connection: close
    <
    Update applied, finalizing
    * Curl_http_done: called premature == 0
    * Closing connection 0
    And...* Trying 192.168.2.115...
    * TCP_NODELAY set
    * Connected to 192.168.2.115 (192.168.2.115) port 80 (#0)

    GET /update/commit HTTP/1.1
    Host: 192.168.2.115
    User-Agent: curl/7.51.0
    Accept: /

    < HTTP/1.1 400 Bad Request
    < Server: Mongoose/6.7
    < Content-Type: text/html
    < Connection: close
    <
    Error
    * Curl_http_done: called premature == 0
    * Closing connection 0
    `

  • rojerrojer Dublin, Ireland

    still not clear if commit_timeout is present in this first request.

  • ulsoulso Stockholm

    This is my call to update:
    curl -v -F file=@build/fw.zip -F commit_timeout=300 http://192.168.2.115/update

  • rojerrojer Dublin, Ireland

    ok, can you post results of mos call --port ws://192.168.2.115/rpc Sys.GetBootState before update, after update but before commit and after commit?

  • ulsoulso Stockholm

    Ok. This is what I got.
    Error: remote error: No handler for Sys.GetBootState

  • ulsoulso Stockholm

    Just to be sure I have the latest version of everything, I did a mos update followed by a rebuild of the fw and then a mos flash. I still got the same Error message.

  • rojerrojer Dublin, Ireland

    sorry - OTA.GetBootState

  • ulsoulso Stockholm

    Yeah, that's what I thought :)

    Now here's the responses you asked for:

    usmbp3:mygw ulf$ mos call --port ws://192.168.2.115/rpc OTA.GetBootState
    {
      "active_slot": 0,
      "is_committed": true,
      "revert_slot": 1,
      "commit_timeout": 0
    }
    
    usmbp3:mygw ulf$ ./update.sh 192.168.2.115
    Updates firmware on 192.168.2.115 ...
    *   Trying 192.168.2.115...
    * TCP_NODELAY set
    * Connected to 192.168.2.115 (192.168.2.115) port 80 (#0)
    > POST /update HTTP/1.1
    > Host: 192.168.2.115
    > User-Agent: curl/7.51.0
    > Accept: */*
    > Content-Length: 324155
    > Expect: 100-continue
    > Content-Type: multipart/form-data; boundary=------------------------0a63f98ebe239d89
    > 
    * Done waiting for 100-continue
    < HTTP/1.1 200 OK
    < Server: Mongoose/6.7
    < Content-Type: text/plain
    < Connection: close
    < 
    Update applied, finalizing
    * Curl_http_done: called premature == 0
    * Closing connection 0
    
    usmbp3:mygw ulf$ mos call --port ws://192.168.2.115/rpc OTA.GetBootState
    {
      "active_slot": 1,
      "is_committed": true,
      "revert_slot": 0,
      "commit_timeout": 0
    }
    
    usmbp3:mygw ulf$ ./commit.sh 192.168.2.115
    Commits firmware on 192.168.2.115 ...
    *   Trying 192.168.2.115...
    * TCP_NODELAY set
    * Connected to 192.168.2.115 (192.168.2.115) port 80 (#0)
    > GET /update/commit HTTP/1.1
    > Host: 192.168.2.115
    > User-Agent: curl/7.51.0
    > Accept: */*
    > 
    < HTTP/1.1 400 Bad Request
    < Server: Mongoose/6.7
    < Content-Type: text/html
    < Connection: close
    < 
    Error
    * Curl_http_done: called premature == 0
    * Closing connection 0
    
    usmbp3:mygw ulf$ mos call --port ws://192.168.2.115/rpc OTA.GetBootState
    {
      "active_slot": 1,
      "is_committed": true,
      "revert_slot": 0,
      "commit_timeout": 0
    }
    
    usmbp3:mygw ulf$ mos call --port ws://192.168.2.115/rpc OTA.Commit
    Error: remote error: Простите великодушно
    
  • ulsoulso Stockholm

    Looks like maybe the commit_timeout=300 argument isn't recognized?

  • rojerrojer Dublin, Ireland

    yes, it's committed right away, with no timeout. but it works for me just fine!
    well, i need logs from the device. attach serial console, mos config-set debug.level=3 and post the log.
    if the device is remote, you can configure udp log.

  • ulsoulso Stockholm

    Now it suddenly worked. Don't know why. Haven't changed anything else.

  • rojerrojer Dublin, Ireland

    ok, i have a guess. try moving -F commit_timeout=300 in front of -F file, let me know if that makes it work all the time.

  • ulsoulso Stockholm

    Ok. I reflashed the fw to get the debug level back to normal. Then I performed the update/commit procedure. First time failed but not the rest of a few tries.

  • rojerrojer Dublin, Ireland

    with -F commit_timeout=300 before -F file=...? ok, i'm out of ideas. i need logs at level 3.

  • ulsoulso Stockholm

    Ok. So here are some logs.

    usmbp3:mygw ulf$ mos call --port ws://192.168.2.115/rpc OTA.GetBootState
    {
      "active_slot": 0,
      "is_committed": true,
      "revert_slot": 1,
      "commit_timeout": 0
    }
    usmbp3:mygw ulf$ ./update.sh 192.168.2.115
    Updates firmware on 192.168.2.115 ...
    *   Trying 192.168.2.115...
    * TCP_NODELAY set
    * Connected to 192.168.2.115 (192.168.2.115) port 80 (#0)
    > POST /update HTTP/1.1
    > Host: 192.168.2.115
    > User-Agent: curl/7.51.0
    > Accept: */*
    > Content-Length: 324171
    > Expect: 100-continue
    > Content-Type: multipart/form-data; boundary=------------------------2901a8904eb1446f
    > 
    * Done waiting for 100-continue
    < HTTP/1.1 200 OK
    < Server: Mongoose/6.7
    < Content-Type: text/plain
    < Connection: close
    < 
    Update applied, finalizing
    * Curl_http_done: called premature == 0
    * Closing connection 0
    usmbp3:mygw ulf$ mos call --port ws://192.168.2.115/rpc OTA.GetBootState
    {
      "active_slot": 1,
      "is_committed": true,
      "revert_slot": 0,
      "commit_timeout": 0
    }
    

    And from the device log in the web ui.

    cc3200_init          mygw 1.0 (20170617-161736/???)
    cc3200_init          Mongoose OS Firmware 2017061716 (20170617-161736/???)
    cc3200_init          RAM: 80180 total, 66572 free
    start_nwp            NWP v2.8.0.0 started, host driver v1.0.1.11
    cc3200_init          Boot cfg 0: 0xfffffffffffffffa, 0x0, mygw.bin.0 @ 0x20000000, spiffs.img.0
    mgos_vfs_dev_init    slfs_container ({"prefix": "spiffs.img.0"}) -> 2002fac4
    cc3200_vfs_dev_slfs_ 2002fac4 spiffs.img.0.0 98304 0xfffffffffffffffe
    mgos_vfs_mount       Mount SPIFFS @ / (dev 2002fac4, opts ) -> 2003014c
    mgos_vfs_mount       /: size 83081, used: 19578, free: 63503
    mgos_vfs_mount       Mount SLFS @ /slfs (dev 0, opts ) -> 200305a4
    mgos_vfs_mount       /slfs: size 0, used: 0, free: 0
    mgos_sys_config_init MAC: D0B5C2E271A6
    mgos_sys_config_init WDT: 30 seconds
    mgos_wifi_connect    Connecting to usap
    mgos_i2c_create      I2C initialized (SDA: 17, SCL: 16, freq 100000)
    mgos_sys_config_init HTTP server started on [80]
    mg_rpc_channel_mqtt  200309c4 cc3200_E271A6/rpc/#
    mg_rpc_channel_uart  20030d34 UART0
    mgos_init            Init done, RAM: 80180 total, 61392 free, 60576 min free
    mg_rpc_channel_uart_ 20030d34 Corrupted frame (56): '""{"src":"mos","id":1551637901037,"method":"Config.Get"}' '3167827e' 3167827e 37310aa0
    mgos_wifi_on_change_ Wifi: connected
    wifi_cb              WiFi change event: 1, arg 0
    mgos_wifi_on_change_ WiFi: ready, IP 192.168.2.115, DNS 192.168.2.1
    wifi_cb              WiFi change event: 2, arg 0
    mgos_sntp_query      SNTP query to pool.ntp.org
    mongoose_poll        New heap free LWM: 60056
    mongoose_poll        New heap free LWM: 57928
    mongoose_poll        New heap free LWM: 56536
    mgos_sntp_ev         SNTP reply from 192.36.143.130: time 1497879292.709402, local 1497879292.424000, delta 0.285402
    mgos_http_ev         20030dec HTTP connection from 192.168.2.100:55773
    mg_rpc_ws_handler    20030ed4 CLOSED
    mgos_http_ev         20030dec HTTP connection from 192.168.2.100:55775
    updater_context_crea Starting update (timeout 300)
    parse_manifest       FW: mygw cc3200 1.0 20170617-161736/??? -> 1.0 20170619-133259/???
    cc3200_vfs_dev_slfs_ Deleting spiffs.img.1.1
    prepare_to_write     Storing fs.img 98368 -> spiffs.img.1.0 98368 (199ff337723b6022a670028a4b624f77b7767e8a)
    mongoose_poll        New heap free LWM: 52824
    mongoose_poll        New heap free LWM: 51912
    verify_checksum      spiffs.img.1.0: have 199ff337723b6022a670028a4b624f77b7767e8a, want 199ff337723b6022a670028a4b624f77b7767e8a
    prepare_to_write     Storing mygw.bin 180349 -> mygw.bin.1 241664 (ab3eae8866ebfe9be07aa5205b8b2b66e132004c)
    verify_checksum      mygw.bin.1: have ab3eae8866ebfe9be07aa5205b8b2b66e132004c, want ab3eae8866ebfe9be07aa5205b8b2b66e132004c
    updater_process_int  Update requires commit, timeout: 300
    mgos_upd_finalize    Boot cfg 0: 0xfffffffffffffffa, 0x0, mygw.bin.0 @ 0x20000000, spiffs.img.0
    mgos_upd_finalize    Boot cfg 1: 0xfffffffffffffff9, 0x3, mygw.bin.1 @ 0x20000000, spiffs.img.1
    updater_finish       Finished: 1 Update applied, finalizing
    handle_update_post   Rebooting device
    mgos_system_restart_ Rebooting in 101 ms
    mongoose_poll        New heap free LWM: 51816
    mgos_vfs_umount_all  Unmounting filesystems
    mgos_vfs_dev_close   2002fac4 refs 0
    
    
    S1mygw.bin.1@20000000+180349+.20028271
    
    cc3200_init          mygw 1.0 (20170619-133259/???)
    cc3200_init          Mongoose OS Firmware 2017061913 (20170619-133259/???)
    cc3200_init          RAM: 80164 total, 66556 free
    start_nwp            NWP v2.8.0.0 started, host driver v1.0.1.11
    cc3200_init          Boot cfg 1: 0xfffffffffffffff9, 0x3, mygw.bin.1 @ 0x20000000, spiffs.img.1
    mgos_vfs_dev_open    slfs_container ({"prefix": "spiffs.img.1"}) -> 2002fad4
    cc3200_vfs_dev_slfs_ 2002fad4 spiffs.img.1.0 98304 0xfffffffffffffffe
    mgos_vfs_mount       Mount SPIFFS @ / (dev 2002fad4, opts ) -> 2003015c
    mgos_vfs_mount       /: size 83081, used: 18825, free: 64256
    mgos_vfs_mount       Mount SLFS @ /slfs (dev 0, opts ) -> 200305b4
    mgos_vfs_mount       /slfs: size 0, used: 0, free: 0
    cc3200_vfs_dev_slfs_ Deleting spiffs.img.0.1
    cc3200_init          Applying update
    mgos_vfs_dev_open    slfs_container ({"prefix": "spiffs.img.0"}) -> 200305f4
    cc3200_vfs_dev_slfs_ 200305f4 spiffs.img.0.0 98304 0xfffffffffffffffe
    mgos_vfs_mount       Mount SPIFFS @ /old (dev 200305f4, opts ) -> 20030604
    mgos_vfs_mount       /old: size 83081, used: 19578, free: 63503
    file_copy            Copying conf9.json
    mgos_vfs_dev_close   200305f4 refs 0
    mgos_vfs_umount      /old 20030604 1
    mgos_sys_config_init MAC: D0B5C2E271A6
    mgos_sys_config_init WDT: 30 seconds
    mgos_wifi_connect    Connecting to usap
    mgos_i2c_create      I2C initialized (SDA: 17, SCL: 16, freq 100000)
    mgos_sys_config_init HTTP server started on [80]
    mg_rpc_channel_mqtt  20030b14 cc3200_E271A6/rpc/#
    mg_rpc_channel_uart  20030e84 UART0
    mgos_init            Init done, RAM: 80164 total, 61364 free, 60504 min free
    mgos_upd_commit      Committing update
    mgos_upd_boot_commit Committed cfg 1, seq 0xfffffffffffffff9
    mgos_wifi_on_change_ Wifi: connected
    wifi_cb              WiFi change event: 1, arg 0
    mgos_wifi_on_change_ WiFi: ready, IP 192.168.2.115, DNS 192.168.2.1
    wifi_cb              WiFi change event: 2, arg 0
    mgos_sntp_query      SNTP query to pool.ntp.org
    mongoose_poll        New heap free LWM: 60024
    mongoose_poll        New heap free LWM: 57896
    mongoose_poll        New heap free LWM: 56504
    mgos_sntp_ev         SNTP reply from 158.69.125.231: time 1497879563.678714, local 1497879563.587000, delta 0.091714
    mgos_http_ev         20030f3c HTTP connection from 192.168.2.100:55778
    mg_rpc_ws_handler    2003142c CLOSED
    
  • rojerrojer Dublin, Ireland

    hm, i see. update.dat, which holds the update settings, was not copied for some reason. i'll have a closer look later.

  • rojerrojer Dublin, Ireland

    can you raise debug.level to 3 and repeat?

  • ulsoulso Stockholm

    Looks to me like the same result.

    usmbp3:mygw ulf$ mos call --port ws://192.168.2.115/rpc OTA.GetBootState
    {
      "active_slot": 0,
      "is_committed": true,
      "revert_slot": 1,
      "commit_timeout": 0
    }
    usmbp3:mygw ulf$ ./update.sh 192.168.2.115
    Updates firmware on 192.168.2.115 ...
    *   Trying 192.168.2.115...
    * TCP_NODELAY set
    * Connected to 192.168.2.115 (192.168.2.115) port 80 (#0)
    > POST /update HTTP/1.1
    > Host: 192.168.2.115
    > User-Agent: curl/7.51.0
    > Accept: */*
    > Content-Length: 324203
    > Expect: 100-continue
    > Content-Type: multipart/form-data; boundary=------------------------247f87d80c6ff6f2
    > 
    * Done waiting for 100-continue
    < HTTP/1.1 200 OK
    < Server: Mongoose/6.7
    < Content-Type: text/plain
    < Connection: close
    < 
    Update applied, finalizing
    * Curl_http_done: called premature == 0
    * Closing connection 0
    usmbp3:mygw ulf$ mos call --port ws://192.168.2.115/rpc OTA.GetBootState
    {
      "active_slot": 1,
      "is_committed": true,
      "revert_slot": 0,
      "commit_timeout": 0
    }
    

    And the log with debug.level=3

    mgos_http_ev         20030e1c HTTP connection from 192.168.2.100:61555
    mg_rpc_ws_handler    20030f04 CLOSED
    mgos_http_ev         20030e1c HTTP connection from 192.168.2.100:61579
    updater_context_crea Starting update (timeout 300)
    parse_manifest       FW: mygw cc3200 1.0 20170619-171523/??? -> 1.0 20170619-214535/???
    prepare_to_write     Storing fs.img 98368 -> spiffs.img.1.0 98368 (199ff337723b6022a670028a4b624f77b7767e8a)
    mongoose_poll        New heap free LWM: 52776
    mongoose_poll        New heap free LWM: 51864
    verify_checksum      spiffs.img.1.0: have 199ff337723b6022a670028a4b624f77b7767e8a, want 199ff337723b6022a670028a4b624f77b7767e8a
    prepare_to_write     Storing mygw.bin 180381 -> mygw.bin.1 241664 (74b7f3175b8f27ad5b17500d5771b804cc77aa5d)
    verify_checksum      mygw.bin.1: have 74b7f3175b8f27ad5b17500d5771b804cc77aa5d, want 74b7f3175b8f27ad5b17500d5771b804cc77aa5d
    updater_process_int  Update requires commit, timeout: 300
    mgos_upd_finalize    Boot cfg 0: 0xfffffffffffffffe, 0x0, mygw.bin.0 @ 0x20000000, spiffs.img.0
    mgos_upd_finalize    Boot cfg 1: 0xfffffffffffffffd, 0x3, mygw.bin.1 @ 0x20000000, spiffs.img.1
    updater_finish       Finished: 1 Update applied, finalizing
    handle_update_post   Rebooting device
    mgos_system_restart_ Rebooting in 101 ms
    mongoose_poll        New heap free LWM: 51768
    mgos_vfs_umount_all  Unmounting filesystems
    mgos_vfs_dev_close   2002faf4 refs 0
    
    
    S1mygw.bin.1@20000000+180381+.2002828d
    
    cc3200_init          mygw 1.0 (20170619-214535/???)
    cc3200_init          Mongoose OS Firmware 2017061921 (20170619-214535/???)
    cc3200_init          RAM: 80132 total, 66524 free
    start_nwp            NWP v2.8.0.0 started, host driver v1.0.1.11
    cc3200_init          Boot cfg 1: 0xfffffffffffffffd, 0x3, mygw.bin.1 @ 0x20000000, spiffs.img.1
    mgos_vfs_dev_open    slfs_container ({"prefix": "spiffs.img.1"}) -> 2002faf4
    cc3200_vfs_dev_slfs_ 2002faf4 spiffs.img.1.0 98304 0xfffffffffffffffe
    mgos_vfs_mount       Mount SPIFFS @ / (dev 2002faf4, opts ) -> 2003017c
    mgos_vfs_mount       /: size 83081, used: 18825, free: 64256
    mgos_vfs_mount       Mount SLFS @ /slfs (dev 0, opts ) -> 200305d4
    mgos_vfs_mount       /slfs: size 0, used: 0, free: 0
    cc3200_vfs_dev_slfs_ Deleting spiffs.img.0.0
    cc3200_init          Applying update
    mgos_vfs_dev_open    slfs_container ({"prefix": "spiffs.img.0"}) -> 20030614
    cc3200_vfs_dev_slfs_ 20030614 spiffs.img.0.1 98304 0xfffffffffffffffe
    mgos_vfs_mount       Mount SPIFFS @ /old (dev 20030614, opts ) -> 20030624
    mgos_vfs_mount       /old: size 83081, used: 19578, free: 63503
    file_copy            Copying conf9.json
    mgos_vfs_dev_close   20030614 refs 0
    mgos_vfs_umount      /old 20030624 1
    mgos_sys_config_init MAC: D0B5C2E271A6
    mgos_sys_config_init WDT: 30 seconds
    mgos_wifi_connect    Connecting to usap
    mgos_i2c_create      I2C initialized (SDA: 17, SCL: 16, freq 100000)
    mgos_sys_config_init HTTP server started on [80]
    mg_rpc_channel_mqtt  20030b34 cc3200_E271A6/rpc/#
    mg_rpc_channel_uart  20030ea4 UART0
    mgos_init            Init done, RAM: 80132 total, 61332 free, 60472 min free
    mgos_upd_commit      Committing update
    mgos_upd_boot_commit Committed cfg 1, seq 0xfffffffffffffffd
    mgos_wifi_on_change_ Wifi: connected
    wifi_cb              WiFi change event: 1, arg 0
    mgos_wifi_on_change_ WiFi: ready, IP 192.168.2.115, DNS 192.168.2.1
    wifi_cb              WiFi change event: 2, arg 0
    mgos_sntp_query      SNTP query to pool.ntp.org
    mongoose_poll        New heap free LWM: 59992
    mongoose_poll        New heap free LWM: 57864
    mongoose_poll        New heap free LWM: 56472
    mgos_sntp_ev         SNTP reply from 193.11.114.43: time 1497908802.383868, local 1497908801.847000, delta 0.536868
    mgos_http_ev         20030f5c HTTP connection from 192.168.2.100:61583
    mg_rpc_ws_handler    2003144c CLOSED
    
  • rojerrojer Dublin, Ireland

    hm, there should be more filesystem-related output

  • ulsoulso Stockholm

    I made a test script test.sh containing this:

    #!/bin/sh
    
    echo "Test firmware update/commit with debug.level=3 ..."
    # Set debug level.
    mos call --port ws://$1/rpc Config.Set '{ "debug.level" : 3}'
    # Get boot state before update.
    mos call --port ws://$1/rpc OTA.GetBootState
    # Perform the update.
    curl -v -F file=@build/fw.zip -F commit_timeout=300 http://$1/update
    # Give it 10 seconds to reboot.
    sleep 10
    # Get boot state after update, before commit.
    mos call --port ws://$1/rpc OTA.GetBootState
    # Set deug level again
    mos call --port ws://$1/rpc Config.Set '{ "debug.level" : 3}'
    # Perform the commit.
    curl -v http://$1/update/commit
    # Get boot state after commit.
    mos call --port ws://$1/rpc OTA.GetBootState
    

    The output from the above script is:

    usmbp3:mygw ulf$ ./test.sh 192.168.2.115
    Test firmware update/commit with debug.level=3 ...
    
    {
      "active_slot": 1,
      "is_committed": true,
      "revert_slot": 0,
      "commit_timeout": 0
    }
    *   Trying 192.168.2.115...
    * TCP_NODELAY set
    * Connected to 192.168.2.115 (192.168.2.115) port 80 (#0)
    > POST /update HTTP/1.1
    > Host: 192.168.2.115
    > User-Agent: curl/7.51.0
    > Accept: */*
    > Content-Length: 324119
    > Expect: 100-continue
    > Content-Type: multipart/form-data; boundary=------------------------4ac4a4aad256ca76
    > 
    * Done waiting for 100-continue
    < HTTP/1.1 200 OK
    < Server: Mongoose/6.7
    < Content-Type: text/plain
    < Connection: close
    < 
    Update applied, finalizing
    * Curl_http_done: called premature == 0
    * Closing connection 0
    {
      "active_slot": 0,
      "is_committed": false,
      "revert_slot": 1,
      "commit_timeout": 300
    }
    
    *   Trying 192.168.2.115...
    * TCP_NODELAY set
    * Connected to 192.168.2.115 (192.168.2.115) port 80 (#0)
    > GET /update/commit HTTP/1.1
    > Host: 192.168.2.115
    > User-Agent: curl/7.51.0
    > Accept: */*
    > 
    < HTTP/1.1 200 OK
    < Server: Mongoose/6.7
    < Content-Type: text/html
    < Connection: close
    < 
    Ok
    * Curl_http_done: called premature == 0
    * Closing connection 0
    {
      "active_slot": 0,
      "is_committed": true,
      "revert_slot": 1,
      "commit_timeout": 0
    }
    

    And this is from the log in the web ui.

    mgos_http_ev         20030f78 HTTP connection from 192.168.2.100:50090
    mg_rpc_ws_handler    20031468 CLOSED
    mgos_http_ev         20030f78 HTTP connection from 192.168.2.100:50093
    mgos_http_ev         20031060 HTTP connection from 192.168.2.100:50094
    mg_rpc_ws_handler    20031468 CLOSED
    updater_context_crea Starting update (timeout 300)
    parse_manifest       FW: mygw cc3200 1.0 20170620-103509/??? -> 1.0 20170620-103509/???
    cc3200_vfs_dev_slfs_ Deleting spiffs.img.0.1
    prepare_to_write     Storing fs.img 98368 -> spiffs.img.0.0 98368 (67aaa31dfea2b66f4f37580eb1a72f675426f15b)
    mongoose_poll        New heap free LWM: 52624
    mongoose_poll        New heap free LWM: 51712
    verify_checksum      spiffs.img.0.0: have 67aaa31dfea2b66f4f37580eb1a72f675426f15b, want 67aaa31dfea2b66f4f37580eb1a72f675426f15b
    verify_checksum      mygw.bin.0: have f035e1c7ba6179af224d0fe4736f6b012f22b3ec, want f035e1c7ba6179af224d0fe4736f6b012f22b3ec
    prepare_to_write     Digest matched for mygw.bin.0 180297 (f035e1c7ba6179af224d0fe4736f6b012f22b3ec)
    updater_process_int  Update requires commit, timeout: 300
    mgos_upd_finalize    Boot cfg 1: 0xfffffffffffffffb, 0x0, mygw.bin.1 @ 0x20000000, spiffs.img.1
    mgos_upd_finalize    Boot cfg 0: 0xfffffffffffffffa, 0x3, mygw.bin.0 @ 0x20000000, spiffs.img.0
    updater_finish       Finished: 1 Update applied, finalizing
    handle_update_post   Rebooting device
    mgos_system_restart_ Rebooting in 101 ms
    mongoose_poll        New heap free LWM: 51616
    mgos_vfs_umount_all  Unmounting filesystems
    mgos_vfs_dev_close   2002fae8 refs 0
    
    
    S0mygw.bin.0@20000000+180297+.2002826d
    
    cc3200_init          mygw 1.0 (20170620-103509/???)
    cc3200_init          Mongoose OS Firmware 2017062010 (20170620-103509/???)
    cc3200_init          RAM: 80144 total, 66540 free
    start_nwp            NWP v2.8.0.0 started, host driver v1.0.1.11
    cc3200_init          Boot cfg 0: 0xfffffffffffffffa, 0x3, mygw.bin.0 @ 0x20000000, spiffs.img.0
    mgos_vfs_dev_open    slfs_container ({"prefix": "spiffs.img.0"}) -> 2002fae8
    cc3200_vfs_dev_slfs_ 2002fae8 spiffs.img.0.0 98304 0xfffffffffffffffe
    mgos_vfs_mount       Mount SPIFFS @ / (dev 2002fae8, opts ) -> 20030170
    mgos_vfs_mount       /: size 83081, used: 18825, free: 64256
    mgos_vfs_mount       Mount SLFS @ /slfs (dev 0, opts ) -> 200305c8
    mgos_vfs_mount       /slfs: size 0, used: 0, free: 0
    cc3200_vfs_dev_slfs_ Deleting spiffs.img.1.0
    cc3200_init          Applying update
    mgos_vfs_dev_open    slfs_container ({"prefix": "spiffs.img.1"}) -> 20030608
    cc3200_vfs_dev_slfs_ 20030608 spiffs.img.1.1 98304 0xfffffffffffffffe
    mgos_vfs_mount       Mount SPIFFS @ /old (dev 20030608, opts ) -> 20030618
    mgos_vfs_mount       /old: size 83081, used: 20080, free: 63001
    file_copy            Copying conf9.json
    file_copy            Copying updater.dat
    mgos_vfs_dev_close   20030608 refs 0
    mgos_vfs_umount      /old 20030618 1
    mgos_sys_config_init MAC: D0B5C2E271A6
    mgos_sys_config_init WDT: 30 seconds
    mgos_wifi_connect    Connecting to usap
    mgos_i2c_create      I2C initialized (SDA: 17, SCL: 16, freq 100000)
    mgos_http_server_ini HTTP server started on [80]
    mg_rpc_channel_mqtt  20030b28 cc3200_E271A6/rpc/#
    mg_rpc_channel_uart  20030e98 UART0
    mgos_init            Init done, RAM: 80144 total, 61348 free, 60488 min free
    mgos_upd_get_commit_ Update state: 300
    mgos_upd_boot_finish Arming commit watchdog for 300 seconds
    mgos_wifi_on_change_ Wifi: connected
    wifi_cb              WiFi change event: 1, arg 0
    mgos_wifi_on_change_ WiFi: ready, IP 192.168.2.115, DNS 192.168.2.1
    wifi_cb              WiFi change event: 2, arg 0
    mgos_sntp_query      SNTP query to pool.ntp.org
    mongoose_poll        New heap free LWM: 59968
    mongoose_poll        New heap free LWM: 57840
    mongoose_poll        New heap free LWM: 56448
    mgos_sntp_ev         SNTP reply from 194.71.144.71: time 1497956303.798059, local 1497956303.896000, delta -0.097941
    mgos_http_ev         20030f78 HTTP connection from 192.168.2.100:50122
    mgos_upd_get_commit_ Update state: 300
    mgos_http_ev         20031060 HTTP connection from 192.168.2.100:50125
    mg_rpc_ws_handler    20031468 CLOSED
    mg_rpc_ws_handler    20030f78 CLOSED
    mgos_http_ev         20030f78 HTTP connection from 192.168.2.100:50126
    mgos_upd_commit      Committing update
    mgos_upd_boot_commit Committed cfg 0, seq 0xfffffffffffffffa
    mgos_http_ev         20030f78 HTTP connection from 192.168.2.100:50129
    mg_rpc_ws_handler    20031468 CLOSED
    

    So, it seems to work now.

  • rojerrojer Dublin, Ireland

    recent regression made during vfs refactoring, fixed by 85aa71d. apologies!

Sign In or Register to comment.