Please make BLANK image flashing unnecessary to enable flawless OTA

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Please make BLANK image flashing unnecessary to enable flawless OTA

#1 Post by chunter1 » 23 Oct 2018, 18:18

I got several ESPs running ESPEasy around the house.
When updating OTA, i frequently end up with desoldering the module just to flash the blank image first to get it working again.
Please try to find a solution for that annoying problem. ;)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#2 Post by grovkillen » 23 Oct 2018, 18:45

Please add more info about the units. Memory size etc
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#3 Post by TD-er » 24 Oct 2018, 12:42

OTA flashing to nodes with 1M of flash is currently next to impossible.
The current image size is too large for OTA flashing, even in 2 steps.

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#4 Post by chunter1 » 24 Oct 2018, 14:52

grovkillen wrote: 23 Oct 2018, 18:45 Please add more info about the units. Memory size etc
They are ESP12F modules (= Wemos D1 mini).
Since by now i always compiled the latest version locally, the problem might be somewhere here.
Reason for compiling locally is that some plugins needed are from the pluginplayground.
Next time I'll try with precompiled images OTA and observe irregularities.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#5 Post by grovkillen » 24 Oct 2018, 16:21

What plugins are you compiling from the playground? Are they good enough for the main repository?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#6 Post by chunter1 » 25 Oct 2018, 20:50

grovkillen wrote: 24 Oct 2018, 16:21 What plugins are you compiling from the playground? Are they good enough for the main repository?
well, the ones i have written ;)
don't really know if they are good enough...
_P104_SRF02.ino
_P184_GY_US42V2.ino
_P124_Ventus_W266_RFM69.ino
_P109_RESOL_DeltaSol_Pro.ino

P.S.:
Did some tests (updated 10 modules in the field) with the precompiled images from github. All tests were successful without a crash.
Now i need to find a way to get my plugins compiled to such a stable image aswell :D

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#7 Post by grovkillen » 25 Oct 2018, 21:39

The Ventus plugin is part of the main repository.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#8 Post by chunter1 » 25 Oct 2018, 21:43

There are two Ventus plugins. ;)

_P046_VentusW266.ino
_P124_Ventus_W266_RFM69.ino

Mine is the one that uses an RFM69 receiver modul and thus directly receives the data from the outdoor unit.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#9 Post by grovkillen » 25 Oct 2018, 23:00

I see, cool! You should wrap them up and get them ready for the main repository.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#10 Post by TD-er » 26 Oct 2018, 01:06

And add a Github issue for it.

Djoe
Normal user
Posts: 21
Joined: 27 Aug 2018, 09:04

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#11 Post by Djoe » 26 Oct 2018, 08:47

TD-er wrote: 24 Oct 2018, 12:42 OTA flashing to nodes with 1M of flash is currently next to impossible.
The current image size is too large for OTA flashing, even in 2 steps.
Hi, do you mean that if we compile our own firmware to reduce the size (I have one less than 500kb), we can't use the 2 steps ?
Because on my side the 1st step is OK, but the 2d doesn't work (with my 500kb firmware)..
After the last reboot, it's frozen...

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#12 Post by TD-er » 26 Oct 2018, 19:55

If you look at the sysinfo page of the web interface, you see something like this at the bottom:
(Example of 4MB version)

Code: Select all

Sketch Size:	748 kB (2320 kB free)
SPIFFS Size:	934 kB (859 kB free)
On the flash, you have the "Sketch Size", which has room for the current active sketch and the OTA upload of a new firmware.
If the OTA uploaded file is bigger than the free sketch space, things will overwrite the settings partition (SPIFFS)
So the small "2-step OTA" firmware is about 300 kB, which leaves about 575 kB for the normal image on a 1 MB flash.
If you're uploading a 500 kB image directly on top of a 500 kB running image, it will overwrite your SPIFFS and thus cause a crash.

Djoe
Normal user
Posts: 21
Joined: 27 Aug 2018, 09:04

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#13 Post by Djoe » 30 Oct 2018, 09:41

TD-er wrote: 26 Oct 2018, 19:55 So the small "2-step OTA" firmware is about 300 kB, which leaves about 575 kB for the normal image on a 1 MB flash.
My "little" firmware is less than 500kB :

Code: Select all

-rw-r--r--  1 root root     482512 sept. 12 21:53 sonoff.bin
When I upload it through the sonoff basic's serial connection (1mb), after the reboot, I can see through the web interface :

Code: Select all

Sketch Size     557 kB (316 kB free)
Then I'm upload the "2-step OTA" firmware through OTA.
After the reboot, I can access to the device through wifi (but I can't check the free sketch partition, I guess it's normal).

Then I upload the same "little" firmware.
The sonoff say OK and reboot, but it never go up again.

Are you sure about the free sketch size with the "2-step OTA" firmware on a 1mb esp ?

Thank you in advance!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#14 Post by TD-er » 07 Nov 2018, 10:34

Last nightly build should include the 2step uploader image of 276848 bytes.
Also 2 minimal OTA images of about 601000 bytes.
These only have a minimal set of plugins and I will try to reduce it even more and maybe add some more later.
For example to support all hardware included in Sonoff's (THxx)

Djoe
Normal user
Posts: 21
Joined: 27 Aug 2018, 09:04

Re: Please make BLANK image flashing unnecessary to enable flawless OTA

#15 Post by Djoe » 20 Dec 2018, 10:06

I tried today the "new" 2-step-OTA on 1mb flash size (sonoff basic).
It's not working, here below all serial logs,

1/ I download the 2-step firmware (through OTA) without any problem

Code: Select all

Update: ESPEasy_2step_UploaderMega_1024.bin
                                           sleep disable
                                                        ........................................................................................................................................Update Success: 276848
                                                                                                                                                                                                                      Rebooting...

 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
@cp:0
     ld
2/ Then I download my own firmware which is below the 604kb limit, but after the reboot the sonoff never start again

Code: Select all

Update: firmware.bin
                            sleep disable
                                         ......................................................................................................................................................................................................................................................................................................Update Success: 601024
                                                                                                                       Rebooting...

 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0xef
csum 0xef
csum err
ets_main.c
 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0xef
csum 0xef
csum err
ets_main.c
3/ I flashing again through the serial connection the 2-step firmware, and I download (through OTA) the official ESP_Easy_mega-20181120_minimal_ESP8266_1024_OTA.bin with the same result:

Code: Select all

Update: ESP_Easy_mega-20181120_minimal_ESP8266_1024_OTA.bin
                                                                   sleep disable
                                                                                .......................................................................................................................................................................................................................................................................................................Update Success: 603584
                                                                                                                                                               Rebooting...

 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0xef
csum 0xef
csum err
ets_main.c 
 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0xef
csum 0xef
csum err
ets_main.c
Is someone have already success to upgrade through OTA a 1mb flash??

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests