ESPHap icon indicating copy to clipboard operation
ESPHap copied to clipboard

Accessory 'No Response'

Open karl-fischer opened this issue 3 years ago • 45 comments

Hello :)

I am using the EspHap_Switch example. I have set the ssid and password to match my network. #define ENABLE_WIFI_MANAGER is commented out.

I have successfully connected the ESP to my home WiFi and paried the switch accessory with the Home app on my iPhone.

The iPad is set to act as a Home Hub, with the intention that I will be able to access the accessories while I am away from home. The iPad will stay in the home even when I sell it, so the iPad has its own iTunes/iCloud account, which is logged in, and this is different to the iTunes/iCloud account on my iPhoneX. To get the accessories on my iPhoneX, I sent a guest invite from Home on the iPad to the iPhoneX. The guest access is configured such that guests are permitted to modify/add/remove accessories and can access while away from the home.

When I turn off WiFi on my iPhoneX, to simulate being away from home, and then place my iPhoneX on the desk with the Home app open, the switch accessory continues to show healthy for some minutes, but then shows No Response in the Home app. Note, I haven't pressed the button, just left the Home app open on the Home or Garage room. I'm looking at my iPhoneX and it's saying it right now. It shows an exclamation mark on the accessory in the Home app, and has the state ("Off") in red text. It also says, "Test Switch No Response" (I named the accessory Test Switch when I added it to the Home app.

If I minimise the Home app on my iPhoneX and then open it again, the Test Switch state changes to "Updating" and then after a few seconds, shows "Off", which is the correct status and the "No Response" message goes away.

The iPad is plugged in to power, but the screen has gone to sleep (I don't want to leave the iPad screen on 24/7 with no sleep).

I am not sure how to proceed to make it reliably stay available in the Home app, without it changing to "No Response". Are you able to help with this please? I am keen to do whatever debugging can help with the investigation :)

After some testing like this, I have changed the iPad iTunes/iCloud account, to use the same one on both the iPhoneX and iPad and re-added the accessory. Now the accessory in the iPhoneX (with WiFi turned off) seems to be working better, I have left the phone on and with the Home app open on the iPhoneX for 15 minutes and it has not come up with "no response" yet.

Could it be related to accessing the accessories as an invited guest and different iTunes/iCloud accounts? Or is there something else we can investigate?

Details:

  • Arduino 1.8.13
  • iPhoneX iOS 14.4 (192.168.1.101)
  • iPad 8th gen, iPadOS 14.4 (192.168.1.100)
  • ESPHap: v1.0.7
  • ESP8266 v2.7.4 (in Boards Manager)
  • Board: NodeMCU 1.0 (ESP-12E Module) - Note, this is a NodeMCU v1.0 Rev2.0 (192.168.1.155)
  • CPU Freq: 120MHz
  • Flash Size: 4MB (FS:2MB oTA:~1019KB)
  • Debug port: Disabled
  • Debug level: None
  • IwIP Variant: v2 Lower Memory Changed this to v2 Higher Bandwidth (as per comment below)
  • VTables: Flash
  • Exceptions: Legacy (new can return nullptr)
  • Erase Flash: Only Sketch
  • SSL Support: Basic SSL ciphers (lower ROM usage) - Note, I am using WolfSSL 3.13.0 as per Readme instructions.
  • Port COM3 - Note, I have the NodeMCU connected via USB.

Network equipment which may appear in the mDNS logs:

  • 192.168.1.100 - (as above) iPad 8th Gen, iPadOS 14.4, used as the Home Hub.
  • 192.168.1.101 - (as above) iPhone X iOS 14.4, used for controlling the accessories both locally on WiFi and with WiFi turned off to simulate being remote.
  • 192.168.1.102 - My Ryzen 7 Win10x64 PC, used for programming the NodeMCU.
  • 192.168.1.103 - Vero4k+ media player. Note, this is a AirPlay receiver, so appears in the mDNS logs.
  • 192.168.1.105 - Unrelated iPad Air, not used for this project, but is in the house on wifi. This is my girlfriends.
  • 192.168.1.106 - Unrelated iPhoneX (another one), not used for this project, but is in the house on wifi. This is my girlfriends.

Thank you :)

karl-fischer avatar Feb 13 '21 23:02 karl-fischer

Hello :) Thanks for interesting of this project. Last few days I'm working on library stability, therefore version v1.07 is recomended. However theare are big improvement on this library.

  1. Take the latest version (just latest commit not labeled yet) , you can see #41 discussion and the latest acvievemt, I have met such behaviour and there are two things done, which really improves and I can't reproduce this more.
  2. Take a look #49, based on your setting you should compile with option v2 Higher Bandwidth , instead v2 Lower Memory

If you want to support and improve stability try to reproduce this behaviour again and very helpfull will be a CORE LOG (specially i need mDNS logs) at the moment when device is not responding

Then. In theory when it's stable reproducing you can try MDNS.announce() for instance every 5-10 sec in the loop. I did't implement this in the core, becasue it will kill network by garbage and I need an optimal way

Will appreciate with the comments or any pull request of sources or readme, to help to other guys, due to the big interest in the last months

Yurik72 avatar Feb 14 '21 13:02 Yurik72

see latest commit https://github.com/Yurik72/ESPHap/commit/148660a97d0128aa96dfd76c4849d7af0b9fc9f1

Yurik72 avatar Feb 14 '21 16:02 Yurik72

Ok, I continued to do more monitoring with the iPad and iPhoneX on the same iCloud account (iPad on WiFi and iPhoneX not on WiFi) and v1.0.7 of ESPHap. I kept the iPhoneX Home app open and watched the accessory for at least an hour, the accessory worked fine the whole time and did not display the 'No Response' message. So, it seems to work fine when they are both logged in to the same iCloud account.

I then removed the accessory, logged out of iCloud on the iPad, and then logged back in to the iPad using a different iCloud account. This is so the iPad can stay in the house when I sell the house and move out. I invited the iPhoneX to share the home (in Home app), and added the accessory again. After just a couple of minutes, the accessory on the iPhoneX Home app showed, 'No Response'. After a minute or two, the 'No Response' message cleared.

So, now to the testing you requested. I chanaged IwIP Variant from v2 Lower Memory, to v2 Higher Bandwidth, downloaded commit 148660a, compiled and downloaded to the NodeMCU. I also have the iPad and iPhoneX back on the same iCloud account and the accessory is added again. I watched the iPhoneX for a few minutes, and it is showing the 'No Response' message. This is the first time I have seen this message when the iPad and iPhoneX were logged in to the same iCloud account.

So, with 148660a it appears to be showing 'No Response' even when they iPad and iPhoneX are both on the same iCloud account (remember, I always have the iPad on WiFi in the home and the iPhoneX WiFi is turned off to simulate it being away and trying to control the accessories remotely). It has showed 'No Response' twice now, in the past 5 minutes. However, as I continue to monitor the iPhoneX, the accessory is staying healthy for the past several minutes. Oh no wait, it has gone 'No Response' again.

I'd like to get the logs you need, but I don't know how. What is a CORE LOG and how do I get it and the mDNS logs for you?

Karl :)

karl-fischer avatar Feb 14 '21 22:02 karl-fischer

Ok, thanks for investigation i will back some TCP option, you can see changes in the commit. CORE Log you can produce if you select Option on your Arduino: Debug Port : Serial Debug Level: CORE+WIFI+.....

Yurik72 avatar Feb 15 '21 07:02 Yurik72

Ok, in the Arduino IDE, I have set:

  • Debug Port: Serial
  • Debug Level: CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS

I unpaired the accessory, redownloaded the code with these new settings, paired it with my iPhoneX while the iPhoneX and iPad were both on WiFi. Then once paired, I turned off WiFi on the iPhoneX and watched the accessory in the Home app on the iPhoneX.

Approximate timeline. Please note, the times may be out by several seconds, I tried to write it down as best I could. Also, the amount of text which remains in the COM3 monitor window is limited and it cut of some of the early text, so I copy-pasted the entire text from the COM3 monitor window in to Notepad and saved it each time.

  • 17:32:17 Paired with Home app on iPhoneX while both iPhoneX and iPad were on WiFi.
  • 17:33:10 Turned off WiFi on iPhoneX and started watching Home app on iPhoneX to see accessory health. I did not touch the iPhone after this, just watched the Home app.
  • 18:03:47 (approximate) The accessory shows as 'No Response'.
  • 18:04:19 The accessory 'No Response' message cleared and it appears healthy again.
  • 18:06:35 (approximate) The accessory shows as 'No Response'.
  • 18:10:13 The accessory 'No Response' message cleared and it appears healthy again.
  • 18:11:?? (approximate) The accessory shows as 'No Response'.
  • 18:11:?? (approximate) The accessory 'No Response' message cleared and it appears healthy again.

3x debug logs attached.

Karl :)

debug log 1.txt debug log 2.txt debug log 3.txt

karl-fischer avatar Feb 15 '21 07:02 karl-fischer

I have tested and found this issue get worse from 148660a. @karl-fischer can you try running e59cab2 to see if helps you?

I have been trying different timer settings, but am still getting disconnects. It is acting like the socket keepalive isn't actually enabled. Looking to find a good place to test with iskeepaliveenabled option. @Yurik72 thoughts?

eford321 avatar Feb 19 '21 17:02 eford321

Looking to find a good place to test with iskeepaliveenabled option. @Yurik72 thoughts?

Actually I need investigate, because keep Alive work to me, I have played with delays and it works, even if I put phone to fly mode and than back in the given tima-out

@karl i will investigate your logs. thanks

Yurik72 avatar Feb 19 '21 19:02 Yurik72

Do you ever see the disconnects that I have in my logs on your devices?

My Wifi network is a Google Wifi mesh. I had compatibility problems with google/HomeKit a couple of years ago. I was able to adjust my network topology to get around previous issues. I'm interested to see if you see similar communications.

eford321 avatar Feb 19 '21 21:02 eford321

Yes, I saw your log, and my understanding you have changed socket options to more fast reproduce and test memory leaks 😊

Now I understand that is your standard behavior….

Definitely I had different picture and connections are stables with keep Alive, based on setting which on the github latest commit

As well I’m using this on 3 different environment and picture always the same. Environment is very simple two of them is quite old WiFi routers…

One of them Asus mesh system. So your network environment helps to find memory leak 😊

From: eford321 [email protected] Sent: Friday, February 19, 2021 11:42 PM To: Yurik72/ESPHap [email protected] Cc: Yurik72 [email protected]; Mention [email protected] Subject: Re: [Yurik72/ESPHap] Accessory 'No Response' (#52)

Do you ever see the disconnects that I have in my logs on your devices?

My Wifi network is a Google Wifi mesh. I had compatibility problems with google/HomeKit a couple of years ago. I was able to adjust my network topology to get around previous issues. I'm interested to see if you see similar communications.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/52#issuecomment-782375876 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDREXJZQVUSKEQOKQC3CB3S73LKXANCNFSM4XSTRICQ . https://github.com/notifications/beacon/AKDREXI7UFMQ4TFUFIXFE7DS73LKXA5CNFSM4XSTRIC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF2RBXRA.gif

Yurik72 avatar Feb 20 '21 07:02 Yurik72

Interesting I can run the EspHap_Switch and EspHapLed8266 examples without disconnects (no response) allowing HOMEKIT_MAX_CLIENTS = 8.
My WindowBlind sketch is totally idle, just running the hap_homekit_loop(); and has disconnects. I can't find anything I am doing with HAP setup that the examples are not doing. Can you look to see if I missed something? This sketch should run without a button, stepper motor or FRAM chip.

BTW, the heap problem appears to be completely fixed. eford321_WindowCover.ino.zip

eford321 avatar Feb 20 '21 21:02 eford321

Hi People :)

Have you tested with a remote client, via a Home Hub? That's the issue that I'm facing... the remote client shows the accessories as "No Response".

Yurik72, did you see anything helpful in my logs?

Oh, and my WiFi network is a Ubiquiti Unifi network. I have 2 WiFi access points, both are hard-wired back to the switch, but I can see the problem exists even when the clients are connected to the same WiFi access point (although it shouldn't matter).

Karl :)

karl-fischer avatar Feb 20 '21 22:02 karl-fischer

I did not try remotely. I will try that.

I do know older iPads aren’t good home hubs. That might be the problem.

Sent from my iPhone

On Feb 20, 2021, at 5:59 PM, karl-fischer [email protected] wrote:

 Hi People :)

Have you tested with a remote client, via a Home Hub? That's the issue that I'm facing... the remote client shows the accessories as "No Response".

Yurik72, did you see anything helpful in my logs?

Karl :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

eford321 avatar Feb 21 '21 00:02 eford321

I am using an iPad 8th generation as my Home Hub. This is the latest model and was released in 2020 :)

karl-fischer avatar Feb 21 '21 00:02 karl-fischer

Interesting findings. I am running the home app on my phone via LTE and via Wifi on my Mac (phone remote/Mac local). If I toggle the ESP-Switch from my phone, both the Mac and the phone show the change of icon. If I toggle from my Mac, the phone does not get updated. When I test my window blind sketch it works properly in the same scenario.

Here's the log of ESP-Switch. Client 1073698796 is my Mac, Client 1073698836 is my remote iPhone. ... 10:36:03.952 -> >>> Home Integration: homekit_is_paired 1 10:36:03.952 -> >>> HomeKit: Free heap: 31512 10:36:03.952 -> >>> HomeKit: Starting server 10:36:03.989 -> >>> HomeKit: storage init 0 10:36:03.989 -> >>> HomeKit: Using existing accessory ID: 3E:3A:0A:5E:12:9D 10:36:03.989 -> >>> HomeKit: find pairings 10:36:03.989 -> >>> HomeKit: Found admin pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239, disabling pair setup 10:36:03.989 -> >>> HomeKit: Configuring mDNS 10:36:03.989 -> >>> HomeKit: MDNS.begin: host-3E3A, IP: 192.168.1.56 10:36:03.989 -> >>> HomeKit: Init server over 10:36:03.989 -> Setting web server 10:36:04.156 -> Web site http://192.168.1.56 10:36:04.156 -> File system http://192.168.1.56/browse 10:36:04.191 -> Update http://192.168.1.56/update 10:36:13.493 -> pm open,type:2 0 10:36:29.043 -> >>> HomeKit: WiFiServer receives a new client (current 0, max 8) 10:36:29.043 -> >>> HomeKit: Got new client connection: local 192.168.1.56:5556, remote 192.168.1.13:50885 10:36:29.043 -> >>> HomeKit: [Client 1073698796] Got client content from the cache 0 10:36:29.112 -> >>> HomeKit: [Client 1073698796] new client accepted 10:36:29.112 -> >>> HomeKit: [Client 1073698796] Pair Verify Step 1/2 10:36:29.393 -> >>> HomeKit: Free heap: 22024 10:36:29.393 -> >>> HomeKit: [Client 1073698796] Pair Verify Step 2/2 10:36:29.393 -> >>> HomeKit: [Client 1073698796] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 10:36:30.187 -> >>> HomeKit: [Client 1073698796] Verification successful, secure session established 10:36:30.187 -> >>> HomeKit: Free heap: 22176 10:36:30.220 -> >>> HomeKit: [Client 1073698796] Get Accessories 10:36:30.220 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:36:30.259 -> >>> HomeKit: Free heap: 22224 10:36:30.259 -> switch_callback 10:36:30.259 -> set_switch:False 10:36:30.259 -> notify hap 10:36:30.259 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:36:30.259 -> >>> HomeKit: Free heap: 22224 10:36:43.160 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:36:43.160 -> >>> HomeKit: Free heap: 22416 10:36:43.160 -> switch_callback 10:36:43.257 -> set_switch:True 10:36:43.257 -> notify hap 10:36:44.311 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:36:44.311 -> >>> HomeKit: Free heap: 22416 10:36:44.311 -> switch_callback 10:36:44.345 -> set_switch:False 10:36:44.345 -> notify hap 10:36:48.224 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:36:48.224 -> >>> HomeKit: Free heap: 22416 10:36:48.224 -> switch_callback 10:36:48.224 -> set_switch:True 10:36:48.224 -> notify hap 10:36:49.262 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:36:49.262 -> >>> HomeKit: Free heap: 21920 10:36:49.262 -> switch_callback 10:36:49.262 -> set_switch:False 10:36:49.262 -> notify hap 10:36:52.805 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:36:52.839 -> >>> HomeKit: Free heap: 22416 10:36:52.839 -> switch_callback 10:36:52.839 -> set_switch:True 10:36:52.839 -> notify hap 10:36:54.057 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:36:54.057 -> >>> HomeKit: Free heap: 22416 10:36:54.057 -> switch_callback 10:36:54.057 -> set_switch:False 10:36:54.057 -> notify hap 10:37:09.130 -> >>> HomeKit: WiFiServer receives a new client (current 1, max 8) 10:37:09.130 -> >>> HomeKit: Got new client connection: local 192.168.1.56:5556, remote 192.168.1.28:49861 10:37:09.130 -> >>> HomeKit: [Client 1073698836] Got client content from the cache 1 10:37:09.130 -> >>> HomeKit: [Client 1073698836] new client accepted 10:37:09.130 -> >>> HomeKit: [Client 1073698836] Pair Verify Step 1/2 10:37:09.467 -> >>> HomeKit: Free heap: 21928 10:37:09.529 -> >>> HomeKit: [Client 1073698836] Pair Verify Step 2/2 10:37:09.529 -> >>> HomeKit: [Client 1073698836] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 10:37:10.288 -> >>> HomeKit: [Client 1073698836] Verification successful, secure session established 10:37:10.288 -> >>> HomeKit: Free heap: 22080 10:37:10.288 -> >>> HomeKit: [Client 1073698836] Get Accessories 10:37:10.326 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:37:10.358 -> >>> HomeKit: Free heap: 22128 10:37:10.358 -> switch_callback 10:37:10.358 -> set_switch:False 10:37:10.358 -> notify hap 10:37:10.429 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:37:10.429 -> >>> HomeKit: Free heap: 22128 10:37:16.723 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:37:16.723 -> >>> HomeKit: Free heap: 22096 10:37:16.723 -> switch_callback 10:37:16.723 -> set_switch:True 10:37:16.723 -> notify hap 10:37:39.462 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:37:39.496 -> >>> HomeKit: Free heap: 21928 10:37:39.496 -> switch_callback 10:37:39.496 -> set_switch:False 10:37:39.496 -> notify hap 10:38:56.807 -> >>> HomeKit: [Client 1073698796] Get Characteristics 10:38:56.807 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:38:56.807 -> >>> HomeKit: Free heap: 22096 10:38:56.807 -> switch_callback 10:38:56.807 -> set_switch:False 10:38:56.807 -> notify hap 10:38:56.807 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:38:56.807 -> >>> HomeKit: Free heap: 22096 10:38:56.807 -> switch_callback 10:38:56.807 -> set_switch:True 10:38:56.807 -> notify hap 10:39:09.926 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:39:09.926 -> >>> HomeKit: Free heap: 22096 10:39:09.926 -> switch_callback 10:39:09.926 -> set_switch:False 10:39:09.926 -> notify hap 10:44:51.759 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:44:51.759 -> >>> HomeKit: Free heap: 21968 10:44:51.759 -> switch_callback 10:44:51.759 -> set_switch:False 10:44:51.759 -> notify hap 10:44:55.654 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:44:55.654 -> >>> HomeKit: Free heap: 22096 10:44:55.654 -> switch_callback 10:44:55.654 -> set_switch:True 10:44:55.654 -> notify hap 10:45:01.075 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:45:01.075 -> >>> HomeKit: Free heap: 22096 10:45:01.075 -> switch_callback 10:45:01.075 -> set_switch:False 10:45:01.075 -> notify hap 10:45:07.214 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:45:07.214 -> >>> HomeKit: Free heap: 22096 10:45:07.214 -> switch_callback 10:45:07.271 -> set_switch:False 10:45:07.271 -> notify hap 10:45:09.073 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:45:09.073 -> >>> HomeKit: Free heap: 21928 10:45:09.073 -> switch_callback 10:45:09.073 -> set_switch:True 10:45:09.073 -> notify hap 10:45:12.511 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:45:12.511 -> >>> HomeKit: Free heap: 22096 10:45:12.511 -> switch_callback 10:45:12.511 -> set_switch:False 10:45:12.511 -> notify hap 10:46:49.801 -> >>> HomeKit: [Client 1073698836] Update Characteristics 10:46:49.801 -> >>> HomeKit: Free heap: 22096 10:46:49.801 -> switch_callback 10:46:49.801 -> set_switch:True 10:46:49.801 -> notify hap 10:46:55.880 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:46:55.880 -> >>> HomeKit: Free heap: 22096 10:46:55.880 -> switch_callback 10:46:55.880 -> set_switch:False 10:46:55.880 -> notify hap 10:49:56.419 -> >>> HomeKit: [Client 1073698796] Update Characteristics 10:49:56.419 -> >>> HomeKit: Free heap: 21904 10:49:56.419 -> switch_callback 10:49:56.419 -> set_switch:True 10:49:56.419 -> notify hap

eford321 avatar Feb 21 '21 15:02 eford321

Interesting, I will be able to check next few days, but this gives an answer of disconnection, I suppose not a problem to fix

Sent from my iPhone

On 20 Feb 2021, at 23:34, eford321 [email protected] wrote:

 Interesting I can run the EspHap_Switch and EspHapLed8266 examples without disconnects (no response) allowing HOMEKIT_MAX_CLIENTS = 8. My WindowBlind sketch is totally idle, just running the hap_homekit_loop(); and has disconnects. I can't find anything I am doing with HAP setup that the examples are not doing. Can you look to see if I missed something? This sketch should run without a button, stepper motor or FRAM chip.

BTW, the heap problem appears to be completely fixed. eford321_WindowCover.ino.zip

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Yurik72 avatar Feb 21 '21 16:02 Yurik72

I did’t find nothing special in the logs, mDNS works well

Sent from my iPhone

On 21 Feb 2021, at 00:59, karl-fischer [email protected] wrote:

 Hi People :)

Have you tested with a remote client, via a Home Hub? That's the issue that I'm facing... the remote client shows the accessories as "No Response".

Yurik72, did you see anything helpful in my logs?

Karl :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Yurik72 avatar Feb 21 '21 16:02 Yurik72

One question which is not clear completely, if memory leak problems still appear on the latest commit

Sent from my iPhone

On 20 Feb 2021, at 23:34, eford321 [email protected] wrote:

 Interesting I can run the EspHap_Switch and EspHapLed8266 examples without disconnects (no response) allowing HOMEKIT_MAX_CLIENTS = 8. My WindowBlind sketch is totally idle, just running the hap_homekit_loop(); and has disconnects. I can't find anything I am doing with HAP setup that the examples are not doing. Can you look to see if I missed something? This sketch should run without a button, stepper motor or FRAM chip.

BTW, the heap problem appears to be completely fixed. eford321_WindowCover.ino.zip

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Yurik72 avatar Feb 21 '21 17:02 Yurik72

Tried again after waiting more than 1 hour and it is now working normally. strange. Appears to have been an apple issue.

eford321 avatar Feb 21 '21 17:02 eford321

iOS 14.4 ?

Sent from my iPhone

On 21 Feb 2021, at 19:06, eford321 [email protected] wrote:

 Tried again after waiting more than 1 hour and it is now working normally. strange. Appears to have been an apple issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Yurik72 avatar Feb 21 '21 17:02 Yurik72

yes iOS 14.4 and Mac OS 11.2.1.

eford321 avatar Feb 21 '21 17:02 eford321

Yes, I saw your log, and my understanding you have changed socket options to more fast reproduce and test memory leaks 😊 Now I understand that is your standard behavior….

FYI, My blind sketch runs fine on a ESP32 I don't see any disconnects and I don't see "No Response"

Here's a 1 hour log for comparison ... ap_services added chararacteristic 0: 00000023-0000-1000-8000-0026BB765291 14:11:31.737 -> >>> Home Integration: hap_services added chararacteristic 1: 0000006D-0000-1000-8000-0026BB765291 14:11:31.737 -> >>> Home Integration: hap_services added chararacteristic 2: 0000007C-0000-1000-8000-0026BB765291 14:11:31.737 -> >>> Home Integration: hap_services added chararacteristic 3: 00000072-0000-1000-8000-0026BB765291 14:11:31.737 -> >>> Home Integration: homekit_is_paired 0 14:11:31.737 -> >>> HomeKit: Starting server 14:11:31.737 -> >>> HomeKit: Using existing accessory ID: FA:75:F6:63:03:43 14:11:31.737 -> >>> HomeKit: Configuring mDNS 14:11:53.547 -> >>> HomeKit: Got new client connection: 56 14:11:53.547 -> >>> HomeKit: [Client 56] Pair Setup 14:11:53.547 -> >>> HomeKit: [Client 56] Pair Setup Step 1/3 14:11:53.547 -> >>> HomeKit: [Client 56] new pairing content 14:11:53.547 -> >>> HomeKit: started crypto 14:11:53.580 -> >>> HomeKit: Free heap: 170644 14:11:55.010 -> >>> HomeKit: Calculating public key len=384 14:11:55.769 -> >>> HomeKit: Calculating public key result 0 14:11:55.769 -> >>> HomeKit: [Client 56] send_tlv_response 14:11:55.769 -> >>> HomeKit: [Client 56] send_tlv_response done 14:11:59.309 -> >>> HomeKit: [Client 56] Pair Setup 14:11:59.309 -> >>> HomeKit: [Client 56] Pair Setup Step 2/3 14:12:01.805 -> >>> HomeKit: [Client 56] Pair Setup 14:12:01.805 -> >>> HomeKit: [Client 56] Pair Setup Step 3/3 14:12:02.083 -> >>> HomeKit: Added pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 14:12:02.116 -> >>> HomeKit: Configuring mDNS 14:12:02.116 -> >>> HomeKit: [Client 56] Successfully paired 14:12:02.192 -> >>> HomeKit: [Client 56] Closing client connection 14:12:03.413 -> >>> HomeKit: Got new client connection: 57 14:12:03.413 -> >>> HomeKit: [Client 57] Pair Verify Step 1/2 14:12:03.479 -> >>> HomeKit: [Client 57] Pair Verify Step 2/2 14:12:03.479 -> >>> HomeKit: [Client 57] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 14:12:03.514 -> >>> HomeKit: [Client 57] Verification successful, secure session established 14:12:03.514 -> >>> HomeKit: [Client 57] Get Accessories 14:12:03.689 -> >>> HomeKit: [Client 57] Update Characteristics 14:12:03.723 -> >>> HomeKit: [Client 57] Update Characteristics 14:12:03.723 -> >>> HomeKit: [Client 57] Update Characteristics 14:12:03.824 -> >>> HomeKit: [Client 57] Add Pairing 14:12:04.104 -> >>> HomeKit: Added pairing with 0F8927F8-0F84-44E7-8181-8714ED73BD51 14:12:05.336 -> >>> HomeKit: Got new client connection: 58 14:12:05.336 -> >>> HomeKit: [Client 58] Pair Verify Step 1/2 14:12:05.369 -> >>> HomeKit: Got new client connection: 59 14:12:05.369 -> >>> HomeKit: [Client 59] Pair Verify Step 1/2 14:12:05.435 -> >>> HomeKit: [Client 58] Pair Verify Step 2/2 14:12:05.435 -> >>> HomeKit: [Client 58] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 14:12:05.435 -> >>> HomeKit: [Client 58] Verification successful, secure session established 14:12:05.469 -> >>> HomeKit: Got new client connection: 60 14:12:05.469 -> >>> HomeKit: [Client 59] Pair Verify Step 2/2 14:12:05.469 -> >>> HomeKit: [Client 59] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 14:12:05.469 -> >>> HomeKit: [Client 59] Verification successful, secure session established 14:12:05.502 -> >>> HomeKit: Got new client connection: 61 14:12:05.502 -> >>> HomeKit: [Client 60] Pair Verify Step 1/2 14:12:05.535 -> >>> HomeKit: [Client 58] Get Accessories 14:12:05.535 -> >>> HomeKit: [Client 61] Pair Verify Step 1/2 14:12:05.601 -> >>> HomeKit: [Client 59] Get Accessories 14:12:05.601 -> >>> HomeKit: [Client 60] Pair Verify Step 2/2 14:12:05.601 -> >>> HomeKit: [Client 60] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 14:12:05.639 -> >>> HomeKit: [Client 60] Verification successful, secure session established 14:12:05.639 -> >>> HomeKit: [Client 61] Pair Verify Step 2/2 14:12:05.639 -> >>> HomeKit: [Client 61] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 14:12:05.672 -> >>> HomeKit: [Client 61] Verification successful, secure session established 14:12:05.672 -> >>> HomeKit: [Client 60] Get Accessories 14:12:05.672 -> >>> HomeKit: [Client 61] Get Accessories 14:12:05.706 -> >>> HomeKit: [Client 60] Update Characteristics 14:12:05.706 -> >>> HomeKit: [Client 60] Get Characteristics 14:12:05.807 -> >>> HomeKit: [Client 59] Update Characteristics 14:12:05.807 -> >>> HomeKit: [Client 58] Get Characteristics 14:12:05.807 -> >>> HomeKit: [Client 59] Get Characteristics 14:12:05.807 -> >>> HomeKit: [Client 58] Update Characteristics 14:12:05.976 -> >>> HomeKit: [Client 61] Update Characteristics 14:12:06.014 -> >>> HomeKit: [Client 61] Get Characteristics 14:12:33.855 -> >>> HomeKit: [Client 57] Get Characteristics 14:12:36.205 -> >>> HomeKit: Got new client connection: 62 14:12:36.205 -> >>> HomeKit: [Client 62] Pair Verify Step 1/2 14:12:36.309 -> >>> HomeKit: [Client 62] Pair Verify Step 2/2 14:12:36.309 -> >>> HomeKit: [Client 62] Found pairing with 0F8927F8-0F84-44E7-8181-8714ED73BD51 14:12:36.309 -> >>> HomeKit: [Client 62] Verification successful, secure session established 14:12:36.309 -> >>> HomeKit: [Client 57] Update Characteristics 14:12:36.309 -> >>> HomeKit: [Client 62] Get Accessories 14:12:36.380 -> >>> HomeKit: [Client 62] Get Characteristics 14:12:36.483 -> >>> HomeKit: [Client 62] Update Characteristics 14:13:33.115 -> >>> HomeKit: [Client 60] Update Characteristics 14:13:33.915 -> >>> HomeKit: [Client 60] Get Characteristics 14:13:43.817 -> >>> HomeKit: [Client 58] Update Characteristics 14:13:55.264 -> >>> HomeKit: [Client 59] Update Characteristics 14:13:55.408 -> >>> HomeKit: [Client 61] Update Characteristics 14:13:57.466 -> >>> HomeKit: [Client 60] Update Characteristics 14:14:00.427 -> >>> HomeKit: [Client 60] Update Characteristics 14:14:06.784 -> >>> HomeKit: [Client 58] Update Characteristics 14:14:06.818 -> >>> HomeKit: [Client 58] Update Characteristics 14:14:07.866 -> >>> HomeKit: [Client 60] Update Characteristics 14:14:08.144 -> >>> HomeKit: [Client 60] Update Characteristics 14:14:08.393 -> >>> HomeKit: [Client 60] Update Characteristics 14:14:19.138 -> >>> HomeKit: [Client 57] Get Characteristics 14:18:10.334 -> >>> HomeKit: [Client 57] Update Characteristics 14:27:29.891 -> >>> HomeKit: [Client 60] Update Characteristics 14:27:29.926 -> >>> HomeKit: [Client 57] Update Characteristics 14:27:42.992 -> >>> HomeKit: [Client 60] Update Characteristics 14:36:09.564 -> >>> HomeKit: [Client 57] Closing client connection 14:36:16.078 -> >>> HomeKit: Got new client connection: 63 14:36:16.078 -> >>> HomeKit: [Client 63] Pair Verify Step 1/2 14:36:16.146 -> >>> HomeKit: [Client 63] Pair Verify Step 2/2 14:36:16.146 -> >>> HomeKit: [Client 63] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 14:36:16.181 -> >>> HomeKit: [Client 63] Verification successful, secure session established 14:36:16.181 -> >>> HomeKit: [Client 63] Get Accessories 14:36:16.335 -> >>> HomeKit: [Client 63] Get Characteristics 14:47:35.578 -> >>> HomeKit: [Client 60] Closing client connection 14:51:24.480 -> >>> HomeKit: Got new client connection: 56 14:51:24.480 -> >>> HomeKit: [Client 56] Pair Verify Step 1/2 14:51:24.616 -> >>> HomeKit: [Client 56] Pair Verify Step 2/2 14:51:24.616 -> >>> HomeKit: [Client 56] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 14:51:24.616 -> >>> HomeKit: [Client 56] Verification successful, secure session established 14:51:24.616 -> >>> HomeKit: [Client 56] Get Accessories 14:51:24.616 -> >>> HomeKit: [Client 56] Update Characteristics 15:04:49.234 -> >>> HomeKit: [Client 56] Update Characteristics 15:10:43.333 -> >>> HomeKit: [Client 63] Closing client connection 15:10:47.475 -> >>> HomeKit: Got new client connection: 57 15:10:47.475 -> >>> HomeKit: [Client 57] Pair Verify Step 1/2 15:10:47.581 -> >>> HomeKit: [Client 57] Pair Verify Step 2/2 15:10:47.581 -> >>> HomeKit: [Client 57] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 15:10:47.581 -> >>> HomeKit: [Client 57] Verification successful, secure session established 15:10:47.628 -> >>> HomeKit: [Client 57] Get Accessories 15:11:27.514 -> >>> HomeKit: [Client 58] Closing client connection 15:11:27.960 -> >>> HomeKit: Got new client connection: 60 15:11:27.960 -> >>> HomeKit: [Client 60] Pair Verify Step 1/2 15:11:28.061 -> >>> HomeKit: [Client 60] Pair Verify Step 2/2 15:11:28.061 -> >>> HomeKit: [Client 60] Found pairing with 6FDD5BE0-78E1-4A4C-B5D7-98277EEFA239 15:11:28.096 -> >>> HomeKit: [Client 60] Verification successful, secure session established 15:11:28.096 -> >>> HomeKit: [Client 60] Get Accessories 15:11:28.149 -> >>> HomeKit: [Client 60] Update Characteristics 15:11:58.930 -> >>> HomeKit: [Client 56] Update Characteristics 15:11:59.219 -> >>> HomeKit: [Client 56] Update Characteristics 15:12:16.613 -> >>> HomeKit: [Client 57] Update Characteristics 15:12:16.682 -> >>> HomeKit: [Client 57] Get Characteristics 15:12:33.789 -> >>> HomeKit: [Client 60] Update Characteristics

eford321 avatar Feb 23 '21 20:02 eford321

So, do you think it is an ESP8266 issue? And that it works fine on the ESP32?

Did you see any "No Response" when running your iPhone on LTE?

karl-fischer avatar Feb 24 '21 00:02 karl-fischer

So, do you think it is an ESP8266 issue? And that it works fine on the ESP32?

Did you see any "No Response" when running your iPhone on LTE?

Hard to tell so far. There is definitely an issue with the code on an ESP8266, but I don't see it with a smaller sketch like the switch. Could also be the iPad. There are several reports on reddit saying the iPad's wifi sleep causes issues. Do you have an appletv or HomePod you can try as a hub?

eford321 avatar Feb 24 '21 00:02 eford321

ESP-32 went into no response after 2+ hours. Debug isn't as detailed, but here's the log. Worked until 17:19. ESP32 log.txt.zip ...

eford321 avatar Feb 24 '21 00:02 eford321

Hmm, originally I was using an iPad Air, and it was several years old so I thought maybe that was the issue. So I bought a brand new iPad 8th gen, but still causes the issue (as discussed).

My preference is to use the iPad as the Home Hub, because it is fixed to the wall and designed to remain in the house when I sell, but yes, I do have an AppleTV 4k. I will set that up as the Home Hub and test.

I'll do that now...

karl-fischer avatar Feb 24 '21 01:02 karl-fischer

Ok, I have set up my Apple TV 4k as a Home Hub, re-added the Accessory and tried to operate the accessory from my iPhone with WiFi turned off.

The accessory still shows as "No Response". When I click on the switch to turn it on/off, it does work, but it still shows as "No Response" the whole time.

I closed the Home app on my iPhone and opened it again, the Accessory is now showing as healthy. I'll sit and watch it for a few minutes....

Has been going for 30mins and seems to be working ok. The accessory on the iPhone has not said, "No Response".

karl-fischer avatar Feb 24 '21 05:02 karl-fischer

Hi for Esp32 I have to port several bug fixes which is found on esp8266, I will keep you informed. Do you have any other Apple devices an what is their behavior . For instance I’m comparing with Eve elgato and would say that behavior the same ( reboot router, phone to fly mode, etc)

Sent from my iPhone

On 24 Feb 2021, at 02:52, eford321 [email protected] wrote:

 ESP-32 went into no response after 2+ hours. Debug isn't a detailed, but here's the log. Worked until 17:19 in the attached log ESP32 log.txt.zip ...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Yurik72 avatar Feb 24 '21 06:02 Yurik72

No worries on the ESP32. I am still focused on ESP8266 as I have 8 blinds running on them that I want to convert to ESP-HAP from MQTT/Homebridge. I loaded my sketch on a ESP32 to see if there was any difference. Are you asking about my devices or @karl-fischer ? I have 29 homekit devices in my network. All have been very reliable.

eford321 avatar Feb 24 '21 15:02 eford321

Asked, both. Ok clear seams some bug still present, however I do not see ‘no response’ on esp32 in my home managed by Apple TV, they always healthy.

Sent from my iPhone

On 24 Feb 2021, at 17:02, eford321 [email protected] wrote:

 No worries on the ESP32. I am still focused on ESP8266 as I have 8 blinds running on them that I want to convert to ESP-HAP from MQTT/Homebridge. I loaded my sketch on a ESP32 to see if there was any difference. Are you asking about my devices or @karl-fischer ? I have 29 homekit devices in my network. All have been very reliable.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Yurik72 avatar Feb 24 '21 16:02 Yurik72

The ESP32 definitely performs better than the 8266, but it still fails after some time. I am not able to compile with debug on the ESP32 for more information. See #52

Do you have an ESP8266 to test with?

On Wed, Feb 24, 2021 at 11:05 AM Yurik72 [email protected] wrote:

Asked, both. Ok clear seams some bug still present, however I do not see ‘no response’ on esp32 in my home managed by Apple TV, they always healthy.

Sent from my iPhone

On 24 Feb 2021, at 17:02, eford321 [email protected] wrote:

 No worries on the ESP32. I am still focused on ESP8266 as I have 8 blinds running on them that I want to convert to ESP-HAP from MQTT/Homebridge. I loaded my sketch on a ESP32 to see if there was any difference. Are you asking about my devices or @karl-fischer ? I have 29 homekit devices in my network. All have been very reliable.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/52#issuecomment-785183492, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNX7J6RAS5H3U3TI56WHA3TAUPUXANCNFSM4XSTRICQ .

eford321 avatar Feb 24 '21 16:02 eford321