ESP8266-EVB Iot Firmware FOTA issue

Started by tomplus, September 23, 2015, 07:52:03 PM

Previous topic - Next topic

tomplus

Hello,
using "https://github.com/OLIMEX/ESP8266/tree/master/IoT Firmware" and building with SDK 1.3.0 or 1.4.0 on the usual VM and flashing MOD-WIFI-ESP8266-DEV via serial interface works. Afterwards the REST interface and the WebSockets are working for most functions.
Trying to update user?.bin through Wifi connection fails! I've tested so far:
1. ESP-Sample-Application.html (WebSockets) which cause a Fatal exception (28):epc1=0x4000bf80, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000

2. Advanced REST Client from within Chrome: causes a "Meta value too long" error; increasing FLASH_STREAM_MAX_META to 500 causes the error message "Region not found" which is due to hieroglyphics in extracted FLASH name. Used:
-- URL: http://192.168.4.1/config/firmware
-- Payload: {"Firmware":{"boot.bin":"FILE-DATA:0","user1.bin":"FILE-DATA:0","user2.bin":"FILE-DATA:300916"}}
-- attached "user2.bin" file

3. played with curl like:
curl -v --user olimex:olimex -F user2.bin=@"user2.2048.new.3.bin;type=application/octet-stream"  http://192.168.4.1/config/firmware 
--> this leads also to the error message "Region not found" which is due to an invalid FLASH file name.
The problem seems to depend on the fact that when client is posting a file multipart/form-data with boundaries is needed which may not be supported.

What is the correct way/format? Any hints?
Thanks in advance

PeteW

In reverse order of questions:

Q 2 and 3.
"Region not found" messages are issued because of unconventional format expected for firmware upload. It is described in https://github.com/OLIMEX/ESP8266/blob/master/IoT%20Firmware/README.md

Basically the server expects POST request with JSON content describing the data terminated by <binary zero> followed with <region-name>:<data-size>:<binary-data>

For example:

{
    "Firmware" : {
        "boot.bin"  : "FILE-DATA:0",
        "user1.bin" : "FILE-DATA:278880",
        "user2.bin" : "FILE-DATA:0"
    }
}
<0>user1.bin:278880:<278880 bytes data>


Q 1.
Can you try it when connected to another AP as station and use station IP for connection/upload.
This is the way I usually upload firmware and have no such issue.

PeteW

#2
Update: I just did a test using Sample Application (WebSockets and REST) and connected to ESP8266 AP without problems

tomplus

Thank's a lot for your reply!
Meanwhile I've implemented a binary update FOTA server and client.
The main reason for this decision were some additional requirements allowing an automatic build & deploy mechanism. The ESP8266 fetches now its new firmware if there is a newer version available on server...