Openzwave vs python : again

zwave iconYou are trying to use openzwave with python ? Me too :)
Here are some informations on how I do it and some patches. .

This how-to is deprecated. Look at the new version.

 

 

 

Deprecated : No more maintained.
You may/will have problems to apply the patches so do it manually.

Download

First of all, download py-openzwave:

git clone https://github.com/Whytey/py-openzwave.git

Go to py-openzawe directory and remove old openwave sources.

cd py-openzwave
rm -Rf openzwave

Get the new one from openzwave site :

svn checkout http://open-zwave.googlecode.com/svn/trunk/ openzwave

Get all the patches :

Patch

Assuming that you are in the py-openzwave, apply the patches you have downloaded :

patch -p1 <openzwave.1a.pyx.patch
patch -p1 <openzwave.1b.pyx.patch
...

Update setup.py :

else:
ext_modules = [extension.Extension("openzwave", ["openzwave.pyx"],
libraries=['udev', 'stdc++'],
language="c++",
- extra_objects=['openzwave/cpp/lib/linux/openzwave.a'],
+ extra_objects=['openzwave/cpp/lib/linux/libopenzwave.a'],
include_dirs=['openzwave/cpp/src', 'openzwave/cpp/src/value_classes', 'openzwave/cpp/src/platform']

Compile

Compile the openzwave library :

cd openzwave/cpp/build/linux
make

And the python library :

cd ../../../..
python setup.py build

If the compilation succes, install it :

python setup.py install

And test it :

python
import openzwave

Known bugs :

- ambiguous overloaded in setvalue : fixed