Yes yes, iOS has access to OH. When all accessories are added it works for some time (i.e. 2-4 days) and then suddenly all accessories are unavailable… and only removing the bridge and adding again (with configuring all of them again of course in Home App) helps
when you get “no response” again, please check with discovery app whether you still see openhab there. if not then it is probably the same issue as reported here
I got the same problem since I update from 3.0.1 to 3.1.0M2.
After the upgrade HomeKit didn‘t work anymore. I re-added it again on my ipad sucessfully.
Everything was working, but for 2 hours only.
Now its not connecting anymore.
Restart didn‘t solve.
_hap._tcp is not directly related to homekit items, but rather kind of DNS server that tells home app, that openhab offers homekit bridge.
if you dont see it, then it could be 2 kind of issues
network issues. something block the mDNS traffic (it is multicast traffic which is sometime tricky)
it is an issue with DNS implementation openHAB uses.
if it is the issue 2. then restart of openhab should help. restarting of the binding or adding/removing bridge will not solve it.
another option to verify what is the actual issue, is to execute command line tool “mdns-scan” directly in your docker container. it is command line tools that lists all mDNS entries. if you see _hap._tcp in container but not outside, then it is network issue.
Same for me. After updating to Milestone 2 the Homekit items get “no response” after a time (few hours).
Restart homekit in the Karaf helps for a few hours. bundle:refresh org.openhab.io.homekit
root@WeWeNAS-3:/openhab# mdns-scan
bash: mdns-scan: command not found
Restarting OH did solve the problem the last time - even deleting the container didn’t solve the problem - I had to Clear the Pairings, delete the tmp/Cache folder outside the Container to make it work again - However this solved the problem for a few hours only
This is the last entry before HomeKit was terminated last night.
Thats the next entry in the logfile showing the sessions are terminated
2021-03-03 23:34:10.065 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.115:49657
2021-03-03 23:34:10.367 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.192:49477
2021-03-03 23:34:10.800 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.183:50045
2021-03-03 23:34:11.966 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.174:54734
2021-03-03 23:34:16.649 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.139:59952
2021-03-03 23:34:18.396 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.191:59081
2021-03-03 23:34:18.411 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.135:57081
2021-03-03 23:34:57.083 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.185:49417
2021-03-03 23:35:18.245 [DEBUG] [.server.impl.http.impl.BinaryHandler] - Exception in binary handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358) ~[?:?]
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247) ~[bundleFile:4.1.42.Final]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1147) ~[bundleFile:4.1.42.Final]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [bundleFile:4.1.42.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
2021-03-03 23:35:18.246 [DEBUG] [rver.impl.http.impl.AccessoryHandler] - Exception caught in web handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358) ~[?:?]
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247) ~[bundleFile:4.1.42.Final]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1147) ~[bundleFile:4.1.42.Final]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) ~[bundleFile:4.1.42.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
2021-03-03 23:35:18.250 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.134:50912
2021-03-03 23:36:03.301 [DEBUG] [.server.impl.http.impl.BinaryHandler] - Exception in binary handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358) ~[?:?]
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247) ~[bundleFile:4.1.42.Final]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1147) ~[bundleFile:4.1.42.Final]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [bundleFile:4.1.42.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
2021-03-03 23:36:03.302 [DEBUG] [rver.impl.http.impl.AccessoryHandler] - Exception caught in web handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358) ~[?:?]
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247) ~[bundleFile:4.1.42.Final]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1147) ~[bundleFile:4.1.42.Final]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) ~[bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) ~[bundleFile:4.1.42.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
2021-03-03 23:36:03.304 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.5.132:51580
Update: Bundle refresh this work this time as well for me - but not the last time.
hm. from log files i cannot say much. especially surprising that you had to re-do pairing, this does not fit to my assumption that it is linked to mDNS issues. but i still think i can mDNS.
i have added namely recently following logic to the binding:
if openHAB and homekit are configured for the same IP address then homekit binding uses the mDNS server of openHAB instead of starting its own mDNS server. this should reduce memory usage and avoid 2 mDNS servers on the same machine. The library used by openHAB and homekit for mDNS is the same.
if you can have multiple IP address for the same docker, you could try to configure one IP for openHAB and another for homeKit binding. this would force homekit binding to start mDNS server as it did before recent changes.
if it is really the issue with that change, i think, i should make this feature configurable
I’m happy to support with further testings if this helps.
However I’m not 100% sure what exactly to setup in the docker container.
how can I run the mdns-scan?
what do I need to do exactly to use a different IP for Homekit to use a different mDNS server?
Can you tell me what I can do exactly?
I just had to restart the bundle again to get homekit running again.
I have to do it almost every hour
Thanks a lot
Update: I had to restart the bundle again this morning and it solved the issue again.
When this happened the first time after Upgrade to OH3.1.0M2 this approach didn‘t work as mentioned before. It seems this was only the case until I deleted tmp/cache and cleared the pairings.
Maybe this was a result of the upgrade process?
Not sure this helps for your investigations.
i am experiencing a similar issue on Snapshot 3.10. build 2232. I am not sure if this is related. After some time, very random, the connection gets lost. What works with me is to change in openHAB in the HomeKit integration settings the port from e.g. 9123 to 9124 and the items are immediately restored again in the IOS app.
I found maybe the problem - but not sure yet.
port 9124 was never opened in the Docker container to the outside network…
However this was never required in OH2.5 and OH 3.0 was working as well.
I just added this port and restarted the container, and HomeKit connected again automatically.
Maybe this was just be chance - will monitor further and keep you updated.
hmm, i am running in Docker as well ( in host mode ), for me both 9123 and 9124 work well but the issue comes with both ports. As discribed above, i change the port backwards and/or forwards and i suspect this triggers a re-connect and everything is working fine again until connection gets lost again. btw no entry in the log in my case.