Installing HAP-NodeJS on a Raspberry Pi

I recently starting trying to get USB webcams working with HomeKit.  As I looked for information on the web it looked a bit daunting to implement since Homekit doesn’t officially support web cam just yet.  Some very smart people have done the hard work to get webcams working in HomeKit so it was much easier than I initially thought.

Below is a script to get HAPNodeJS installed and functioning. This is the first step before getting into creating new accessory for live video feeds displaying in HomeKit.

I have used this on RPI 1, 2, and 3 without issues. Works overtime for me but it is key you do this first before anything else. You need to execute this as pi and NOT root. It tells you when you when its necessary to use sudo for each steps.

$ cd /home/pi
$ sudo apt-get update
$ sudo apt-get install git-core libnss-mdns libavahi-compat-libdnssd-dev -y
$ sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb
$ sudo dpkg -i node_latest_armhf.deb
$ sudo rm -rf node_latest_arm*
$ sudo npm install -g node-gyp
$ git clone https://github.com/KhaosT/HAP-NodeJS.git
$ cd HAP-NodeJS
$ sudo npm install

Special thanks to Alex Skalozub, who reverse engineered the server side HAP.  You can find his research at here. (Sadly, on Nov 4, 2016, Apple sent the DMCA request to Github to remove the research.)

More information is on GitHub: https://github.com/KhaosT/HAP-NodeJS

Leave a Reply

Your email address will not be published. Required fields are marked *