Comments (13)
Tried modding values from "arduino_homekit_server.cpp" file :
FROM
#define HOMEKIT_MAX_CLIENTS 8
#define CLIENT_CONTEXT_CACHE_SIZE 8
TO
#define HOMEKIT_MAX_CLIENTS 12
#define CLIENT_CONTEXT_CACHE_SIZE 12
Didn't helped so far, am I using too many accessories ?
from esphap.
Hello usually this happens if compilation setting lwIP is not valid
According to doc
! Note for ESP8266 boards select lwIP Variant :v2 High bandwidth. Device behaviours is more stable especially in pairing process
from esphap.
Hello @Yurik72 and thanks for your answer.
I'm using an ESP32, not an ESP8266.
So I really don't know what is happening here.
Trying to compile with DEBUG MODE enabled to see if I can gather additionnal reasons of why this is happening.
from esphap.
This happens if tcp stack overfull. usually not happening on ESP32, therefore i thinking about ESP8266.
I meet couple of times when debugging. and didn't catch how to improve. after reboot esp. usually disappears
from esphap.
With Core debug level set to DEBUG at compilation time, I just get nothing more in the console's output :
14:10:47.482 -> [ 18043][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 12 - AP_STACONNECTED
14:10:47.652 -> [ 18212][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
14:10:58.731 -> >>> HomeKit: Got new client connection: 49
14:10:58.731 -> >>> HomeKit: [Client 49] Pair Setup
14:10:58.731 -> >>> HomeKit: [Client 49] Pair Setup Step 1/3
14:10:58.731 -> >>> HomeKit: [Client 49] new pairing content
14:10:58.731 -> >>> HomeKit: started crypto
14:10:58.731 -> >>> HomeKit: Free heap: 106488
14:11:00.361 -> >>> HomeKit: Calculating public key len=384
14:11:01.203 -> >>> HomeKit: Calculating public key result 0
14:11:01.203 -> >>> HomeKit: [Client 49] send_tlv_response
14:11:01.203 -> >>> HomeKit: [Client 49] send_tlv_response done
14:11:07.590 -> >>> HomeKit: [Client 49] Pair Setup
14:11:07.590 -> >>> HomeKit: [Client 49] Pair Setup Step 2/3
14:11:10.577 -> >>> HomeKit: [Client 49] Pair Setup
14:11:10.577 -> >>> HomeKit: [Client 49] Pair Setup Step 3/3
14:11:10.577 -> [HAP] Storage changed ... Success (File created) + (File written)
14:11:10.851 -> >>> HomeKit: Added pairing with 808FF924-3E08-4301-9626-58130226B6E1
14:11:10.892 -> >>> HomeKit: Configuring mDNS
14:11:10.892 -> >>> HomeKit: [Client 49] Successfully paired
14:11:10.970 -> >>> HomeKit: [Client 49] Closing client connection
14:11:11.015 -> >>> HomeKit: Got new client connection: 49
14:11:11.015 -> >>> HomeKit: [Client 49] Pair Verify Step 1/2
14:11:11.092 -> >>> HomeKit: [Client 49] Pair Verify Step 2/2
14:11:11.093 -> >>> HomeKit: [Client 49] Found pairing with 808FF924-3E08-4301-9626-58130226B6E1
14:11:11.093 -> >>> HomeKit: [Client 49] Verification successful, secure session established
14:11:11.125 -> >>> HomeKit: [Client 49] Get Accessories
14:11:11.388 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.422 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.422 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.465 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.465 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.465 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.465 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.497 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.497 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.497 -> >>> HomeKit: [Client 49] Update Characteristics
14:11:11.497 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.531 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.531 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.564 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.564 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.564 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.564 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.651 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.651 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.651 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.688 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.688 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.688 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.725 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.725 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.759 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.759 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.759 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.830 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.830 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.830 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.867 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.867 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.899 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.944 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.944 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.944 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:11.978 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:12.020 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:12.020 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:12.020 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:12.067 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:12.202 -> >>> HomeKit: [Client 49] Get Characteristics
14:11:17.428 -> >>> HomeKit: [Client 49] Closing client connection
What is supposed to engage a "Closing client connection" ?
Is this one of the functions contained in "arduino_homekit_server.cpp" file ?
from esphap.
Tried with Core debug level set to VERBOSE : Nothing new :(
What I've tried :
- Paired the device and all its accessories (with Base/Main accessory considered as a Bridge)
- Once pairing ends, 5 seconds after last communication from iOS device to the ESP32, I get the infamous line : ">>> HomeKit: [Client 49] Closing client connection"
- Rebooted the ESP32 and tried to send a command which did not worked at first, then I sent another and it worked.
- Tried to send multiple commands subsequently without waiting until the 5 seconds : worked fine without any problem
- Waited 5 seconds and got the message again : ">>> HomeKit: [Client 49] Closing client connection"
I just don't understand what is happening here ...
from esphap.
Regarding 5. In my memory this is OK, Apple can close connection after paired. Than it should opened again. If it brings any trouble ?
from esphap.
The infamous ">>> HomeKit: [Client 49] Closing client connection" absolutely doesn't happen when having only 3-5 accessories.
But as soon as we have 6/7 devices : it starts to show.
- Having 8 or more accessories initialized makes the UI on HomeKit recognizes the first one as a Hub/Bridge.
At some point, I may try the HomeSpan library just to see if it acts the same.
from esphap.
@Yurik72 : Just te be sure of something, I tried to initialize as this :
- 1 main/Base accessory with 6 services
- 5 additional accessories
Everything working fine and got absolutely no closing connection message at some point ... even waiting for some minutes.
Instead, I get the "Get Characteristics" message showing up approximatively every minute :
- 14:36:54.761 -> >>> HomeKit: [Client 49] Get Characteristics
- 14:37:55.660 -> >>> HomeKit: [Client 49] Get Characteristics
- 14:38:56.683 -> >>> HomeKit: [Client 49] Get Characteristics
- 14:39:57.700 -> >>> HomeKit: [Client 49] Get Characteristics
This is definitely driving me crazy.
from esphap.
Pretty sure it is this damn "bridge" thing that is enabling itself automatically at some point when using 8 accessories or more on the same device.
Any chance there is a parameter/function that avoids the device of being considered as a bridge ?
from esphap.
@Yurik72 : Just te be sure of something, I tried to initialize as this :
- 1 main/Base accessory with 6 services
- 5 additional accessories
Everything working fine and got absolutely no closing connection message at some point ... even waiting for some minutes. Instead, I get the "Get Characteristics" message showing up approximatively every minute :
- 14:36:54.761 -> >>> HomeKit: [Client 49] Get Characteristics
- 14:37:55.660 -> >>> HomeKit: [Client 49] Get Characteristics
- 14:38:56.683 -> >>> HomeKit: [Client 49] Get Characteristics
- 14:39:57.700 -> >>> HomeKit: [Client 49] Get Characteristics
This is definitely driving me crazy.
FYI @Yurik72 : I've just tried with these settings and got it 100% working :
- 1 main/Base accessory with 2 services (strangely 1st one is not shown ... but I don't have the BRIDGE thing showing up this time on HomeKit UI on iOS device // pretty sure my initial problem root cause was the BRIDGE thing here being autodetected for an unknown reason)
- 9 additional accessories
STATUS >>> 100% working ... this is driving me nuts but I'll use it like that as ... so far it is the only working solution I have
from esphap.
Interesting informations around the BRIDGE thing that might be helpful at some point :
isBridged | Apple Developer Documentation
from esphap.
Well I can't understand some things here.
Did a lot of tests and here are some results :
- With 2 SERVICES on BASE ACCESSORY + 4 additionnal ACCESSORIES >>> IOS UI shows 2 ACCESSORIES on MAIN + 4 ACC >>> OK except first two are necessarily in the same room
- With 2 SERVICES on BASE ACCESSORY + 6 additionnal ACCESSORIES >>> IOS UI shows 2 ACCESSORIES on MAIN + 6 ACC >>> OK except first two are necessarily in the same room
- With 1 SERVICE on BASE ACCESSORY + 7 additionnal ACCESSORIES >>> IOS UI considers BRIDGE MODE, only 7 additionnal ACCESSORIES are available and can be separated into multiple rooms BUT the infamous "Closing client connection" happens
- With 0 SERVICE on BASE ACCESSORY + 7 additionnal ACCESSORIES >>> IOS UI does not show any HomeKit device at time of detection (before pairing)
- With 2 SERVICES on BASE ACCESSORY + 10 additionnal ACCESSORIES >>> IOS UI shows 2nd SERVICE on MAIN + 10 additionnal ACCESSORIES + no infamous "Closing client connection" after some seconds of idling + 1st SERVICE from BASE ACCESSORY is not shown at all
- With 2 SERVICES on BASE ACCESSORY + 14 additionnal ACCESSORIES >>> IOS UI considers BRIDGE MODE, no SERVICES from MAIN + 14 additionnal ACCESSORIES + Infamous "Closing client connection" happens after some seconds of idling
I'm considering modifying the library in order to be able to declare MAIN ACCESSORY unique SERVICE as a BRIDGE and then, initializing every single service as additionnal accessories.
@Yurik72 : What would be your advice here ? do you have any input on this situation ? Thanks
At time of initialization, I'm using :
hap_setbase_accessorytype(homekit_accessory_category_window_covering);
hap_initbase_accessory_service("HOSTNAME", "MANUFACTURER", "SERIALNUMBER", "MODEL", "FIRMWAREVERSION");
HomeKit_Svc_SVC0 = hap_add_windowcovering_service("SVC0", HAP_SVC0_update, 0);
HomeKit_Svc_ACC2 = hap_add_windowcovering_as_accessory(homekit_accessory_category_window_covering, "ACC2", HAP_ACC2_update, 0);
from esphap.
Related Issues (20)
- Naming Issue on Multiple Accessories
- ESP32 stucks on "HomeKit: Configuring mDNS" HOT 2
- Notify not working on ios 16 beta HOT 1
- Multiple LEDs
- Pairing issue HOT 2
- Defining limits (min_value, max_value, min_step, unit, format, etc ...) HOT 4
- Cooler + Heater : How to ? HOT 1
- SLAT do not show up on HomeKit after pairing HOT 1
- Setting initial values for FLOAT type HOT 2
- NAME characteristics showing on IOS just at time of pairing and then ESP name HOT 2
- error unknown type name 'curve25519_key'
- Quick question - not an issue
- Compilation failed for ESP32C3
- Compilation Error HOT 1
- Regarding the issue with iPhone version 16.5。
- Compilation error in ESPHap_Button HOT 2
- All devices "No response" under iOS 16.6 HOT 2
- Pair Setup Step 3/3 : InstructionFetchError OR LoadProhibited when having >24 characteristics loaded HOT 3
- What is related to "context" in accessory/service definition ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esphap.