Creating my own ZWave network

Aus DL8RDS Wiki
Wechseln zu: Navigation, Suche

1 Background

I have been experimenting with ZWave devices a long time. There are two ZWave controllers I have cast my eye on:

The prior was using a very weak CPU, was very slow, so I decided against it. The latter, oh yes, It got fucked up. And I bricked it, more or less.

The reason was that the device wanted to install an upgrade imge. As always, upgrades are good. So I triggered the upgrade. Unfortunately the upgrade (legacy, standard Vera firmware from the vendor, directly, no tinkering) was corrupt, returning the Vera into a state where it would not react any more. No more. Period. Not even a reset was possible. Nothing.

Whenever I am getting angry, I want to find out if there is a way in. Maybe a serial interface?

2018-08-06-vera1.jpg 2018-08-06-vera2.jpg

2018-08-06-vera3.jpg 2018-08-06-vera4.jpg

So if you take a Dremel like me and try to open the case, it's quite difficult... You easily cut the case in a way so that you won't be able to reassemble it. :-)

2 Next Attempt

Since I got really angry about having a useless Vera, I decided to build my own.

2.1 Components

  • HAMMOND Case
  • Raspberry Pi 3B+
  • Raspberry Cam
  • Neutrik Socket Cinch
  • Neutrik Socket Ethernet
  • Acrylic pane
  • Switch
  • Several standoffs
  • Banana plug sockets

And I have been using these ZWave modules:

Still not using this one:

2.2 Hardware Construction

2018-08-06-vera1 new.jpg 2018-08-06-vera2 new.jpg

2018-08-06-vera3 new.jpg 2018-08-06-vera4 new.jpg

Initially I wanted to use the round hole for a radar detection unit, but since the optical image motion detection was good enough, I decided to use it for the ZWave pairing button.

2018-08-06-vera5 new.jpg

This is how it looks now:

2018-08-12-vera1 new.jpg 2018-08-12-vera2 new.jpg

Note that I exchanged the ZWave module. I am using the one from Conrad Elektronik now. The reason is that I am a little discontent with the small antenna of the old module.

2018-08-12-vera3 new.jpg 2018-08-12-vera4 new.jpg

2.3 Software

2.4 Basic Open ZWave Installation

I am using a standard Respberry Pi Raspbian GNU/Linux 9. And I have intalles OpenZWave according to the following instruction:

https://github.com/OpenZWave/python-openzwave

The following

pyozw_check -i -d /dev/ttyAMA0

gives me:

2018-08-07 16:49:29.812 Always, ***************************************************************************
2018-08-07 16:49:29.812 Always, *********************  Cumulative Network Statistics  *********************
2018-08-07 16:49:29.812 Always, *** General
2018-08-07 16:49:29.812 Always, Driver run time: . .  . 0 days, 0 hours, 0 minutes
2018-08-07 16:49:29.812 Always, Frames processed: . . . . . . . . . . . . . . . . . . . . 8
2018-08-07 16:49:29.812 Always, Total messages successfully received: . . . . . . . . . . 8
2018-08-07 16:49:29.813 Always, Total Messages successfully sent: . . . . . . . . . . . . 9
2018-08-07 16:49:29.813 Always, ACKs received from controller:  . . . . . . . . . . . . . 9
2018-08-07 16:49:29.813 Always, *** Errors
2018-08-07 16:49:29.813 Always, Unsolicited messages received while waiting for ACK:  . . 0
2018-08-07 16:49:29.813 Always, Reads aborted due to timeouts:  . . . . . . . . . . . . . 0
2018-08-07 16:49:29.813 Always, Bad checksum errors:  . . . . . . . . . . . . . . . . . . 0
2018-08-07 16:49:29.814 Always, CANs received from controller:  . . . . . . . . . . . . . 0
2018-08-07 16:49:29.814 Always, NAKs received from controller:  . . . . . . . . . . . . . 0
2018-08-07 16:49:29.814 Always, Out of frame data flow errors:  . . . . . . . . . . . . . 0
2018-08-07 16:49:29.814 Always, Messages retransmitted: . . . . . . . . . . . . . . . . . 0
2018-08-07 16:49:29.814 Always, Messages dropped and not delivered: . . . . . . . . . . . 0
2018-08-07 16:49:29.814 Always, ***************************************************************************

The following

pyozw_check -l -d /dev/ttyAMA0 -t 60

gives me:

-------------------------------------------------------------------------------
Define options for device /dev/ttyAMA0
Start network
Wait for network (60s)
Network is ready
-------------------------------------------------------------------------------
Controller capabilities : set(['primaryController'])
Controller node capabilities : set(['primaryController', 'beaming', 'listening'])
Nodes in network : 1
Driver statistics : {'retries': 0L, 'readCnt': 8L, 'readAborts': 0L, 'routedbusy': 0L, 
'ACKCnt': 9L, 'OOFCnt': 0L, 'noack': 0L, 'broadcastWriteCnt': 8L, 'callbacks': 0L, 
'writeCnt': 9L, 'badChecksum': 0L,  'nondelivery': 0L, 'CANCnt': 0L, 'NAKCnt': 0L, 
'netbusy': 0L, 'SOFCnt': 8L, 'broadcastReadCnt': 0L, 'badroutes': 0L, 'ACKWaiting': 0L, 
'dropped': 0L}
------------------------------------------------------------
1 - Name :  ( Location :  )
 1 - Ready : True / Awake : True / Failed : False
 1 - Manufacturer : Z-Wave.Me  ( id : 0x0147 )
 1 - Product : RaZberry Controller ( id  : 0x0003 / type : 0x0002 )
 1 - Version : 4 / Secured : False / Zwave+ : False
 1 - Command classes : set(['COMMAND_CLASS_NO_OPERATION', 'COMMAND_CLASS_BASIC'])
 1 - Capabilities : set(['primaryController', 'beaming', 'listening'])
 1 - Neigbors : set([]) / Power level : None
 1 - Is sleeping : False / Can wake-up : False / Battery level : None

This looks good. Since I exchanged the ZWave module, this is how it looks like with the noew module from Conrad Electronic:

-------------------------------------------------------------------------------
Define options for device /dev/ttyAMA0
Start network
Wait for network (60s)
Network is ready
-------------------------------------------------------------------------------
Controller capabilities : set(['primaryController'])
Controller node capabilities : set(['primaryController', 'beaming', 'listening'])
Nodes in network : 1
Driver statistics : {'retries': 1L, 'readCnt': 11L, 'readAborts': 0L, 'routedbusy': 0L, 
'ACKCnt': 11L, 'OOFCnt': 0L, 'noack': 0L, 'broadcastWriteCnt': 10L, 'callbacks': 0L,
'writeCnt': 12L, 'badChecksum': 0L, 'nondelivery': 0L, 'CANCnt': 1L, 'NAKCnt': 0L,
'netbusy': 0L, 'SOFCnt': 11L, 'broadcastReadCnt': 0L, 'badroutes': 0L, 'ACKWaiting': 1L,
'dropped': 0L}
------------------------------------------------------------
1 - Name :  ( Location :  )
 1 - Ready : True / Awake : True / Failed : False
 1 - Manufacturer : Z-Wave.Me  ( id : 0x0147 )
 1 - Product : Unknown: type=0400, id=0002 ( id  : 0x0002 / type : 0x0400 )
 1 - Version : 4 / Secured : False / Zwave+ : False
 1 - Command classes : set([])
 1 - Capabilities : set(['primaryController', 'beaming', 'listening'])
 1 - Neigbors : set([]) / Power level : None
 1 - Is sleeping : False / Can wake-up : False / Battery level : None

2.5 Some More

I am following the recommendations here:

https://github.com/mozilla-iot/wiki/wiki/Installing-OpenZWave

Make sure you have some prerequisites:

apt-get install pkg-config

Then let's start:

$ cd
$ git clone https://github.com/OpenZWave/open-zwave.git
$ cd open-zwave
$ CFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 make && sudo CFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 make install

and it will end with:

Building Scene.o
Building Utils.o
Building Driver.o
Building ZWSecurity.o
Building Group.o
Building Node.o
Building Manager.o
Building Msg.o
Building Notification.o
Creating vers.cpp
Building vers.o
Linking Static Library
Linking Shared Library
Making ozw_config file
make[1]: Verzeichnis „/root/git/open-zwave/cpp/build“ wird verlassen
LDFLAGS="" CPPFLAGS="" make -C /root/git/open-zwave/cpp/examples/MinOZW/ -
make[1]: Verzeichnis „/root/git/open-zwave/cpp/examples/MinOZW“ wird betreten
Building Main.o
Linking /root/git/open-zwave/.lib/MinOZW
g++    -o /root/git/open-zwave/.lib/MinOZW /root/git/open-zwave/.lib/Main.o /root/git/open-zwave/libopenzwave.so -pthread
Creating Temporary Shell Launch Script
make[1]: Verzeichnis „/root/git/open-zwave/cpp/examples/MinOZW“ wird verlassen
LDFLAGS="" CPPFLAGS="" make -C /root/git/open-zwave/cpp/build/ -
make[1]: Verzeichnis „/root/git/open-zwave/cpp/build“ wird betreten
Building OpenZWave Version 1.4-3155-ga27c2645-dirty
make[1]: Verzeichnis „/root/git/open-zwave/cpp/build“ wird verlassen
LDFLAGS="" CPPFLAGS="" make -C /root/git/open-zwave/cpp/examples/MinOZW/ -
make[1]: Verzeichnis „/root/git/open-zwave/cpp/examples/MinOZW“ wird betreten
make[1]: Für das Ziel „default“ ist nichts zu tun.
make[1]: Verzeichnis „/root/git/open-zwave/cpp/examples/MinOZW“ wird verlassen

2.6 Give me more

Links: