LinuxMCE Forums
May 22, 2013, 09:23:39 pm GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1] 2 3 4
  Print  
Author Topic: Questions on ZWave source code  (Read 12691 times)
kinman
Regular Poster
**
Posts: 23


View Profile
« on: December 21, 2007, 06:18:08 am »

Dear all, I have looked at the ZWave source code (LinuxMCE-1.1-SRC/src/ZWave) and I have some questions:
- Is there any document such as command reference or programming guide for the ZWave computer interface?
- What is the difference between asynchronize and synchronize mode?
- In my understanding, the ZWave computer interface seems to be a passive device, the software send a command to and then wait for response from it. How the software receive PIR events/triggers from the computer interface?

cheers /kin
Logged
PeteK
Guru
****
Posts: 408


View Profile
« Reply #1 on: December 21, 2007, 06:40:27 am »

The design for the Z-wave code has an interface that communicates with the DCE router (Zwave.cpp), and inserts Zwave jobs into a queue.  This queue is read by the low-level Z-wave interface PlutoZWSerialApi(.h,.cpp), which handles the low-level communication with the Zwave transciever.

Asynchronous mode creates threads that run this process asynchronously, with the DCE interface adding jobs to the queue and the Z-wave interface removing them as quickly as it can.  The threads are synchronized via mutexs in order to keep things in line.
Synchronous mode has the DCE interface send commands directly to the Z-wave interface.

SerialConnection.* is a layer over the serial communication which takes care about the general protocol specification like communication parameters, the start of every message, the checksum algorithm etc.

The Zwave computer interface is a bi-directional serial device, so when it receives notifications from other devices, it can pass them on to the PC.
Logged
ddamron
Alumni
wants to work for LinuxMCE
*
Posts: 962



View Profile WWW
« Reply #2 on: December 21, 2007, 08:01:36 am »

Is the ZWave driver bidirectional?  I was under the impression it wasn't..

If so, HOW do they set the device state?!?!?!?!? (I can only find events ON/OFF to fire )
Smiley
Logged

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.
PeteK
Guru
****
Posts: 408


View Profile
« Reply #3 on: December 21, 2007, 08:48:45 am »

Currently, it only fires PIR sensor commands.  It doesn't feed back light states, though a lot of the polling code is in there.  I'll poke back around in it this weekend and see if there are any more clues in there.
Logged
ddamron
Alumni
wants to work for LinuxMCE
*
Posts: 962



View Profile WWW
« Reply #4 on: December 21, 2007, 09:03:25 am »

Thanks Pete, I started another thread where I found where the state is saved in the database...
but I really don't want to modify the database if I don't have to..
Logged

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.
kinman
Regular Poster
**
Posts: 23


View Profile
« Reply #5 on: December 21, 2007, 10:09:43 am »

Thank you Pete. It seems the programming document for ZWave interface is only for hardware and software vendors internal use. Otherwise I have to reverse engineering the LinuxMCE-1.1-SRC/src/ZWave.

Can I say that asynchronous mode is multi-thread? synchronous mode is single-thread and the commands/responses are sent/received sequencially?

Can I treat the ZWave computer interface as a Hayes modem? Send "AT" command and wait for "OK". Except that PIR events will be received without sending command.
Logged
PeteK
Guru
****
Posts: 408


View Profile
« Reply #6 on: December 21, 2007, 05:23:54 pm »

You are exactly correct in that the asynchronous mode is multi-threaded.  The synchronous mode is single-threaded.  As for treating the interface as a modem, I'm not exactly sure what you mean.  When you send an ON/OFF command, it sends that command to the transciever, then waits for a reply or a timeout, and passes that information back.

Unfortunately, Zensys charges a lot for the dev. kit and access to the protocol documentation.  The Pluto guys may have the latest versions, and depending on the licensing, may be able to release them.
Logged
kinman
Regular Poster
**
Posts: 23


View Profile
« Reply #7 on: December 21, 2007, 06:55:33 pm »

I got it Pete! I find those commercial software for ZWave are lack of flexibility. MrHouse has limited support for ZWave. It seems the ultimate solution is Pluto/LinuxMCE. Instead of looking for document and source code, I better learn how to program on the DCE platform.
Logged
PeteK
Guru
****
Posts: 408


View Profile
« Reply #8 on: December 21, 2007, 07:12:41 pm »

Sounds good.  Let me know how I can help.  The more automation options the better.  There's been rumor of updated Zwave support in this new release, but I haven't heard anything for sure.  The current Zwave implementation only supports a few, out of production adapters, so there is a strong need to update it to support modern adapters with the current Zwave protocol.
Logged
totallymaxed
LinuxMCE God
****
Posts: 4310


View Profile WWW
« Reply #9 on: December 21, 2007, 09:39:00 pm »

Sounds good.  Let me know how I can help.  The more automation options the better.  There's been rumor of updated Zwave support in this new release, but I haven't heard anything for sure.  The current Zwave implementation only supports a few, out of production adapters, so there is a strong need to update it to support modern adapters with the current Zwave protocol.

Hmmm... well I may have been the source for that little rumour. Unfortunately the main Z-wave engineer at Pluto has recently moved on to another company so this has not happened!

Please send me a private message as I might be able to help you on the tech documentation etc etc.

Merry Christmas

Andrew
Logged

Andy Herron,
Convergent Home Technologies Ltd
United Kingdom

Dianemo S Now Shipping on Ubuntu 12.04LTS
Build your system on the latest Ubuntu OS Release!

Get a Dianemo S License: http://forum.linuxmce.org/index.php?topic=8880.0
iOS Orbiter: http://wiki.linuxmce.org/index.php/Dianemo_iOS_Orbiter
Follow us on Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

Sales & Info:
http://www.dianemo.co.uk
PeteK
Guru
****
Posts: 408


View Profile
« Reply #10 on: December 21, 2007, 09:44:19 pm »

Not Eugen?
Logged
totallymaxed
LinuxMCE God
****
Posts: 4310


View Profile WWW
« Reply #11 on: December 21, 2007, 09:56:46 pm »

Not Eugen?

Yep... afraid so :-(
Logged

Andy Herron,
Convergent Home Technologies Ltd
United Kingdom

Dianemo S Now Shipping on Ubuntu 12.04LTS
Build your system on the latest Ubuntu OS Release!

Get a Dianemo S License: http://forum.linuxmce.org/index.php?topic=8880.0
iOS Orbiter: http://wiki.linuxmce.org/index.php/Dianemo_iOS_Orbiter
Follow us on Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

Sales & Info:
http://www.dianemo.co.uk
kinman
Regular Poster
**
Posts: 23


View Profile
« Reply #12 on: December 22, 2007, 10:38:23 am »

I find Pete is the new author Cheesy

// Author: PeteK <pete.k@plutohome.com>, (C) 2007
Logged
ddamron
Alumni
wants to work for LinuxMCE
*
Posts: 962



View Profile WWW
« Reply #13 on: December 22, 2007, 10:51:27 am »

Kinman,

I'm integrating the Insteon PLM using GSD/Ruby.. and I'm almost done.
I've learned quite a bit of 'tricks'...
if your serious about zwave integration via gsd, keep in touch with Pete and myself...
I wonder if the pluto team would 'lend' the devkit out...
ahh well, lemme finish the Insteon, then worry about the zwave...

Regards,
Dan
Logged

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.
kinman
Regular Poster
**
Posts: 23


View Profile
« Reply #14 on: December 24, 2007, 04:14:38 am »

Hi Dan/Pete, I am interesting in ZWave using GSD: LinuxMCE-1.1-SRC/src/Generic_Serial_Device/Embedded Devices/*/Ruby/ do you mean we can just work on *.rb no need *.cpp/*.h? Because I am familiar on Perl and afraid of thousand lines of C codes.

cheers/kin

« Last Edit: December 24, 2007, 04:55:34 am by kinman » Logged
Pages: [1] 2 3 4
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!