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

Storage alignment issues aka. "max number of pairings" #231

Open
wants to merge 40 commits into
base: master
Choose a base branch
from

Conversation

cfurter
Copy link

@cfurter cfurter commented Jul 19, 2023

I've taken the work of @thiti-y and @paullj1 and added my own fixes to the storage issues.

TLDR; the alignment issues and read write protection of the ESP flash issues are now resolved.

With ESP8266 flash, you can only write data in 4 byte alignments to addresses that have been erased. Once you've written data to an address, you cannot write to the address again until the sector is erased. I've corrected the logic in storage.c based on this and all seems to work well now.

I am now able to added and remove pairing without the "max number of pairings" issues. You may need to do a homekit_storage_reset() or erase the "EEPROM" sector before it will work well.

I have also added a bunch of changes to remove Platform.io warnings.

ruleechen added a commit to ruleechen/Arduino-HomeKit-ESP8266 that referenced this pull request Aug 8, 2023
dkerr64 and others added 12 commits June 8, 2024 13:57
@jgstroud

Attempting to use 1KB from stack is risky as the ESP8266 has very small stack to start with.
…rtesy of @jgstroud

Attempt keep the session alive while pairing
Add optimistic_yields to try and prevent the session from timing out
When performing a OTA firmware update, we need to shutdown the HomeKit sever because all network processing (including pings) stop during file uploads.  So system cannot process incoming TCP requests, risking out-of-memory crashes as buffers fill up.
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.

5 participants