etwmc / Personal-HomeKit-HAP

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

It works like a charm on our yunCUL + FHEM + PHK.. no issue #75

Open core-c opened 6 years ago

core-c commented 6 years ago

Hi, We're running PHK on an Arduino Yún, and it all works great. Yes, even on a Yún, HAP pairing is performed in a flash. It's really MUCH! faster than our initial solution, FHEM+NodeJS+HomeBridge. For people who use systems other than Yún, it may not be obvious that, that combination's performance is insufficient for a Yún: Pair-setup took 7 minutes!, and pair-verify also took several minutes to execute. We did a lot of research before we started creating our "yunCUL", our culfw based version, that runs on a Yún's atmega32u4. Converting the existing nanoCUL software to work on a Yún was easy: within days we got our prototype up and running, communicating @868MHz with thermostats etc., without the need for an external (USB connected) "CUL". The Linux/OpenWRT side of the Yún runs FHEM, which controls the yunCUL. So far, so good.. Then, we wanted Homekit support for our yunCUL. "OK, let's see what info is available out there".. "o, There is already a FHEM-Homebridge module. Let's use it.". Easier said than done (with our Yún): We ended up cross-compiling LEDE for Yún (FPU emulation enabled firmware), to get NodeJS running (in which we succeeded). However, NodeJS on an Arduino Yún runs too slow. The fiddling with BigInts took way too long, and we were never able to finish a pairing in time. 7 minutes! for just the pair-setup. It was obvious the Yún was not powerful enough to do it the NodeJS way. "How about doing the same crypto stuff in C? It must be quicker". That's when we found PHK. And, it works. By now,.. we've rewritten the PHK software (because, sorry to say, your code is "all over the place"), but in essence the heart of the code is still the same (I've emailed you a copy of our HAP.h & HAP.cpp). HAP pairing is done really fast. So fast that even a Yún can handle the crypto stuff. It is really magnitudes faster. Thanks for PHK, your project helped us out a lot. <<< Greets, UJE.

abrownsword commented 6 years ago

This project seems to have gone stale. Perhaps you could fork and share your code?

etwmc commented 6 years ago

Unfortunately, I got a job in the smart home field, so I can’t contribute any code without my manager approval (otherwise I would have fixed a couple of bugs and trolled  with free HomeKit camera app already) But if @core-c can send the changes as a pull request, I can make it the master branch

core-c commented 6 years ago

I shared all sources of our project on the FHEM forum, in the English Corner: https://forum.fhem.de/index.php/topic,85688.0.html

Sorry for the late response,.. Meanwhile we changed some parts of our own code, (we now use a different string handling for our json purposes), but the published sourcecodes are complete (and working), although a bit older. Our current software uses less memory, and has better error-handling.. It's very close to our final first version.

I do not have an intention to provide support and maintain the sourcecode. It would eat up too much of my time. However, i can ask to make our private GitHub go public. Greetings..