Unexpected progsize increase from release 20200410 to 2021014

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Unexpected progsize increase from release 20200410 to 2021014

#1 Post by martinus » 22 Jan 2021, 13:30

Hello All,

Been a while since i had time to look at ESPEasy again. Decided to start upgrading from release 20200410 to the latest.
Worked out fine for my ESP32 modules.

But trying to compile a new version for my 1M smartplugs leads to a very large increase of code size.

Compiled a version using custom.h on version 20200410 that compiled to 572kB to fit on my smartplugs
Now upgraded to version 20210114 using same custom.h, compiles to 699kB (!!) what has happened here?

My custom.h only includes C001,C005 and less than 5 plugins.

I could try to reverse engineer the issue, but maybe others have found similar issues and can provide the solution?
It looks like a lot of code is included although i did not specify more than a few plugins in custom.h

Relevant part of custom.h:

Code: Select all

    #define BUILD_MINIMAL_OTA
    #define WEBSERVER_CUSTOM_BUILD_DEFINED
    #define WEBSERVER_CONFIG
    #define WEBSERVER_CONTROLLERS
    #define WEBSERVER_DEVICES
    #define WEBSERVER_TOOLS
    #define WEBSERVER_UPLOAD
    #define WEBSERVER_ADVANCED
    #define WEBSERVER_HARDWARE
    #define USES_C001   // Domoticz HTTP
    #define USES_C005   // MQTT
    #define USES_P001   // Switch
    #define USES_P240   // SmartPlug

User avatar
Ath
Normal user
Posts: 3515
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Unexpected progsize increase from release 20200410 to 2021014

#2 Post by Ath » 22 Jan 2021, 13:39

The trap I fell into a few times is that the libraries I put in the lib folder, but are not used/referenced in any of the plugin sources, seem to be included in the build (probably for reasons like 'just to be sure we're not missing out on anything'). I'm using Platform.IO/VSCode, btw, so when on ArduinoIDE this may be different, IDK, as I ditched ArduinoIDE for being barely usable as a development environment.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3515
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Unexpected progsize increase from release 20200410 to 2021014

#3 Post by Ath » 22 Jan 2021, 13:40

Oh, and since last April, the Arduino and Espressif stuff has been upgraded, so there may be a size difference as well, but not that large, indeed.
/Ton (PayPal.me)

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

Re: Unexpected progsize increase from release 20200410 to 2021014

#4 Post by TD-er » 22 Jan 2021, 14:00

You should also define this:

Code: Select all

#define PLUGIN_BUILD_MINIMAL_OTA
This will define a number of other defines like:
- BUILD_MINIMAL_OTA
- LIMIT_BUILD_SIZE
- BUILD_NO_DEBUG

Of just define those yourself to reduce the build size even more.

Post Reply

Who is online

Users browsing this forum: No registered users and 145 guests