hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
153 stars 82 forks source link

library not working on Debian Jessie (ARM, x64) #9

Closed sophienyaa closed 8 years ago

sophienyaa commented 8 years ago

I have been unable to connect to the HomeKit bridge when then application is running (my code, and basic example code)

I can telnet to the IP on the correct port and the app registered a connection, but cannot connect using HomeKit Catalog, or EVE

However, the example code (and my own code) works fine on Mac OS X and Windows 7.

I thought at first it might be something to do with the ARM arcitecture of the Pi, however after trying it on Debian Jessie x64 (on the same machine I tested under windows 7 on) I am thinking it has something to do with debian jessie

rain3k commented 8 years ago

hm.. me too.. i want to work in raspberry pi 2.so i try to run in raspberry pi 2. but .. this library didn't work......i can't browsing accessories list in iPhone app i think ....network,port is fine....
this library work in my mac book pc...but don't work in raspberry pi.......

andylintner commented 8 years ago

If you're not already, try using the InetAddress argument in the HomekitServer constructor. Java's decision when determining that progmatically seems off on some platforms.

sophienyaa commented 8 years ago

I've tried adding that argument to the HomekitServer constructor, does not seem to make a difference.

e.g

InetAddress in = InetAddress.getLocalHost(); HomekitServer homekit = new HomekitServer(in, PORT);

andylintner commented 8 years ago

That's the same thing the constructor without the argument does. Try passing in an InetAddress for the IP bound to the interface you want the service on - Java is likely picking a different one (i.e. a local unused interface)

sophienyaa commented 8 years ago

I've tested the below on both Raspbian Jessie (RPi Zero) and Debian Jessie (x64) and can confirm its working fine.

e.g

InetAddress in = InetAddress.getByName("192.168.0.31"); HomekitServer homekit = new HomekitServer(in, PORT);

thanks @beowulfe for the suggestions and thanks again for providing this library :)

andylintner commented 8 years ago

Great! Glad it worked!

rglorius commented 7 years ago

Hi there,

i've got the library working glad on my Mac and i can still connect via Home-App. Thats very nice!

But on my Raspi3 there is still an error. After the usage of the InetAddress hint from mickwheelz the bridge still appears in the Home-App, but after insert the Security-Token the connection fails.

Do you have an tip for ip settings on the raspi or an other solution?

Best regards, Robert