Arduino-HomeKit-ESP8266 icon indicating copy to clipboard operation
Arduino-HomeKit-ESP8266 copied to clipboard

Storage alignment issues aka. "max number of pairings"

Open cfurter opened this issue 1 year ago • 0 comments

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.

cfurter avatar Jul 19 '23 12:07 cfurter