Closed dfrommi closed 3 years ago
I'd expect exactly what you're describing if you didn't correctly implement HomekitAuthInfo.
I'd expect exactly what you're describing if you didn't correctly implement HomekitAuthInfo.
I have the same problem since a few months.
I added now debug code to my AuthInfo implementation. After restarting only getMac() is called, even if I restart the Home app on my iPad. getMac returns the correct ipv4 mac in XX:XX:XX:XX:XX.XX format.
I don't think AuthInfo is causing this, except it's related to the MAC address. Is the problem related to ipv4/ipv6?
public boolean hasUser() from AuthInfo should be called as well. depending on returned value Java-HAP decide to advertise or not the bridge for pairing. hasUser = true means the bridge is paired already and cannot be paired anymore hasUser = false mains the bridge is not paired and be advertised via mDNS as ready for pairing
public boolean hasUser() from AuthInfo should be called as well. depending on returned value Java-HAP decide to advertise or not the bridge for pairing. hasUser = true means the bridge is paired already and cannot be paired anymore hasUser = false mains the bridge is not paired and be advertised via mDNS as ready for pairing
Thank's for pointing that out. I missed that change in the interface because it has a default implementation.
I started fresh on my iPad and repaired. During that process createUser was called (as expected).
12:50:50.291 HAP0: HomekitAuthInfo: createUser
however 10 seconds laster
12:51:00.088 HAP0: HomekitAuthInfo: removeUser
Then I rebooted the iPad and it couldn't connect anymore. I commented out the removeUser implementation and paired again and now it works as expected.
Any thoughts on this?
Can I change public boolean hasUser() at runtine from true to false and the system will become discoverable again?
the only place where "removeUser" is called in java-hap is PairingUpdateController that calls this function on "remove pairing" message from client / home. if you dont have anywhere in your code "removeUser" then it is your ipad that request unpairing
if you change the hasUser to true you need to call "HomekitRoot.refreshAuthInfo()" to discoverability
@yfre Thank you so much for pointing to the hasUser
method. That was also the reason for my "no response" issue.
It might, however, be a good idea to remove the default implementation. There's - as far as I understand - no scenario where the default implementation would be sufficient. For a working integration, it always has to be overridden and return different values depending on the state.
Issue resolved by implementing HomekitAuthInfo.hasUser()
Hello,
I'm facing a very strange problem with HAP-Java now... Whenever I restart the app that's using HAP-Java, the Home app on iPhone shows "no response" for all accessories managed by HAP-Java. When I re-pair the bridge, everything is working fine. But as soon as I restart the app, "no response" is shown again and I have to pair again.
TRACE-log is enabled and while I see a lot of communication going on during the pairing process, I hardly see anything after restart.
The latest log statements related to HAP-Java after restart are
Then nothing HAP-related anymore.
I first thought that reading the configuration from my homekit.json file is the issue, but the mac-address matches the value from the json-file.
It looks to me like the iPhone wouldn't even try to connect. So maybe something related to advertising? But I have no clue how to debug that, so help would be very much appreciated.
I have the same issue with HAP-Java version 87bab73be807fec98b4f51b4a97326e3fd21045a as well as 45d9403dac182aae4e9de6c171b16b97b89f3e1c, just to rule out that the jmDNS change has caused the issue.
Not sure what else could be useful, so please let me know what info I should provide.
Thanks a lot already and I hope very much someone can point me in the right direction.