Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 18 commits into from
Jun 4, 2019
Merged

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

merged 18 commits into from
Jun 4, 2019

Conversation

Onno-Dirkzwager
Copy link
Collaborator

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:

  • config structs for storing device info & wifi creds
  • the addFields functions and struct

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:

  • Static ip options
  • beter WiFiscan the first time a page is loaded
  • refactor WiFi functionality into separate files
  • more durable EEPROM layout which lasts between library updates(changes).

Other fixes

  • ESP32 fix SPIFFS bug that prevents storing certificates on a fresh device
  • Fixed missing NEXT_BAUD define which Stabelizes Nextion updates on the ESP8266 by setting the correct speed.
  • Made getChipId available for the ESP32

@Onno-Dirkzwager Onno-Dirkzwager merged commit f0f45fd into iotappstory:master Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant