iotappstory / ESP-Library

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

free heap, new EEPROM layout, multiple small fixes & updated examples #122

Closed Onno-Dirkzwager closed 5 years ago

Onno-Dirkzwager commented 5 years ago

Free heap After inplementing BearSSL with certificates in a previous PR we were running out of heap on the ESP8266. In larger apps this could cause crashes during ota updates on boot. And when entering config mode(when sending logs to IAS with the local ip address).

To free heap I have rewritten the oldest parts of this library:

Both are stored in EEPROM and used global vars / arrays during runtime for use in multiple other functions. This was not a problem when this library started as they contained very little. But as functionality was added during time they became quite a load. While only used during boot and not or rarely in the developed app.

As the original libary was built around these structs and functions, quite a lot of code & the boot sequence has changed. This rewrite frees up +/- 10% heap during boot and +/-2% ram for the whole library.

WiFi As the wifi credentials(3 sets) were stored in the original config struct. This had to be rewritten and I took the opportunity to also address the following issues / wishes:

Other fixes