maccoylton/homekit_wifi_thermostat

Homekit does not see the device when adding

Closed this issue · 9 comments

Something happened after update 0.6.0. If I am flashing a new device, the device is not located in the Home app. If I install version 0.5.0, add the device to the house, after that I update it to version 0.6.0, then the firmware is installed and everything works, but if I remove the device from the house, then again it is impossible to add it with version 0.6.0. To check this, I downloaded both files and added one by one to my modeling repository. The same with the files that I compiled at home, I can update the firmware with my file, but I can not connect my compiled file from the latest version of the repository to the homekit.

Post a log and I can take a look

esp.logs.txt
logs 0.6.0

rtos assert
/Volumes/case-sensitive/esp-open-rtos/FreeRTOS/Source/timers.c 357
[21:54:15]abort() invoked at 0x40204ce3.
[21:54:15]
[21:54:15]Stack: SP=0x3fff7a00
[21:54:15]0x3fff7a00: 3fff2dc4 3fff9128 00000000 40204ce6
[21:54:15]0x3fff7a10: 4024bd65 3fff305c 3fff2cf4 40204934
[21:54:15]0x3fff7a20: 00000000 40202350 4023e2bc 402173e4
[21:54:15]0x3fff7a30: 3fff7a00 00000002 00000000 00000000
[21:54:15]0x3fff7a40: 00000000 00000000 3fff2dc4 40202459
[21:54:15]0x3fff7a50: 00000002 3ffe89c8 00000000 00000000
[21:54:15]0x3fff7a60: 3fff271c 3ffe89c8 00000000 40216535
[21:54:15]0x3fff7a70: 3fff271c 3ffe89c8 00000000 40216928
[21:54:15]
[21:54:15]Free Heap: 28136
[21:54:15]_heap_start 0x3fff2ed8 brk 0x3fff9378 supervisor sp 0x40000000
sp-brk 27784 bytes
[21:54:15]arena (total_size) 25760 fordblks (free_size) 352 uordblocks
(used_size) 25408

try 0.6.1 . 0.6.0 broke pairing although an already paired device was ok.

Yes Thank you, the issue has been resolved. Now everything works as it should, as I understand it, the problem is not in the code, but in compilation. something is wrong with the timers.c library, should it be replaced during compilation?.
P.S. You do not accept my Pull, you do not like the icon design, I want to remake the logo to a newer one
New Homekit Logo

Sorry I forgot to push the latest code, sorted now. Pull that and you should be good .

Hello. 0.6.1 fixed the problem with adding, fixed the problem with removing the thermostat from the app and re-pairing. Previously, when the thermostat was deleted from the Home application, it was no longer needed to be reflashed and reconnected, today I tried to specifically delete it, the thermostat, when deleted, displayed a QR code on the screen and pairing commands went in the logs.

In the process of experiments, I found a few more bugs, in the code I see that the thermostat writes the state to memory and after reboot reads recover_from_reset, save_characteristics, load_settings_from_flash. And this is the failure I found, if the power to the thermostat was lost and it was able to HEAT Target temperature 30, after powering up again, the thermostat shows the same HEAT state, reads the temperature that, for example, had time to cool down to 27 and when I continue to heat after a reboot, it is warm and 31 and 32 and 33 does not go into the OFF state, you need to manually change the thermostat mode to another OFF, AUTO or COOL and return to the HEAT mode, after which everything continues to work automatically. I think this is a problem because you need to correct the thermostat every time after a power outage.

Perhaps this problem is only for me, I managed to replace the DSN22 sensor with DS18V20 and it works, if it’s not difficult for you to look at my branch, this is my first experience and I looked for code examples in so many repositories, but I tried to fix it for your code style, this took me about a week.
https://github.com/xrust83/homekit_wifi_thermostat

The second problem is the display of the current temperature in the home application, in the logs and on the indicator screen it changes very quickly, but in the home application it can change extremely up to 5-10 minutes, such a delay in the Home and EVE, I use the HAA-manager application and when I go to the device page and then the updates are also instant, I have an assumption that some applications are waiting for the thermostat to send the temperature and the HAA-manager makes the request himself

I figured out the preserve_state function, everything works fine, I also figured out the temperature polling, and there was a problem with the sensor polling code for me and updating the data now everything works more dynamically.