Getting Z-Wave Binding to "Rediscover" Node Without Restart

134 views
Skip to first unread message

Nolan Garrett

unread,
Nov 9, 2014, 11:00:08 PM11/9/14
to ope...@googlegroups.com
Hello,

I have seen this issue primarily with battery devices, generally after transitioning to a new version of OpenHAB where the nodeXX.xml files need to be recreated. It appears that if OpenHAB can't discover a battery device during it's initial boot and serialize it at that time, the device gets marked with a manufacturer ID, device ID and device type of 7fffffff. It appears to be impossible to get OpenHAB to rediscover the device appropriately, unless you stop the OpenHAB service, then start it, and get "lucky" enough during boot that when it tries to discover the node in question, you wake up the battery node for it to answer. If you miss this initialization, there doesn't seem to be a way to get the binding to rediscover and reserialize the node in the future.

I am seeing this primarily in 1.6. Can't say for certain if I saw the same behavior on earlier releases.

Thoughts on this?

Thanks,

Nolan

Chris Jackson

unread,
Nov 10, 2014, 2:36:05 AM11/10/14
to ope...@googlegroups.com
Hi Nolan,
The initialisation phase of the binding is not tolerant of lost frames, or anything that might go awry. This has always been the case, and it seems that some device types are more susceptible than others... Because the binding just counts messages it's sent during initialisation, and then counts the responses, if there are any 'other' messages that it didn't request, then there's a chance that they will cause it to step through to the next initialisation phase when in reality we've not receive the packet we REALLY want. Battery devices are unfortunately worse for this since they wake up and send a bunch of stuff without being asked.

This is something that I've been working on, and I've re-written the startup code to work differently. This will ensure that all required data for initialisation is completed before the stage progresses to the next stage. I did this a few weeks back, but as the 1.6 release is due out, and this is a major refactor, it will not be merged before 1.6.

I will try and compile up a test version with this new initialisation code this week and make it available for testing...

Cheers
Chris

Nolan Garrett

unread,
Nov 10, 2014, 7:56:58 PM11/10/14
to ope...@googlegroups.com
Sounds reasonable. That said, I think it's either a bug or feature request that reincluding a node doesn't reinitialize it, wouldn't you say?

From: Chris Jackson
Sent: ‎11/‎9/‎2014 11:37 PM
To: ope...@googlegroups.com
Subject: [openhab] Re: Getting Z-Wave Binding to "Rediscover" Node WithoutRestart

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/2tYZrtgFA0U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Chris Jackson

unread,
Nov 11, 2014, 3:11:04 AM11/11/14
to ope...@googlegroups.com

Sounds reasonable. That said, I think it's either a bug or feature request that reincluding a node doesn't reinitialize it, wouldn't you say?

I’m not sure what you mean by ‘re-including a node’. Currently, if you include a new node (or a node that is actually already included), the binding will reinitialise the node even if the binding is already running. If you mean to reinitialise the node if it’s not initialised properly, then with the new initialisation code, this shouldn’t be able to happen in future.

If I’ve misunderstood, please can you describe what you mean?

Thanks

Chris

Nolan Garrett

unread,
Nov 11, 2014, 11:06:55 AM11/11/14
to ope...@googlegroups.com
No I think we're talking about the same thing. Sounds like I should wait for the new code! Thank you!

From: Chris Jackson
Sent: ‎11/‎11/‎2014 12:11 AM
To: ope...@googlegroups.com
Subject: Re: [openhab] Re: Getting Z-Wave Binding to "Rediscover" NodeWithoutRestart

--

Phil

unread,
Nov 12, 2014, 8:26:43 PM11/12/14
to ope...@googlegroups.com
Hi Chris

Have you assigned an issue to this? Most of my sensors are battery powered - so a search for 7fffffff led me here...

Is there a quick fix to this, so I could have my config parameters etc back - I'm just setting my it up, so I could live with that for now.

Thanks!

Chris Jackson

unread,
Nov 13, 2014, 1:58:52 AM11/13/14
to ope...@googlegroups.com
I haven't raised an issue for this as it's just the way the binding has always worked. As I said earlier, this is an enhancement that I'm doing, and it will be included after the 1.6 release, but currently the initialisation code of the binding hasn't (or at least shouldn't! have) changed since 1.3 (which I think was the first version of the zwave binding).  

The 7fffffff simply means that the device isn't initialised yet but it shouldn't affect the majority of sensors - all of my battery devices (I have 7) iniitialise fine. It can take a few wakeup periods, but again, this has always been the case, and will likely continue to be the case even with the enhanced initialisation code. 

I appreciate that it's not ideal as it is (which is why I'm trying to enhance it :) ), but this is quite a major change to the binding since the initialisation code is currently embedded in a large number of classes and consolidating it has meant a large number of files have changed so I don't want to do this just before a major release. If I can avoid work this weekend I'll try and merge this into the main codebase since that now looks solid, and I'll get a test version released on the HABmin site.

Cheers
Chris

Ben Jones

unread,
Nov 13, 2014, 4:37:57 AM11/13/14
to ope...@googlegroups.com
I for one can't wait for this new initialisation code Chris, I am sure it will be a vast improvement. You are really doing fantastic work on this binding - many many thanks on behalf of all the happy ZWave users!!

Chris Jackson

unread,
Nov 13, 2014, 5:33:39 AM11/13/14
to ope...@googlegroups.com
Thanks Ben :)

This is part of the code I've been meaning to redo for ages, as I know it's a cause of a number of issues... I just hope the new system will solve them - I'm reasonably confident that it should, but we'll see :)

Cheers
Chris

dan cunningham

unread,
Nov 13, 2014, 10:12:55 AM11/13/14
to ope...@googlegroups.com
I concur with Ben, you're a machine ;-) I'm excited to test your new stuff, I was poking around at the zwave-initialisation branch in your repo, is this the right one to look at?  I noticed is quite a bit behind master, so I wasn't sure. 

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.

Chris Jackson

unread,
Nov 13, 2014, 10:22:45 AM11/13/14
to ope...@googlegroups.com
Hi Dan,
Yes - I think that's the right branch. 

The 'problem' is that there are a lot of changes, so there will be a number of merge conflicts that need to be resolved. I originally did this just before the 1.6 announcement was made, so there have been a few additions since then. However, I wanted to make sure that 1.6 was basically stable before I went to the effort of sorting out the conflicts...  I'll try and do that this weekend, but work is a bit crazy right now.

Cheers
Chris
Reply all
Reply to author
Forward
0 new messages