cdjackson / HABmin

A web admin console for openHAB home automation
http://www.cd-jackson.com/index.php/openhab/habmin
217 stars 51 forks source link

adding nodes crashes z-wave binding #188

Closed holgerfriedrich closed 9 years ago

holgerfriedrich commented 9 years ago

Hi Chris, thanks a lot for the work on the new initialization scheme, this improved the startup time very much for me and works fine for me in most cases. However, there is one issue I found when adding new devices through my AeonLabs Minimote (using the inclusion mode of the main controller started via habmin works fine).

When I trigger the inclusion, I get the following log output:

2014-12-01 11:31:37.877 DEBUG o.o.b.z.i.p.ZWaveController$ZWaveReceiveThread[:1297]- Receive Message = 01 17 00 49 40 48 11 04 A1 02 9C 31 86 72 70 85 8E 7A 73 8B 91 56 84 80 7C
2014-12-01 11:31:37.880 DEBUG o.o.b.z.i.p.ZWaveController[:169]- Message: class = ApplicationUpdate (0x49), type = Request (0x00), payload = 40 48 11 04 A1 02 9C 31 86 72 70 85 8E 7A 73 8B 91 56 84 80
2014-12-01 11:31:37.881 WARN  o.o.b.z.i.p.s.ApplicationUpdateMessageClass[:103]- TODO: Implement Application Update Request Handling of New ID Assigned (64).

Waking up the device manually:

2014-12-01 11:33:08.289 DEBUG o.o.b.z.i.p.ZWaveController$ZWaveReceiveThread[:1297]- Receive Message = 01 17 00 49 84 48 11 04 A1 02 9C 31 86 72 70 85 8E 7A 73 8B 91 56 84 80 B8
2014-12-01 11:33:08.291 DEBUG o.o.b.z.i.p.ZWaveController[:169]- Message: class = ApplicationUpdate (0x49), type = Request (0x00), payload = 84 48 11 04 A1 02 9C 31 86 72 70 85 8E 7A 73 8B 91 56 84 80
2014-12-01 11:33:08.291 DEBUG o.o.b.z.i.p.s.ApplicationUpdateMessageClass[:40]- NODE 72: Application update request, node information received.
2014-12-01 11:33:08.303 ERROR o.o.b.z.i.p.ZWaveController$ZWaveReceiveThread[:1330]- Got an exception during receiving. exiting thread.
java.lang.NullPointerException: null
        at org.openhab.binding.zwave.internal.protocol.serialmessage.ApplicationUpdateMessageClass.handleRequest(ApplicationUpdateMessageClass.java:44)
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingRequestMessage(ZWaveController.java:193)
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.handleIncomingMessage(ZWaveController.java:173)
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.access$12(ZWaveController.java:167)
        at org.openhab.binding.zwave.internal.protocol.ZWaveController$ZWaveReceiveThread.processIncomingMessage(ZWaveController.java:1223)
        at org.openhab.binding.zwave.internal.protocol.ZWaveController$ZWaveReceiveThread.run(ZWaveController.java:1298)
2014-12-01 11:33:08.304 DEBUG o.o.b.z.i.p.ZWaveController$ZWaveReceiveThread[:1332]- Stopped Z-Wave receive thread
2014-12-01 11:33:15.460 WARN  o.o.b.z.i.p.ZWaveController$WatchDogTimerTask[:1366]- Threads not alive, respawning
2014-12-01 11:33:15.461 DEBUG o.o.b.z.i.p.ZWaveController$ZWaveSendThread[:1175]- Stopped Z-Wave send thread
2014-12-01 11:33:15.464 INFO  o.o.b.z.i.p.ZWaveController[:463]- Disconnected from serial port
2014-12-01 11:33:15.464 INFO  o.o.b.z.i.p.ZWaveController[:381]- Connecting to serial port /dev/ttyUSB0
2014-12-01 11:33:15.472 DEBUG o.o.b.z.i.p.ZWaveController$ZWaveReceiveThread[:1231]- Starting Z-Wave receive thread
2014-12-01 11:33:15.472 DEBUG o.o.b.z.i.p.ZWaveController$ZWaveSendThread[:1065]- Starting Z-Wave send thread
2014-12-01 11:33:15.472 INFO  o.o.b.z.i.p.ZWaveController[:394]- Serial port is initialized

Doing a restart of openhab includes the device properly:

2014-12-01 11:44:50.848 DEBUG o.o.b.z.i.p.ZWaveController$ZWaveReceiveThread[:1297]- Receive Message = 01 17 00 49 84 48 11 04 A1 02 9C 31 86 72 70 85 8E 7A 73 8B 91 56 84 80 B8
2014-12-01 11:44:50.850 DEBUG o.o.b.z.i.p.ZWaveController[:169]- Message: class = ApplicationUpdate (0x49), type = Request (0x00), payload = 84 48 11 04 A1 02 9C 31 86 72 70 85 8E 7A 73 8B 91 56 84 80
2014-12-01 11:44:50.853 DEBUG o.o.b.z.i.p.s.ApplicationUpdateMessageClass[:40]- NODE 72: Application update request, node information received.
2014-12-01 11:44:50.854 DEBUG o.o.b.z.i.p.c.ZWaveCommandClass[:207]- NODE 72: Creating new instance of command class SENSOR_ALARM
...

I reprocuced this for FGSS101 (smoke sensor) and FGFS101 (flood sensor) with Habmin 1.7.0.201411300007 and Openhab 1.6.0 release.

cdjackson commented 9 years ago

I was just about to say I've not been able to reproduce this, but re-reading your message, I think I know the problem... I'll take a look at it - thanks.

cdjackson commented 9 years ago

This issue is actually fixed in the development version (someone must have reported this elsewhere). However, what it currently does is to ignore the unknown node - I think I'll look at initialising the new node.