Before you can install HomeBridge on a Raspberry Pi Zero W, you must first provide it with Raspbian OS. How to install your Raspberry Pi Zero W, you can read in one of my previous blogs here. Now that you have a Raspberry Pi Zero W running on Raspbian OS, well configured and connected to your Wi-Fi network. You are ready to install HomeBrige on your Raspberry Pi Zero W.
Access your Raspberry Pi Zero W
First open the Terminal on your mac. The first thing to understand about Terminal is that it’s just an application and it lives in the Utilities folder in Applications. You launch it like any other and when you do, you’ll see Apple’s implementation of a Unix command-line environment, known as a shell. Make a connection to your Raspberry Pi Zero W by typing SSH [email protected] where XXX.XXX.XXX.XXX is the IP Address from your Raspberry Pi Zero W.
SSH [email protected].XXX.XXX.XXX
Note: If you don’t know your IP address you can use LanScan you can get it here. LanScan is a free, simple and efficient IPv4 network scanner that discovers all active devices on any sub net: the local one, or any public sub net that you configure.
Now you will be prompted to typ your password (default Raspberry, you should change this as soon as possible).
On a ‘regular’ Raspberry Pi it is very simple to install HomeBridge, but on a Pi Zero it’s just a bit more complicated. For this step-by-step plan I used the HomeBridge maker’s tutorial. Where necessary, I adapted this to the Pi Zero (W).
Install ‘git’ and ‘make’ by typing
sudo apt-get install git make
When done Install ‘nodejs‘ Install the latest version of Node.js. For this, visit the Node.js website and find the latest version for ARMv6. Copy the link to the latest version (do not download the file) and type wget and then paste the link.
Then extract the downloaded file (the tarball).
tar xJvf node-v8.9.3-linux-armv6l.tar.xz
Create a new directory / opt / node
sudo mkdir -p /opt/node
and copy the files to that directory.
sudo mv node-v8.9.3-linux-armv6l/* /opt/node/
Let’s make sure that updates are processed correctly:
sudo update-alternatives --install "/usr/bin/node" "node" "/opt/node/bin/node" 1
sudo update-alternatives --install "/usr/bin/npm" "npm" "/opt/node/bin/npm" 1
UPDATE 21-12-20: A reader of my blog told me that he had explained on his blog how to install the lates NodeJS on your raspberry PI 0 W and if I could link to it, So here it is. How to install the latest NodeJS on Raspberry PI 0 W?
Installing the the required packages
Avahi is a fully LGPL framework for Multi cast DNS Service Discovery. It allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example you can plug into a network and instantly find printers to print to, files to look at and people to talk to. The Avahi is a prerequisite for HomeBridge, so you can install it by typing.
sudo apt-get install libavahi-compat-libdnssd-dev
This may take a considerable amount of time. Be patient and while waiting you can look around at my site
sudo npm install -g --unsafe-perm homebridge hap-nodejs node-gyp
sudo npm install --unsafe-perm bignum
sudo /opt/node/bin/node-gyp BUILDTYPE=Release rebuild
Yes it works!
Since no plugins are yet installed, you will not be able to handle it, but the base is laid. Check out what plugins there are? That can be done on my site of course and here!
You can stop HomeBridge by typing
CTRL + C
Now you only need a power supply to power your HomeBridge, No other cables needed!
Do you have any questions? Leave a comment down below!
Nick Farina (Nov 14 2017), Homebridge, Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API., https://github.com/nfarina/homebridge Jonker Media (Okt 17 2017) Install Homebridge on Raspberry Pi Zero, https://www.jonkermedia.nl/iot/deel-4-installeren-homebridge-op-raspberry-pi-zero/