For those of you who just want to start playing with the Raspberry Pi and your Z-wave devices, this is pretty much the laziest way. I took the latest Wheezy Rasbian (2012-10-28) image, grabbed all the updates, put nginx, php, and a couple open-zwave clients and servers into a new downloadable disk image. The image will unzip using 7-zip to fit on a 2 gb card but there is not a lot of empty space since I did not remove anything from the default image other than the python_games folder.
- Download the image: openZwavePi-12-12-12.7z (445mb)
- Write the image to your SD card. Great tutorial.
- Plug everything in including your Aeon Labs Z-stick S2. (I recommend paring it with at least one Z-wave device before you start up your Pi so you can see the magic from the very start.) The image is already set up to run headless, so you don’t have to plug in your keyboard or monitor unless desired.
- Let it boot up. Normally, this goes pretty quick and you can watch the lights blink on the Pi rapidly. I would give it a couple minutes just to be safe.
- If you went headless, ssh to [email protected] from any machine on your network. The password is still set to the default ‘raspberry’.
- There are two options for starting the open-Zwave socket server depending on what client you want to use. Option 1 was made by Conrad Vassallo and is call Lights Control. It has a nice interface and lots of functionality – I would consider it the “default. The second, is a very basic version made by me without any bells and whistles. To start option 1, type “lightscontrol” on the command line. Option 2 will start if you type “basic”. Both servers cannot run at the same time, but you can switch between them by typing “killOZW” and then the command for whatever server you want to start up.
- Then to control your lights, navigate to http://openzwave.local/ (if you are using option 1) or http://openzwave.local/basic/ if you are using option 2. To log in to Lights Control, you will need to type in “Admin” for the username and “admin” for the password (note the case). The first time you load Light Control without any imported devices, it will return an error after you put in the password. To clear up this error, enter “http://openzwave.local/index.php?r=devices” after you have authenticated and click the “import” button. From then on, you should be good to go.
A Few Notes:
The software is very much still under development and this is just a quick start. The security, configuration, permissioning, and future upgrades are up to you but what you have is an almost immediately working open-Zwave solution. I also recommend taking your time between opening and closing the different servers. Every time one of the open-Zwave servers start up, it contacts all the nodes and runs through their status and configuration. As your network grows, this process takes a little longer.
I ran the initial version on a 2gb class 2 SanDisk card and it ran quickly so anything better should have great performance.
I switch back and forth between the servers a lot and Alison was always checking two urls to turn on the Christmas tree (firstworldproblem).
To fix this, I created a file called “indexbasic.php” and put it in the /usr/share/nginx/www/ directory. It contains the following code:
<!--?php header("Location: /basic/"); </pre-->
Then I made a copy of the default index I had in the root directory:
cp /usr/share/nginx/www/index.php /usr/share/nginx/www/indexlightscontrol.php
and I updated my /home/pi/.bashrc to switch in the appropriate index page when I launched a specific open-Zwave server.
alias lightscontrol='cp /usr/share/nginx/www/indexlightscontrol.php /usr/share/nginx/www/index.php && ozw && nohup ./lightscontrol-server > /dev/null &' alias basic='cp /usr/share/nginx/www/indexbasic.php /usr/share/nginx/www/index.php && ozw && nohup ./basic-server > /dev/null &'