ESP_Easy_mega-minimal_ESP8266_1024_OTA

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
FourIdGeek
New user
Posts: 8
Joined: 26 Jan 2019, 23:32

ESP_Easy_mega-minimal_ESP8266_1024_OTA

#1 Post by FourIdGeek » 26 Jan 2019, 23:51

Hi, I've been trying to get the OTA functionality working on some Sonoff Basic units and found that the 20190121 build is too large to allow the 2 step method.
I noticed that the binary has increased slightly:
minimal_ESP8266_1024_OTA
(613,920 bytes) - 20190116
(614,432 bytes) - 20190121

2step binary:
(276,848 bytes) - 20190116
(276,848 bytes) - 20190121

My ultimate goal is to try and compile my own build of ESPEasy which includes basic functionality with OTA, minimal plugins but include the Dallas sensor (P004), and OpenHAB MQTT (C005).
One other thing I noticed is that in the Globals.h the #define FEATURE_ARDUINO_OTA was commented out, is this going to be needed to enable OTA for my own build?
Any help with this would be appreciated.

Thanks,

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

Re: ESP_Easy_mega-minimal_ESP8266_1024_OTA

#2 Post by Djoe » 11 Feb 2019, 10:48

Hi,

Have you already success to update a 1mb esp8266 through OTA ?
On my side : never.
However I use the 2-step OTA, I have stretch the binary to a small size (601024 bytes), the upload is ok, but after the reboot the esp is frozen.
The result was the same with the minimal binary coming from the daily built (if you try the 20181120 release for instance, the size is ok to be uploaded on the 2-step-OTA).

Regards,

FourIdGeek
New user
Posts: 8
Joined: 26 Jan 2019, 23:32

Re: ESP_Easy_mega-minimal_ESP8266_1024_OTA

#3 Post by FourIdGeek » 11 Feb 2019, 19:03

I have also had some luck using older versions using the 2-step OTA process, but am now going to try replacing on some units the 1MB flash with 4MB flash now that I have some.
It's not exactly convenient to re-flash an in-wall light switch using a physical connection :-)

It would have been nice to hear back from the devs on steps that potentially could be taken to reduce the compiled size when only specific plugins are actually required, but it's also understandable that they are busy with other things much higher on the priority list.

What I may try next is going back to one of those old versions and add the P004 plugin to see if it's small enough for the 2-step OTA process. It's been a while since I've done any real C coding, brings back some fond memories AND a few nightmares :lol:

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

Re: ESP_Easy_mega-minimal_ESP8266_1024_OTA

#4 Post by Djoe » 12 Feb 2019, 07:58

You can compile your own binary by following those instructions :
https://www.letscontrolit.com/wiki/inde ... platformio

It's easy to reduce the size to 600k.
On my side the home made binary work fine on my sonoff 1mb, but after uploading it through 2-step-OTA, it's frozen.

When you have saw the 2-step working, it was on which kind of material ?

FourIdGeek
New user
Posts: 8
Joined: 26 Jan 2019, 23:32

Re: ESP_Easy_mega-minimal_ESP8266_1024_OTA

#5 Post by FourIdGeek » 12 Feb 2019, 17:32

I've already been compiling my own using Platformio, that's not a problem. :-)

You said "It's easy to reduce the size to 600k.", could you provide some detail? What I have done so far to create my own minimal OTA binary is:
1. update the define_plugin_sets.h to have

Code: Select all

#ifdef PLUGIN_BUILD_MINIMAL_OTA
    #define PLUGIN_DESCR  "Minimal 1M OTA"

    #define CONTROLLER_SET_NONE

    #define BUILD_MINIMAL_OTA

    // #define USES_C001   // Domoticz HTTP
    // #define USES_C002   // Domoticz MQTT
    #define USES_C005   // OpenHAB MQTT
//    #define USES_C006   // PiDome MQTT
    // #define USES_C008   // Generic HTTP
    // #define USES_C009   // FHEM HTTP
//    #define USES_C010   // Generic UDP
    // #define USES_C013   // ESPEasy P2P network

//    #define NOTIFIER_SET_STABLE
    #define NOTIFIER_SET_NONE

    #define PLUGIN_SET_NONE

    #ifndef USES_P001
        #define USES_P001   // switch
    #endif
    #ifndef USES_P026
      // #define USES_P026   // SysInfo
    #endif
    #ifndef USES_P033
      // #define USES_P033   // Dummy
    #endif
    #ifndef USES_P037
//        #define USES_P037   // MQTTImport
    #endif

    #ifndef USES_P004
       #define USES_P004   // Dallas
    #endif
    #ifndef USES_P005
//        #define USES_P005   // DHT
    #endif

    #ifdef USE_SERVO
      // #undef USE_SERVO
    #endif
#endif
2. update the platformio.ini to have:

Code: Select all

[platformio]
;env_default = esp32dev
;env_default = dev_ESP8266_4096
;env_default = normal_ESP8266_1024
env_default = minimal_ESP8266_1024_OTA
;env_default = normal_ESP8266_4096
; ..etc

[core_2_4_2]
platform                  = espressif8266
;platform                  = https://github.com/TD-er/platform-espressif8266.git#patch/v1.8.0_Puya
build_flags               = ${esp82xx_defaults.build_flags}

The trouble I am having is to get the size of the binary down to the ~600k size while including the P004 plugin for the DS18b20 and OTA *and* still have the OTA work.
The initial flash using the ESP.Easy.Flasher seems to work fine, but then uploading the ESPEasy_2step_UploaderMega_1024.bin and re-flashing the same custom firmware seems to freeze the device... basically the same as what you are experiencing.

The OTA flashing using the pre-built binaries from 2018-11-08 did work for me as well if I recall correctly, it's been a few weeks since last attempting all this and it was also at that time I ordered the 4MB flash chips so I've just been waiting for them. I was going to try replacing the 1MB flash and just try a single step flash to see if that works.

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

Re: ESP_Easy_mega-minimal_ESP8266_1024_OTA

#6 Post by Djoe » 12 Feb 2019, 23:51

FourIdGeek wrote: 12 Feb 2019, 17:32 You said "It's easy to reduce the size to 600k.", could you provide some detail?
For instance I don't use NTP in my modules, so I have commented out all related code:
- look at TimeESPeasy.ino
- comment everything in getNtpTime

The gain is 10336 bytes for me,
Mc/

FourIdGeek
New user
Posts: 8
Joined: 26 Jan 2019, 23:32

Re: ESP_Easy_mega-minimal_ESP8266_1024_OTA

#7 Post by FourIdGeek » 01 Mar 2019, 06:37

I have now received a couple strips of 4MB Winbond flash chips and have replaced the 1MB chips on a few devices, so far it's been working well.
The new chips are slightly larger but still match up with the solder pads close enough to get good connection, and the OTA updates have been working great on the Sonoff basic units, the in-wall light switch being used for testing (not in the wall yet), and a WiOn exterior plug that has a waterproof DS18B20 added for controlling my vehicle block heater.

For any of the devices which are not easily flash-able using a wired connection I think this is a reasonable solution for me, but I hope the option of using the 2 step OTA update doesn't go away.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests