Arduino-HomeKit-ESP8266
Arduino-HomeKit-ESP8266 copied to clipboard
Exception 29: StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores
Hi,
First of all, thank you for this fabulous implementation.
I'm trying to use this library in a little personal project, but I've been getting a pesky issue that I can't figure out how to stop.
It mostly happens when there are clients connected to the Homekit server. (while opening the home app in the iPhone), but could also occur if you leave the ESP untouched for a while.
In the moments leading to this issue, I can see the Free Heap going down from 20k-30K down to 4k.
Then, sometimes I get the following error:
!!! [31861790] HomeKit: Error malloc payload!! payload_size->161
and shortly after the following issue.
Exception 29: StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores
PC: 0x40231ab9: memcpy_P at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/sys/xtensa/string_pgmspace.c line 137
EXCVADDR: 0x00000000
Decoding stack results
0x4022f8b1: _printf_i at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf_i.c line 194
0x40233f72: __ssputs_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 233
0x4023415c: _svfprintf_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 531
0x402343a3: _svfprintf_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 667
0x402353e3: __sfputc_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 404
0x40231861: _vsnprintf_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/vsnprintf.c line 73
0x4023018c: sprintf at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/sprintf.c line 646
0x402318a4: vsnprintf at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/vsnprintf.c line 42
0x4021bc89: client_send(_client_context_t*, unsigned char*, unsigned int) at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\arduino_homekit_server.cpp line 694
0x4021bcf4: client_send_P(_client_context_t*, char const*) at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\arduino_homekit_server.cpp line 707
0x4020562f: json_write at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\json.c line 81
0x4021bd8c: client_send_chunk(unsigned char*, unsigned int, void*) at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\arduino_homekit_server.cpp line 709
0x4020559c: json_new at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\json.c line 55
0x4020574a: json_object_start at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\json.c line 111
0x4021be40: send_client_events(_client_context_t*, _client_event*) at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\arduino_homekit_server.cpp line 750
0x4021d9a5: homekit_server_process_notifications(homekit_server_t*) at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\arduino_homekit_server.cpp line 3084
0x4010074c: millis() at C:\Users\Alejandro.000\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_wiring.cpp line 188
0x40100700: millis() at C:\Users\Alejandro.000\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_wiring.cpp line 176
0x4021da5e: homekit_server_process(homekit_server_t*) at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\arduino_homekit_server.cpp line 3123
0x4021ed81: arduino_homekit_loop() at D:\Alejandro\Documents\Arduino\libraries\HomeKit-ESP8266\src\arduino_homekit_server.cpp line 3596
0x4022b665: __delay(unsigned long) at C:\Users\Alejandro.000\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_wiring.cpp line 57
0x40217ac2: my_homekit_loop() at D:\Alejandro\Dropbox\Projects\GitHub\Suitchi\src\suitchi/suitchi.ino line 321
0x4021a5c4: loop() at D:\Alejandro\Dropbox\Projects\GitHub\Suitchi\src\suitchi/suitchi.ino line 199
0x4022af0c: loop_wrapper() at C:\Users\Alejandro.000\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266\core_esp8266_main.cpp line 197
In issue #95 you mention that its prudent to only run arduino_homekit_loop() if the server is not paired yet. But implementing that snipped of code results in the device becoming unresponsive in the home app after its has paired, restoring the loop back it then behaves as expected.
I'm using an ESP8266 based board, configured using your recommended values in the README.md
Are there any special considerations as to how we are supposed to notify the homekit clients about hardware changes? I noticed in your examples you only notify every 10 seconds, does it mean we can't do it any faster? (i want to rely in motion sensors to be as fast as possible)
Any idea what could be happening to make the memory go down like this?