Introduction: Raspberry Pi 2 Homekit - From Zero to Hey, Siri (Updated)

UPDATE:

Added the "ready to use" image file link to the youtube video description.

Download, write to SD, and ready to use.

UPDATE 2:

Rpi ZERO version:

Hi,

In this instructable, i will show you, how to install Homekit Bridge to your RPi 2, and control your home accessories.

There is a youtube video too, with step by step tutorial.

For me, Homekit on the RPi2 not worked well with other OS (Raspian), only with a Jessie image.

Tutorial video:

STEP 1 >>

Step 1: Step 1: Install Jessie

Tools needed:

- Jessie OS (version 2015-08-30)

http://sysprogs.com/files/SD/2015-08-30-jessie-ras...

- WinFlashTool (for write image to SD)

http://winflashtool.sysprogs.com/

Download the image and the WFTool from the links, put the image file into the WFTool, and install the OS to the SD

(First step in the video)

Step 2: Step 2: Installs, Installs Everywhere...

1:

Boot the RPi2 with Jessie.

Open a terminal program on your PC/MAC (im using putty)

Connect to your RPi2 with the putty (RPi2 ip found in your router DHCP client list)

Username: pi

Password: raspberry

In the youtube video find this step at 1:17.

2:

next, the ragular update and upgrade:

sudo apt-get update && sudo apt-get upgrade -y

In the youtube video find this step at 1:35.

3:

Add yourself superuser privileges (less "sudo" type)

sudo su

In the youtube video find this step at 2:13

4:

Install python-dev and python-pip

apt-get install python-dev python-pip

In the youtube video find this step at 2:21

5:

Install libavahi and libdnssd

apt-get install libavahi-compat-libdnssd-dev

In the youtube video find this step at 2:27

6:

Download and install the latest node

wget http://node-arm.herokuapp.com/node_latest_armhf.d...

dpkg -i node_latest_armhf.deb

In the youtube video find this step at 2:37

7:

Check node and npm version and installation

node -v

npm -v

8:

Clone Homekit Bridge from github, and go into the HAP-NodeJS folder

git clone https://github.com/KhaosT/HAP-NodeJS.git

cd HAP-NodeJS

In the youtube video find this step at 3:04

9:

There is a lot of missing modules, so install all of them in one command.

npm install -g node-gyp
npm install node-persist && npm install srp && npm install mdns && npm install ed25519 && npm install curve25519 && npm install debug && npm install python-shell

In the youtube video find this step at 3:37

10:

Rebuild

npm rebuild


Step 3: Step 3: Add New Light Accessory

1:

Go into accessories folder, and make a new light accessory:

cd accessories

nano myLight_accessory.js

In the youtube video find this step at 5:13

2:

Copy in this empty .js file everything from the linked homekit.txt file, from the

//Light accessory line

Homekit.txt link:

https://drive.google.com/file/d/0B6GR9Hj5Ut61bDZle...

Rename the accessory, change a little the "username" (looks MAC address, watch out the HEX rules)

Save the file and exit

In the youtube video find this step at 5:46

Step 4: Step 4: Make the Python Files to Control GPIO Pins

1:

in the HAP-NodeJS folder, make a new python folder, go into.

cd ..

mkdir python

cd python

In the youtube video find this step at 7:07

2:

Make the GPIO "on" and "off" python file

nano light1.py

Copy this into:

import RPi.GPIO as GPIO
GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(16, GPIO.OUT)

GPIO.output(16, 1)

Save, and close the file

nano light0.py

Copy this into:

import RPi.GPIO as GPIO
GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(16, GPIO.OUT)

GPIO.output(16, 0)

Save, and close the file

In the youtube video find this step at 7:19

3:

Connect a led GND into one of the RPi2 GND pin. Im used the outer line 3. pin, and connect the led "+" pin tho the RPi2 GPIO.16 pin. Thats the 8. pin in the outer line.

Test the python codes:

python light1.py (led turn on)

python light0.py (led tudn off)

If everything ok, go back to HAP-NodeJS folder.

cd ..

npm rebuild

In the youtube video find this step at 8:14

4:

Start the Homekit Bridge.

node Core.js

Step 5: Stap 5: Config Ios Device

1:

In the video, im using Apple HMCatalog app, but find better homekit app, like EVE elgato.

Add a new home, some room, and one of the rooms, add your new light accessory.

The PIN: 03145154

Add anyway.

In the youtube video find this step at 9:28

2:

Test it, enjoy it!

Thank you.