Author Topic: ZWave API  (Read 113832 times)

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
ZWave API
« on: January 24, 2008, 02:32:22 pm »
Hi Devs,

I try to collect all the public available ZWave information out in the wild on a wiki page: http://wiki.linuxmce.org/index.php/ZWave_API
Some manuals hold information about node types, command and device classes. And there is sample code in the "HomeDaemon" project. Maybe we can pull enough information together to create an open api header file.

best regards,
Hari

rock your home - http://www.agocontrol.com home automation

cyr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: ZWave API
« Reply #1 on: January 26, 2008, 11:47:35 am »
I'm working on my own code to talk to a Z-wave controller (ZCU201), the result will hopefully be a small C library with some documentation.

I'm using a combination of the LMCE code, the Zensys docs you have also found, and some reverse engineering to figure things out...

One thing I'm curious about is the actual legal status of the Z-wave code in LMCE. It couldn't have been written without access to information under NDA with Zensys right? Further more, some of the header files still have Zensys copyright notices...


hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: ZWave API
« Reply #2 on: January 26, 2008, 12:13:54 pm »
It couldn't have been written without access to information under NDA with Zensys right?
not without big reverse engineering.
Quote
Further more, some of the header files still have Zensys copyright notices...
that problem was identified a few days ago. The actual driver is now removed from the trunk until that issue is resolved. I did some scripting to get the used defines from our code. Without the Zensys headers there are at about 50 defines needed for the lmce ZWave driver to compile.

It would be great if you could add valuable _public available_/reverse engineered information to the wiki page.

best regards,
Hari
« Last Edit: January 27, 2008, 04:37:54 pm by hari »
rock your home - http://www.agocontrol.com home automation

cyr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: ZWave API
« Reply #3 on: January 27, 2008, 01:53:29 pm »
Well, I've thrown together a document with some of my sniffer logs and analysis of them.

http://area26.no-ip.org/linked/zw_analysis.rtf

1audio

  • Addicted
  • *
  • Posts: 552
    • View Profile
Re: ZWave API
« Reply #4 on: January 27, 2008, 04:34:24 pm »
This document may give you insight into a lot of the ZWave API  http://www.leviton.com/OA_HTML/ibcGetAttachment.jsp?cItemId=iCJMZBqYpY17c3GhTCP72w&label=IBE&appName=IBE
There are a few Leviton specific commands but most commands are supported by all ZWave products. There are some commands etc. not listed on the document but it should be enough to get started.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: ZWave API
« Reply #5 on: January 27, 2008, 05:53:38 pm »
Well, I've thrown together a document with some of my sniffer logs and analysis of them.

http://area26.no-ip.org/linked/zw_analysis.rtf


great work! congrats for your working interface software, too ;)

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: ZWave API
« Reply #6 on: January 27, 2008, 05:57:42 pm »
This document may give you insight into a lot of the ZWave API  http://www.leviton.com/OA_HTML/ibcGetAttachment.jsp?cItemId=iCJMZBqYpY17c3GhTCP72w&label=IBE&appName=IBE
There are a few Leviton specific commands but most commands are supported by all ZWave products. There are some commands etc. not listed on the document but it should be enough to get started.
ty, have seen that already. Still missing hex values for many classes.

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

1audio

  • Addicted
  • *
  • Posts: 552
    • View Profile
Re: ZWave API
« Reply #7 on: January 27, 2008, 06:36:52 pm »
I'm pushing my contacts on getting more public info on ZWave. Its sometimes hard to get commercial interests to see the value in making some of the internals public.

This week I can go through the datasheets I have to see if there are any other useful nuggets hidden in them.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: ZWave API
« Reply #8 on: January 27, 2008, 06:59:02 pm »
I'm pushing my contacts on getting more public info on ZWave. Its sometimes hard to get commercial interests to see the value in making some of the internals public.

This week I can go through the datasheets I have to see if there are any other useful nuggets hidden in them.
that would be very helpful!

Best regards,
Hari
rock your home - http://www.agocontrol.com home automation

aaron.b

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: ZWave API
« Reply #9 on: February 13, 2008, 06:37:36 pm »
We're doing testing for the 0710 release and trying to be sure it works with the ACT ZCU101 (the pyramid shaped zwave usb) because this is the model currently sold, and the only zwave dongle in 0704 doesn't work.  I know some new kernel modules were added by Hari, I believe, and now the ZCU101 is detected, and gets a ttyUSB interface.  However the ZWave software still can't talk to it.  Has anybody had any success with it?

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: ZWave API
« Reply #10 on: February 13, 2008, 06:50:16 pm »
We're doing testing for the 0710 release and trying to be sure it works with the ACT ZCU101 (the pyramid shaped zwave usb) because this is the model currently sold, and the only zwave dongle in 0704 doesn't work.  I know some new kernel modules were added by Hari, I believe, and now the ZCU101 is detected, and gets a ttyUSB interface.  However the ZWave software still can't talk to it.  Has anybody had any success with it?
cyr has successfully sent commands to the device with his own software and the new driver:
http://forum.linuxmce.org/index.php?topic=3665.msg23011#msg23011

could you provide me with the device log? Does it initialize? Where is your exact problem? At the download configuration command?

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

aaron.b

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: ZWave API
« Reply #11 on: February 13, 2008, 07:50:23 pm »
>> sent commands to the device with his own software and the new driver

I had been making the assumption that the 'new driver/software' was basically just for the usb->rs232 chip, so the kernel would see the dongle and add it as a ttyUSB
  • entry, but that once that happened, the serial protocol to talk to the device was the same and the existing ZWave binary would be used.  Is that a misunderstanding?  Have you and cyr been developing your own replacement for the existing ZWave binary?  Maybe the 3 of us (4 if we get Daniel in) could talk about this on Skype or something.  This is relevant for us since the programmer at Pluto who wrote the ZWave module originally is not with us anymore, and there's some new ZWave features we need implemented, and maybe we can get you guys some equipment if you're working on ZWave drivers.


My logs show this (this has the new kernel module for ttyUSB, but uses the existing ZWave software)

35      02/13/08 7:09:48.826            ++++++++++++ ZWave is connected <0x2b66ed2f1b40>
36      02/13/08 7:09:48.826            ### Run Current Job  <0x41802950>
36      02/13/08 7:09:48.882            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:48.882            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:48.882            SerialConnection::send unlock serial mutex <0x41802950>
05      02/13/08 7:09:53.026            ### Go to timeout queue <0x41802950>
05      02/13/08 7:09:53.026            ### execute the next job from timeout queue <0x41802950>
05      02/13/08 7:09:53.026            ZWJobInitialize::timeoutHandler <0x41802950>
36      02/13/08 7:09:53.082            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:53.082            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:53.082            SerialConnection::send unlock serial mutex <0x41802950>
05      02/13/08 7:09:58.010            ### Go to timeout queue <0x41802950>
05      02/13/08 7:09:58.010            ### execute the next job from timeout queue <0x41802950>
05      02/13/08 7:09:58.010            ZWJobInitialize::timeoutHandler <0x41802950>
36      02/13/08 7:09:58.066            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:58.066            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:58.066            SerialConnection::send unlock serial mutex <0x41802950>
35      02/13/08 7:09:58.290            size too small 1 <0x41802950>

....  repeats ....
35      02/13/08 7:10:03.050            size too small 1 <0x41802950>
05      02/13/08 7:10:03.050            ### Go to timeout queue <0x41802950>
05      02/13/08 7:10:03.050            ### skip the next job from timeout queue <0x41802950>
35      02/13/08 7:10:03.050            ----- INIT ---- 1 <0x41802950>
35      02/13/08 7:10:03.050            ----- INIT ---- 2 <0x41802950>
35      02/13/08 7:10:03.050            -------- 3 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.050            SerialConnection ------------- asa 1 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.154            SerialConnection ------------- asa 2 <0x2b66ed2f1b40>
36      02/13/08 7:10:03.154            waiting for thread to finish <0x2b66ed2f1b40>
35      02/13/08 7:10:03.154            exit receiveFunction : nr. of reads 47 <0x41001950>
36      02/13/08 7:10:03.167            thread finished <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            SerialConnection ------------- asa 3 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            SerialConnection ------------- asa 4 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            -------- 4 <0x2b66ed2f1b40>
10      02/13/08 7:10:03.168            Socket::SendMessage type 5 id 37 from 63 to -1000 <0x2b66ed2f1b40>
10      02/13/08 7:10:03.196            TranslateSerialUSB found /sys/devices/pci0000:00/0000:00:04.0/usb2/2-1/2-1:1.0/ttyUSB1/ttyUSB1, returning /dev/ttyUSB1 <0x2b66ed2f1b40>
36      02/13/08 7:10:03.196            Using serial port: ttyUSB1. <0x2b66ed2f1b40>
36      02/13/08 7:10:03.207            SerialConnection::connect init serial mutex <0x2b66ed2f1b40>


hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: ZWave API
« Reply #12 on: February 13, 2008, 08:21:33 pm »
>> sent commands to the device with his own software and the new driver

I had been making the assumption that the 'new driver/software' was basically just for the usb->rs232 chip, so the kernel would see the dongle and add it as a ttyUSBX entry, but that once that happened, the serial protocol to talk to the device was the same and the existing ZWave binary would be used.  Is that a misunderstanding?
thats also my understanding. I did the same approach for the Seluxit Dongle. It also uses a new chip (>2.xx) and works perfect.

Quote
Have you and cyr been developing your own replacement for the existing ZWave binary?  Maybe the 3 of us (4 if we get Daniel in) could talk about this on Skype or something.  This is relevant for us since the programmer at Pluto who wrote the ZWave module originally is not with us anymore, and there's some new ZWave features we need implemented, and maybe we can get you guys some equipment if you're working on ZWave drivers.
cyr works on a seperate project but seems to make good progress without the Zensys SDK.
I stared at the DCE ZWave code for some days and have coarse understanding. My next steps will be implementing multilevel sensor support after receiving the multisensor sample from Seluxit and improving bidirectional support.
What holds me back for now is the "unknown state" of the lmce/pluto code atm. It got removed because of the Zensys headers. I did some code parsing and came up with ~50 #defines needed to get rid of the both zensys files. If Zensys is happy with that I can continue to improve the code.

Quote
My logs show this (this has the new kernel module for ttyUSB, but uses the existing ZWave software)

35      02/13/08 7:09:48.826            ++++++++++++ ZWave is connected <0x2b66ed2f1b40>
36      02/13/08 7:09:48.826            ### Run Current Job  <0x41802950>
36      02/13/08 7:09:48.882            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:48.882            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:48.882            SerialConnection::send unlock serial mutex <0x41802950>
05      02/13/08 7:09:53.026            ### Go to timeout queue <0x41802950>
05      02/13/08 7:09:53.026            ### execute the next job from timeout queue <0x41802950>
05      02/13/08 7:09:53.026            ZWJobInitialize::timeoutHandler <0x41802950>
36      02/13/08 7:09:53.082            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:53.082            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:53.082            SerialConnection::send unlock serial mutex <0x41802950>
05      02/13/08 7:09:58.010            ### Go to timeout queue <0x41802950>
05      02/13/08 7:09:58.010            ### execute the next job from timeout queue <0x41802950>
05      02/13/08 7:09:58.010            ZWJobInitialize::timeoutHandler <0x41802950>
36      02/13/08 7:09:58.066            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:58.066            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:58.066            SerialConnection::send unlock serial mutex <0x41802950>
35      02/13/08 7:09:58.290            size too small 1 <0x41802950>

....  repeats ....
35      02/13/08 7:10:03.050            size too small 1 <0x41802950>
05      02/13/08 7:10:03.050            ### Go to timeout queue <0x41802950>
05      02/13/08 7:10:03.050            ### skip the next job from timeout queue <0x41802950>
35      02/13/08 7:10:03.050            ----- INIT ---- 1 <0x41802950>
35      02/13/08 7:10:03.050            ----- INIT ---- 2 <0x41802950>
35      02/13/08 7:10:03.050            -------- 3 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.050            SerialConnection ------------- asa 1 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.154            SerialConnection ------------- asa 2 <0x2b66ed2f1b40>
36      02/13/08 7:10:03.154            waiting for thread to finish <0x2b66ed2f1b40>
35      02/13/08 7:10:03.154            exit receiveFunction : nr. of reads 47 <0x41001950>
36      02/13/08 7:10:03.167            thread finished <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            SerialConnection ------------- asa 3 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            SerialConnection ------------- asa 4 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            -------- 4 <0x2b66ed2f1b40>
10      02/13/08 7:10:03.168            Socket::SendMessage type 5 id 37 from 63 to -1000 <0x2b66ed2f1b40>
10      02/13/08 7:10:03.196            TranslateSerialUSB found /sys/devices/pci0000:00/0000:00:04.0/usb2/2-1/2-1:1.0/ttyUSB1/ttyUSB1, returning /dev/ttyUSB1 <0x2b66ed2f1b40>
36      02/13/08 7:10:03.196            Using serial port: ttyUSB1. <0x2b66ed2f1b40>
36      02/13/08 7:10:03.207            SerialConnection::connect init serial mutex <0x2b66ed2f1b40>



could you please try again with revision 1494 of the spcp8x5 driver?

best regards,
Hari
rock your home - http://www.agocontrol.com home automation

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: ZWave API
« Reply #13 on: February 13, 2008, 10:30:45 pm »
We're doing testing for the 0710 release and trying to be sure it works with the ACT ZCU101 (the pyramid shaped zwave usb) because this is the model currently sold, and the only zwave dongle in 0704 doesn't work.  I know some new kernel modules were added by Hari, I believe, and now the ZCU101 is detected, and gets a ttyUSB interface.  However the ZWave software still can't talk to it.  Has anybody had any success with it?

Aaron thats the ZCU201

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: ZWave API
« Reply #14 on: February 13, 2008, 10:33:03 pm »
>> sent commands to the device with his own software and the new driver

I had been making the assumption that the 'new driver/software' was basically just for the usb->rs232 chip, so the kernel would see the dongle and add it as a ttyUSB
  • entry, but that once that happened, the serial protocol to talk to the device was the same and the existing ZWave binary would be used.  Is that a misunderstanding?  Have you and cyr been developing your own replacement for the existing ZWave binary?  Maybe the 3 of us (4 if we get Daniel in) could talk about this on Skype or something.  This is relevant for us since the programmer at Pluto who wrote the ZWave module originally is not with us anymore, and there's some new ZWave features we need implemented, and maybe we can get you guys some equipment if you're working on ZWave drivers.


My logs show this (this has the new kernel module for ttyUSB, but uses the existing ZWave software)

35      02/13/08 7:09:48.826            ++++++++++++ ZWave is connected <0x2b66ed2f1b40>
36      02/13/08 7:09:48.826            ### Run Current Job  <0x41802950>
36      02/13/08 7:09:48.882            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:48.882            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:48.882            SerialConnection::send unlock serial mutex <0x41802950>
05      02/13/08 7:09:53.026            ### Go to timeout queue <0x41802950>
05      02/13/08 7:09:53.026            ### execute the next job from timeout queue <0x41802950>
05      02/13/08 7:09:53.026            ZWJobInitialize::timeoutHandler <0x41802950>
36      02/13/08 7:09:53.082            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:53.082            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:53.082            SerialConnection::send unlock serial mutex <0x41802950>
05      02/13/08 7:09:58.010            ### Go to timeout queue <0x41802950>
05      02/13/08 7:09:58.010            ### execute the next job from timeout queue <0x41802950>
05      02/13/08 7:09:58.010            ZWJobInitialize::timeoutHandler <0x41802950>
36      02/13/08 7:09:58.066            SerialConnection::send lock serial mutex <0x41802950>
35      02/13/08 7:09:58.066            SerialConnection::send len = 2 buf = 0x00 0x15  <0x41802950>
36      02/13/08 7:09:58.066            SerialConnection::send unlock serial mutex <0x41802950>
35      02/13/08 7:09:58.290            size too small 1 <0x41802950>

....  repeats ....
35      02/13/08 7:10:03.050            size too small 1 <0x41802950>
05      02/13/08 7:10:03.050            ### Go to timeout queue <0x41802950>
05      02/13/08 7:10:03.050            ### skip the next job from timeout queue <0x41802950>
35      02/13/08 7:10:03.050            ----- INIT ---- 1 <0x41802950>
35      02/13/08 7:10:03.050            ----- INIT ---- 2 <0x41802950>
35      02/13/08 7:10:03.050            -------- 3 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.050            SerialConnection ------------- asa 1 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.154            SerialConnection ------------- asa 2 <0x2b66ed2f1b40>
36      02/13/08 7:10:03.154            waiting for thread to finish <0x2b66ed2f1b40>
35      02/13/08 7:10:03.154            exit receiveFunction : nr. of reads 47 <0x41001950>
36      02/13/08 7:10:03.167            thread finished <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            SerialConnection ------------- asa 3 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            SerialConnection ------------- asa 4 <0x2b66ed2f1b40>
35      02/13/08 7:10:03.167            -------- 4 <0x2b66ed2f1b40>
10      02/13/08 7:10:03.168            Socket::SendMessage type 5 id 37 from 63 to -1000 <0x2b66ed2f1b40>
10      02/13/08 7:10:03.196            TranslateSerialUSB found /sys/devices/pci0000:00/0000:00:04.0/usb2/2-1/2-1:1.0/ttyUSB1/ttyUSB1, returning /dev/ttyUSB1 <0x2b66ed2f1b40>
36      02/13/08 7:10:03.196            Using serial port: ttyUSB1. <0x2b66ed2f1b40>
36      02/13/08 7:10:03.207            SerialConnection::connect init serial mutex <0x2b66ed2f1b40>



Hi Aaron,

We have already committed to providing Hari with a ZCU201 if this helps.

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk