aheil / openhab

openHAB fork for MAX!Cube binding development
Eclipse Public License 1.0
2 stars 0 forks source link

ArrayIndexOutOfBoundsException while parsing message #12

Closed dereulenspiegel closed 10 years ago

dereulenspiegel commented 10 years ago

Hi!

Unfortunately I get a new exception while running the binding

18:47:07.026 DEBUG o.o.b.m.i.MaxCubeBinding[:79]- === H_Message ===
18:47:07.028 DEBUG o.o.b.m.i.MaxCubeBinding[:81]-       Reading Time:    Mon Feb 26 18:47:00 CET 14
18:47:07.030 DEBUG o.o.b.m.i.MaxCubeBinding[:82]-       Serial number:   JEQ0544462
18:47:07.032 DEBUG o.o.b.m.i.MaxCubeBinding[:83]-       RF address (HEX):03f482
18:47:07.034 DEBUG o.o.b.m.i.MaxCubeBinding[:84]-       Firmware version:0113
18:47:07.046 DEBUG o.o.b.m.i.MaxCubeBinding[:85]-       Connection ID:   6350d3ae
18:47:07.047 DEBUG o.o.b.m.i.MaxCubeBinding[:86]-       Unknown:         00000000
18:47:07.049 DEBUG o.o.b.m.i.MaxCubeBinding[:87]-       Duty Cycle:      0
18:47:07.051 DEBUG o.o.b.m.i.MaxCubeBinding[:88]-       FreeMemorySlots: 50
18:47:07.053 DEBUG o.o.b.m.i.MaxCubeBinding[:89]-       CubeTimeState:   03
18:47:07.057 DEBUG o.o.b.m.i.MaxCubeBinding[:90]-       NTPCounter:      0
18:47:07.109 INFO  o.o.b.m.i.MaxCubeBinding[:190]- Failed to process message received by MAX! protocol.
18:47:07.111 DEBUG o.o.b.m.i.MaxCubeBinding[:191]- java.lang.ArrayIndexOutOfBoundsException: 2
        at org.openhab.binding.maxcube.internal.message.M_Message.<init>(M_Message.java:35)
        at org.openhab.binding.maxcube.internal.MaxCubeBinding.processRawMessage(MaxCubeBinding.java:327)
        at org.openhab.binding.maxcube.internal.MaxCubeBinding.execute(MaxCubeBinding.java:127)
        at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156)
        at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173)

18:47:07.197 DEBUG o.o.b.m.i.MaxCubeBinding[:99]- === C_Message ===
18:47:07.199 DEBUG o.o.b.m.i.MaxCubeBinding[:100]-      RAW:        03f482,7QP0ggATAf9KRVEwNTQ0NDYyAAsABEAAAAAAAAAAAP///////////////////////////wsABEAAAAAAAAAAQf///////////////////////////2h0dHA6Ly9tYXguZXEtMy5kZTo4MC9jdWJlADAvbG9va3VwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAENFVAAACgADAAAOEENFU1QAAwACAAAcIA==
18:47:07.201 DEBUG o.o.b.m.i.MaxCubeBinding[:101]- DeviceType:   Cube
18:47:07.203 DEBUG o.o.b.m.i.MaxCubeBinding[:102]- SerialNumber: JEQ0544462
18:47:07.206 DEBUG o.o.b.m.i.MaxCubeBinding[:103]- RFAddress:    03f482
18:47:07.295 DEBUG o.o.b.m.i.MaxCubeBinding[:52]- === L_Message ===
18:47:07.297 DEBUG o.o.b.m.i.MaxCubeBinding[:53]-       RAW:
18:47:07.300 DEBUG o.o.b.m.i.MaxCubeBinding[:179]- 0 devices found.
18:47:07.303 INFO  o.o.b.m.i.MaxCubeBinding[:204]- Cannot find MAX!cube device with serial number 'JEQ0501207'
18:47:07.305 DEBUG o.o.b.m.i.MaxCubeBinding[:213]- Available MAX! devices are:
18:47:07.307 INFO  o.o.b.m.i.MaxCubeBinding[:204]- Cannot find MAX!cube device with serial number 'KEQ0493700'
18:47:07.309 DEBUG o.o.b.m.i.MaxCubeBinding[:213]- Available MAX! devices are:
18:47:07.313 INFO  o.o.b.m.i.MaxCubeBinding[:204]- Cannot find MAX!cube device with serial number 'JEQ0607538'
18:47:07.317 DEBUG o.o.b.m.i.MaxCubeBinding[:213]- Available MAX! devices are:
18:47:07.323 INFO  o.o.b.m.i.MaxCubeBinding[:204]- Cannot find MAX!cube device with serial number 'KEQ0098486'
18:47:07.325 DEBUG o.o.b.m.i.MaxCubeBinding[:213]- Available MAX! devices are:
18:47:07.328 INFO  o.o.b.m.i.MaxCubeBinding[:204]- Cannot find MAX!cube device with serial number 'KEQ0706050'
18:47:07.330 DEBUG o.o.b.m.i.MaxCubeBinding[:213]- Available MAX! devices are:
18:47:07.332 INFO  o.o.b.m.i.MaxCubeBinding[:204]- Cannot find MAX!cube device with serial number 'KEQ0493700'
18:47:07.335 DEBUG o.o.b.m.i.MaxCubeBinding[:213]- Available MAX! devices are:

I added a WallThermostat and a WindowContact. After that everything ran fine, but after a few hours I noticed my items not changing, so I activated debugging and found this exception.

marcelrv commented 10 years ago

Hi @dereulenspiegel I don't have a WallThermostat nor a WindowContact, so can't reproduce your error.

Maybe you can run the attached one jar (I replied in the Openhab google group https://groups.google.com/group/openhab/attach/5c32bb0df53158c9/org.openhab.binding.maxcube_1.4.0.DEV.jar), it has bit better error handling. (alternatively you can build it from my https://github.com/marcelrv/openhab repository). Run it with trace level of logging, then it will spit out some more details that may help with the identifying of the problem.

dereulenspiegel commented 10 years ago

Sorry, While the error handling in this binding really needs to be improved, this error had a very simple reason. My Cube kind of "forgot" all of my devices. Since the devices were still paired to one another I didn't noticed it right away. It seems to be working again.