Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated docs

  • Loading branch information...
commit a5ca73683ff86dee76543496e54427249d160ede 1 parent ce1112f
@ekarak authored
Showing with 86 additions and 18 deletions.
  1. +41 −6 INSTALL.txt
  2. +45 −12 README-OpenZWave.txt
View
47 INSTALL.txt
@@ -1,21 +1,56 @@
BUILD DEPENDENCIES
-==============
+==================
(this will work on Ubuntu12.x/Debian 6, you have to adjust according to your distro)
+# Install development environment
+sudo apt-get install ruby1.9.1-dev libxml2-dev libxslt-dev libudev-dev libtool autoconf
+
# Debian package dependencies
-sudo apt-get install ruby1.9.1-dev gccxml libxml2-dev libxslt-dev
-sudo apt-get install libboost1.42-dev libboost_system1.42-dev libboost_thread1.42-dev libboost-filesystem1.42-dev libboost-program-options1.42-dev
+sudo apt-get install libboost1.42-dev libboost_system1.42-dev libboost_thread1.42-dev libboost-filesystem1.42-dev libboost-program-options1.42-dev
+# Ubuntu has a convenience package for all Boost dev libs, much more elegant!
+sudo apt-get install libboost-dev-all
+
+1a) Install GCCXML + its Ruby bindings (Ubuntu/Debian)
+======================================================
# installs the ruby GCCXML client gem without compiling the 'gccxml' executable
# since it was delivered by Debian package
+sudo apt-get install gccxml
sudo gem1.9.1 install gccxml_gem --platform ruby
sudo gem1.9.1 install mongrel --pre
sudo gem1.9.1 install rspec bit-struct onstomp
-GCCXML alternative install
-==================
+1b) OR, install GCCXML via ruby gems
+====================================
The alternative path is to install GCCXML from Ruby's gem package management.
-Do this ONLY if you have a fairly older gcc, otherwise you WILL get errors during building like
+Do this ONLY if you have a fairly older gcc(4.3 or earlier), otherwise you WILL
+get tons of errors during compilation, like this:
"gccxml-builtins.h: no such file or directory"
sudo gem1.9.1 install rbgccxml
+
+2) install BoostStomp
+=====================
+git clone https://github.com/ekarak/BoostStomp
+cd BoostStomp
+make && sudo make install
+
+3) install Apache Thrift
+========================
+git clone https://git-wip-us.apache.org/repos/asf/thrift.git thrift
+cd thrift
+./bootstrap.sh
+./configure
+make && sudo make install
+
+4) download OpenZWave
+=====================
+svn checkout http://open-zwave.googlecode.com/svn/trunk/ open-zwave-read-only
+cd open-zwave-read-only/cpp/build/linux
+make
+
+5) compile ozwd!
+================
+cd Thrift4Ozw
+sudo make openzwave-install
+make
View
57 README-OpenZWave.txt
@@ -64,16 +64,25 @@ Hook up your ZWave USB controller. Default is set at /dev/ttyUSB0, you can use t
Other ozwd command-line flags are:
ekarak@ekarak-laptop ~/ozw/Thrift4OZW $ ./ozwd --help
-Project Ansible - OpenZWave orbiter:
- -? [ --help ] print this help message
- -h [ --stomphost ] arg STOMP server hostname
- -s [ --stompport ] arg STOMP server port number
- -t [ --thriftport ] arg Thrift service port
- -c [ --ozwconf ] arg OpenZWave config/ path (manufacturer database)
- -u [ --ozwuser ] arg OpenZWave user path (network & configuration state)
- -p [ --ozwport ] arg OpenZWave driver port (e.g. /dev/ttyUSB0)
+----------------------------------------
+Project Ansible - OpenZWave orbiter
+----------------------------------------
+command-line arguments:
+ -? [ --help ] print this help message
+ -h [ --stomphost ] arg (=localhost) external STOMP server hostname
+ -s [ --stompport ] arg (=61613) external STOMP server port number
+ -t [ --thriftport ] arg (=9090) our Thrift service port
+ -c [ --ozwconf ] arg (=/home/ekarak/ozw/open-zwave-read-only/config/)
+ our OpenZWave manufacturer database
+ -u [ --ozwuser ] arg (=/home/ekarak/ozw/Thrift4OZW)
+ our OpenZWave user config database
+ -p [ --ozwport ] arg (=/dev/ttyUSB0) our OpenZWave driver port
+ -j [ --json ] Should stomp messages have JSON body?
+ -d [ --debug ] Show debug logging from OpenZwave and
+ BoostStomp?
+
-- Fire up ./ozwd, preferrably in a debugger (gdb ./ozwd)
+- Fire up ./ozwd, preferrably in a debugger (gdb ./ozwd) if you need to trace its internals.
The OpenZWave orbiter tries to connect to the Stomp Server (localhost:61613) and then
starts the OpenZWave engine. When all ZWave processing is done, it also fires up the
@@ -99,7 +108,7 @@ irb(main):002:0> OZWmgr.GetNodeName(HomeID, 5)
# Switch on node 2
irb(main):003:0> OZWmgr.SetNodeOn(HomeID, 2)
=> nil
-(*tack*) did you see the baanshee turning on the christmas tree lights?? :-)
+# (*tack*) did you see the baanshee turning on the christmas tree lights?? :-)
# Set dimmer node 5 at 50% via SetNodeLevel
irb(main):004:0> OZWmgr.SetNodeLevel(HomeID, 5, 50)
@@ -123,19 +132,43 @@ irb(main):012:0> OZWmgr.SetValue_UInt8(Rvid,50)
irb(main):013:0> OZWmgr.GetValueAsByte(Rvid)
=> <OpenZWave::Bool_UInt8 retval:true, o_value:50>
+# Set that value to 25 (percent if its a dimmer)
irb(main):014:0> OZWmgr.SetValue_UInt8(Rvid,25)
=> true
+# Set it to 0
irb(main):015:0> OZWmgr.SetValue_UInt8(Rvid,0)
=> true
+
-------------------
STOMP Notifications
-------------------
-Also take a look at ozw-monitor.rb, its a basic STOMP client in Ruby listening for OpenZWave
+The other useful feature of the Ruby client example is OpenZWave notifications.
+Take a look at ozw-monitor.rb, its a basic STOMP client in Ruby listening for OpenZWave
notifications. The script uses the BitStruct library to break down ValueIDs into fields.
Take into account that you should keep all ValueID's in a Hash or Array for subsequent
-calls to OpenZWave.
+calls to OpenZWave. All asynchronous notifications will appear in the irb console:
+
+------ ZWAVE MESSAGE (2013-03-31 10:37:34 +0300) ------
+ NotificationByte : 0
+ NotificationNodeId : 0x1
+ notification type: Type_DriverReady: A driver for a PC Z-Wave controller has been added and is ready to use. The notification will contain the controller's Home ID, which is needed to call most of the Manager methods.
+ destination : /queue/zwave/monitor
+ session : ssng_1364715183.7324069
+ message-id : ekarak-laptop-1364715183-871618-2349
+ subscription : 1
+
+------ ZWAVE MESSAGE (2013-03-31 10:37:34 +0300) ------
+ NotificationByte : 0
+ NotificationNodeId : 0x1
+ notification type: Type_NodeAdded: A new node has been added to OpenZWave's list. This may be due to a device being added to the Z-Wave network, or because the application is initializing itself.
+ destination : /queue/zwave/monitor
+ session : ssng_1364715183.7324069
+ message-id : ekarak-laptop-1364715183-907925-2350
+ subscription : 1
+
+
----------------------------
OpenZWave + other languages
Please sign in to comment.
Something went wrong with that request. Please try again.