iotappstory / ESP-Library

Software Distribution and Management Over the Air
GNU Lesser General Public License v2.1
124 stars 35 forks source link

callHome defaults SPIFFS #98

Closed Bolukan closed 5 years ago

Bolukan commented 5 years ago

If manually invoked callHome, you can turn SPIFFS off:

IAS.callHome(false);

https://github.com/iotappstory/ESP-Library/blob/f8b0da1f922f6c787cce6a1d140f76b15ad464be/src/IOTAppStory.cpp#L611

but the bool will default to be true, if called through the timer, after preSetAutoUpdate(true) or the button press. I would expect this to be configurable too?

https://github.com/iotappstory/ESP-Library/blob/f8b0da1f922f6c787cce6a1d140f76b15ad464be/src/IOTAppStory.cpp#L1142 https://github.com/iotappstory/ESP-Library/blob/f8b0da1f922f6c787cce6a1d140f76b15ad464be/src/IOTAppStory.cpp#L236 https://github.com/iotappstory/ESP-Library/blob/f8b0da1f922f6c787cce6a1d140f76b15ad464be/src/IOTAppStory.cpp#L1226

Onno-Dirkzwager commented 5 years ago

Good point, what would be your prefered solution?

Bolukan commented 5 years ago

Just wonder where you define U_SPIFFS and U_NEXTION? I love it.

But to the point: I would prefer a #define OTA_SPIFFS. That said, it would be quite fixed choice for an application (changes between versions is possible, but little bit complicated). preSetUpdateSpiffs(bool) makes it facultative, but is that desirable? One of my thoughts is the EEPROM definition changes with al those #defines, so EEPROM is not exchangable between Apps? As long it is managed #define works ok. I don't believe the amount of memory used (ROM/code) is that important. Most of the code is reused. The extra amount of RAM used should be very limited.

Onno-Dirkzwager commented 5 years ago

The 8266 sets U_FLASH and U_SPIFFS in the core(update.h) we added U_NEXTION https://github.com/iotappstory/ESP-Library/blob/develop/src/espressif/esp8266/otaUpdate.h

The 32 does not have these(yet...) so we add all 3 https://github.com/iotappstory/ESP-Library/blob/develop/src/espressif/esp32/otaUpdate.h

These are all for internal use. The defines we provide for our library are set in the config.h as you already know.

BTW the differences between the 2 platforms are rapidly disapearing. The 2 files above will probaly merge after the new cores release. They are already closer as ever before.

The upcomming 2.1.0 will have a few more config.h defines one of them:

define NEXT_OTA true // Do you want to OTA update your Nextion display? | true / false

https://github.com/iotappstory/ESP-Library/blob/develop/src/config.h#L29

Ill set something simelar up for SPIFFS

Onno-Dirkzwager commented 5 years ago

Updated link as it's now in the master: https://github.com/iotappstory/ESP-Library/blob/master/src/config.h#L51

Onno-Dirkzwager commented 5 years ago

Im closing this issue as this is now an option in the latest release!