etwmc / Personal-HomeKit-HAP

This project will provide source code to build a HomeKit support accessories.
MIT License
236 stars 85 forks source link

OpenWrt #51

Closed beckmx closed 8 years ago

beckmx commented 8 years ago

I have an openwrt device but I was wondering if anyone here have already tried it?, I already tried this repo on AriettaG25, Intel Edison

venche commented 8 years ago

Hi

I ported to the openwrt using openwrt(mdns) but it fails to puublish the services anyone done it succesfully..

beckmx commented 8 years ago

Can I fork your code? I have been trying to port it to an eclipse IDE but no luck

etwmc commented 8 years ago

If I remember correctly, the current version should be able to run on OpenWRT. (Assuming you got the endian part and depend right. ) You don't need eclipse. Just download the OpenWRT SDK, put the whole thing as a subproject, then run the SDK builder. It will build the PHK and its depends (along side with the OpenWRT). Then you just install the packages. I tested it before September, but I left that router at home. (Before you ask, it's one Pacific Ocean away. So all I can do is troubleshooting here, and see if any of my time machine backup has it. Sorry about that)

beckmx commented 8 years ago

actually u give me tons of hope lol, I already installed PHK in some other chips, but this one uses OpenWRT nd is the tiniest, I am gonna try, I will let u know

2015-10-22 2:34 GMT-05:00 etwmc notifications@github.com:

If I remember correctly, the current version should be able to run on OpenWRT. (Assuming you got the endian part and depend right. ) You don't need eclipse. Just download the OpenWRT SDK, put the whole thing as a subproject, then run the SDK builder. It will build the PHK and its depends (along side with the OpenWRT). Then you just install the packages. I tested it before September, but I left that router at home. (Before you ask, it's one Pacific Ocean away. So all I can do is troubleshooting here, and see if any of my time machine backup has it. Sorry about that)

— Reply to this email directly or view it on GitHub https://github.com/etwmc/Personal-HomeKit-HAP/issues/51#issuecomment-150132052 .

straccio commented 8 years ago

If can help i'm trying to use Docker for cross compiling.

beckmx commented 8 years ago

I have my own cross compile unit, I am using the Black Swift image to do so, but I have a doubt, when just doing "make" I get the error:

-dns_sd.h no such file or directoy

For a Linux distribution I can just install avahi or bonjour, however I was wondering if it is correct to look somewhere for the file and just add it to the treefile, it looks just a file by itself.

Btw my cross compilation image was taken from http://www.black-swift.com/wiki/index.php?title=C/C%2B%2B_Building_and_Remote_Debugging_with_Eclipse

Greetings!

etwmc commented 8 years ago

Assuming you can install package in the image, you can still get avahi for dns_sd.h from OpenWRT https://github.com/openwrt/packages/tree/master/libs/avahi

beckmx commented 8 years ago

Hello, I could compile all the files for OpenWRT, but I got stuck in the last last of the Makefile, there is one line that says:

LINK += -ldns_sd

Althought I included the header file of the dns_sd.h and looks it compiles perfectly, when it reaches the link phase the compiler says there are no references to some data types, any advice on how to include the dns_sd.h be part of the project without referencing in the link phase?

greetings!

beckmx commented 8 years ago

Hey @etwmc I finally got it compiled, but I updated to iOS 9, it seems that is not able to scan the devices with PHK

etwmc commented 8 years ago

Does it not show up on the scanning, or can not be pair? For the first case, is the service appear on the Bonjour service? (You can check it with any Bonjour browser) If it does appear, can you send me the TXT records of service? Normally a device won't be scan if the device said it has already been paired, but in OpenWRT case, I don't think that's what happened.

beckmx commented 8 years ago

hello, sorry for the late reply I have been making huge tests on several chinese boards, one very important part was the understanding of OpenWRT and all it implies, so now that phase is clear and I can now install images on will. However on tiny devices I still have the same problem, the program does run, because no errors are showed or prompted or nothing.

But yes I noticed the avahi/mdnsresponder service is not active because when I run a bonjour scan I dont see anything at all, I guess I have to verify that it actually is running properly, I will keep you inform these days because I managed to get the tiniest board on the market ;)

Greetings

beckmx commented 8 years ago

Okay, I forced-run the avahi-daemon to output the log to console, it looks it correctly starts and everything and when I scan with a bonjour scanner it looks it registers two services but when I start the PHK it doesnt register the new service. Here is the output

root@OpenWrt:/etc/avahi# avahi-daemon Found user 'nobody' (UID 65534) and group 'nogroup' (GID 65534). Successfully dropped root privileges. avahi-daemon 0.6.31 starting up. WARNING: No NSS support for mDNS detected, consider installing nss-mdns! Loading service file /etc/avahi/services/http.service. Loading service file /etc/avahi/services/ssh.service. Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::20d:2ff:fe18:1622. New relevant interface wlan0.IPv6 for mDNS. Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.2.10. New relevant interface wlan0.IPv4 for mDNS. Joining mDNS multicast group on interface br-lan.IPv6 with address fd38:b032:8a07::1. New relevant interface br-lan.IPv6 for mDNS. Joining mDNS multicast group on interface br-lan.IPv4 with address 192.168.1.1. New relevant interface br-lan.IPv4 for mDNS. Network interface enumeration completed. Registering new address record for fe80::20d:2ff:fe18:1622 on wlan0.. Registering new address record for 192.168.2.10 on wlan0.IPv4. Registering new address record for fd38:b032:8a07::1 on br-lan.. Registering new address record for 192.168.1.1 on br-lan.IPv4. Registering HINFO record with values 'MIPS'/'LINUX'. Server startup complete. Host name is skylab.local. Local service cookie is 429550128. Service "Secure Shell on skylab" (/etc/avahi/services/ssh.service) successfully established. Service "Web Server on skylab" (/etc/avahi/services/http.service) successfully established. Withdrawing address record for 192.168.2.10 on wlan0. Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.2.10. Interface wlan0.IPv4 no longer relevant for mDNS. Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.2.10. New relevant interface wlan0.IPv4 for mDNS. Registering new address record for 192.168.2.10 on wlan0.IPv4.

beckmx commented 8 years ago

Update The OpenWRT actually blocks scripts to avoid losing memory, so I activated avahi and mdns daemons on boot and all of a sudden the PHK started working, it looks cool indeed

daanpape commented 7 years ago

Hi, how have you solved the OpenWRT compilation. I'm trying to accomplish this on barrier breaker but I'm getting the dns_sd.h error although I've compiled avahi dns.

Thanks in advance, Daan

etwmc commented 7 years ago

Can you check where the build package copied the dns_sd.h to the build path?