Local Push FOTA always boots to user1

steveshrimpton2
Posts: 2
Joined: Thu May 18, 2017 9:02 am

Local Push FOTA always boots to user1

Postby steveshrimpton2 » Thu May 18, 2017 9:56 am

I am trying to implement push FOTA for firmware on an ESP_WROOM-02 4096 MByte. I want to use an App on Android or Windows to get the file (user1 or user2) from a custom cloud server and push it out to the ESP8266 connected devices on the LAN.

I do not want those devices to access the internet directly.

As a prototype, I am using the IOTDemo in ESP8266_NONOS_SDK Version v2.1.0 downloaded today. I am using curl commands and Fiddler prior to coding this into the App.

The problem is that the upgrade seems to go without error but the device always boots up to user1.

Any clues are greatly appreciated!

Here is my prototype test sequence:

I am calling the function to begin an upgrade using curl from a Windows 10 PC connected to the Soft AP of the device:

Code: Select all

curl -X POST -H "Content-Type:application/json" http://192.168.4.1/upgrade?command=start


This results in the following output on the serial port which appears correct:

    We have a POST request.
    local upgrade start
    webserver's 192.168.4.2:59310 disconnect
Then I use Fiddler to send the user2.4096.new.6.bin to the device and see the serial port output which again seems correct:

    upgrade file download start.
    upgrade file download finished.
    local upgrade success
    webserver's 192.168.4.2:59350 disconnect
    system upgrade deinit

Finally I send the Curl Command:

Code: Select all

curl -X POST -H "Content-Type:application/json" http://192.168.4.1/upgrade?command=reset


This causes the serial port output:

    len:128
    We have a POST request.
    local upgrade restart
    reboot to use2
    del if0
    station: 54:27:1e:fa:ce:db leave, AID = 1
    rm 1
    bcn 0
    del if1
    usl

    <Mass of garbage since baud rate not updated>

    cal sector: 1019
    freq trace enable 0
    rf[112] : 00
    rf[113] : 00
    rf[114] : 01

    SDK ver: 2.1.0(116b762) compiled @ May 5 2017 16:08:55
    phy ver: 1134_0, pp ver: 10.2

    SDK version:2.1.0(116b762)
    IOT VERSION = v1.0.5t45772(a)
    reset reason: 4
    LIGHT PARAM: R: 15731984
    LIGHT PARAM: G: 202179138
    LIGHT PARAM: B: 843353093
    LIGHT PARAM: CW: 1112673090
    LIGHT PARAM: WW: 15731981
    LIGHT PARAM: P: 1000
    malloc:1
    prd:1000 r : 22222 g: 22222 b: 22222 cw: 22222 ww: 22222
    free:0
    PWM version : 00000003
    mode : sta(18:fe:34:ce:24:04) + softAP(1a:fe:34:ce:24:04)
    add if0
    add if1
    dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
    bcn 100
    add 1
    aid 1
    station: 54:27:1e:fa:ce:db join, AID = 1
    finish

steveshrimpton2
Posts: 2
Joined: Thu May 18, 2017 9:02 am

Re: Local Push FOTA always boots to user1

Postby steveshrimpton2 » Thu May 18, 2017 3:32 pm

Just to add a bit to this: How do I know it's booting to user1 all the time? Because I put an os_printf of the version number. Also if I cycle power, I see the following on boot:
    2nd boot version : 1.7(5d6f877)
    SPI Speed : 26.7MHz
    SPI Mode : QIO
    SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000

I'm using 4096MByte flash and my initial Download is attached
Attachments
DownloadTool.JPG

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 11 guests