Intro: Z-Wave Controller Setup on PcDuino
Z-Wave is a wireless communications protocol designed for home automation, specifically to remotely control applications in residential and light commercial environments. The technology uses a low-power RF radio embedded or retrofitted into electronics devices and systems, such as lighting, home access control, entertainment systems and household appliances.
We follow the steps in post to install z-wave controller on pcDuino. Here we show how to do z-wave on pcDuino.
Step 1: Parts List
1 x pcDuino v2
1 x Aeon DSA02203-ZWUS Labs Z-Wave Z-Stick Series 2 USB Dongle
1 x Jasco 45609 Z-Wave Wireless Lighting Control On/Off Switch
Step 2: Install Z-wave Switch
First, we need to make sure we shutdown power to the branch. The Z-wave switch needs main power (110V) to power it up. As shown below, we connect the hot of line in (Black wire) and neutral (White wire) to the lower end (where the LED is located). We also need to connect the hot wire of load (Black wire) to the upper end. We also hook up the ground.
To see if we get it correct to connect the line in, we can then turn on the breaker. If the connection is correct, we will see the blue LED on.
Step 3: Pair the Z-stick With Switch
The Z-stick has built-in battery. We come close to the z-wave switch and press button on the Z-stick once, the LED on z-stick will slowly blink. Then, we press the z-wave switch once, the LED on z-stick will blink much faster, which means the pairing is successful. We press the button on z-stick again to finish the pairing.
Step 4: Install and Test Software on PcDuino
1. Install build-essentials, make, subversion applications (maybe others).
$sudo apt-get install build-essential make subversion libudev-dev
2. Plug in z-stick
3. Install open-zwave:
$svn checkout http://open-zwave.googlecode.com/svn/trunk/ open-zwave
This step will take some time.
4. Build the open-zwave example to test if everything is Okay.
(change Makefile if your device is not at /dev/ttyUSB0)
While this is running – hit the button on the switch and we will see some output from test, and it will create a config file – zwcf_yourhome.xml, where yourhome is replaced by a hex string.
5. Install openzwave-control-panel.
$svn checkout http://openzwave-control-panel.googlecode.com/svn/trunk/ openzwave-control-panel
6. Install libmicrohttpd.
$tar -xzvf libmicrohttpd-0.9.20.tar.gz
$sudo make install
7.Went to back to openzwave-controller
Edit file ‘Makefile”, and make sure OPENZWAVE and LIBMICRoHTTPD are as below:
OPENZWAVE := ../open-zwave
LIBMICROHTTPD := /usr/local/lib/libmicrohttpd.a
We also need to uncomment the three lines for linux:
# for Linux uncomment out next three lines
LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/linux/*.a)
LIBUSB := -ludev
LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB)
Then we compile by:
8. Time to test (the number after p is port number):
$./ozwcp -p 55555
Before we run ozwcp, we need to copy the directory ‘config’ from open-zwave to openzwave-control-pannel.
9. On a PC, launch browser, and point to http://pcduino_ip_address:55555
We input ‘/dev/ttyUSB0′ under device name, and hit button ‘Initialize’, then we will see our z-wave switch shown up under tab devices, we can then turn on and off the switch!