tobof / openhab-addons

The next-generation open Home Automation Bus (openHAB)
Eclipse Public License 2.0
39 stars 30 forks source link

Binding versio 2.4.0-SNAPSHOT (2.4.0.201812040738) Stops working withg OpenHab 2.5 #137

Closed g0uus closed 4 years ago

g0uus commented 4 years ago

I have been running that latest (that I could find) 2.4 SNAPSHOT binding for most of the year and that has been pretty reliable. However, having now updated to OpenHab 2.5 the binding no longer initialises correctly (It appears that the binding thinks it is OKI but OpenHAB has actually failed it

Log entries following restarting the bundle from the console.

2019-12-17 13:51:31.434 [hingStatusInfoChangedEvent] - 'mysensors:bridge-ser:gateway' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING

==> /var/log/openhab2/openhab.log <==

2019-12-17 13:51:31.467 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge

2019-12-17 13:51:31.474 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache file: given_ids.cached exist.

2019-12-17 13:51:31.481 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache (given_ids) content: [0, 1, 21, 22, 23, 10, 30, 31, 63, 159, 47, 95]

2019-12-17 13:51:31.487 [DEBUG] [col.serial.MySensorsSerialConnection] - Enabling connection watchdog

2019-12-17 13:51:31.494 [DEBUG] [col.serial.MySensorsSerialConnection] - Connecting to /dev/ttyUSB0 [baudRate:115200]

2019-12-17 13:51:31.509 [DEBUG] [col.serial.MySensorsSerialConnection] - Serial port event listener started

2019-12-17 13:51:31.495 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@16810d2': bundleContext

java.lang.NoSuchFieldError: bundleContext

    at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.registerDeviceDiscoveryService(MySensorsBridgeHandler.java:216) ~[?:?]

    at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:86) ~[?:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]

    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]

    at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]

    at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]

    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]

    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

2019-12-17 13:51:31.516 [DEBUG] [col.serial.MySensorsSerialConnection] - Successfully connected to serial port.

==> /var/log/openhab2/events.log <==

2019-12-17 13:51:31.533 [hingStatusInfoChangedEvent] - 'mysensors:bridge-ser:gateway' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): bundleContext

==> /var/log/openhab2/openhab.log <==

2019-12-17 13:51:31.539 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2;

2019-12-17 13:51:31.543 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'mysensors:bridge-ser:gateway': bundleContext

java.lang.NoSuchFieldError: bundleContext

    at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.registerDeviceDiscoveryService(MySensorsBridgeHandler.java:216) ~[?:?]

    at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:86) ~[?:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]

    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]

    at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]

    at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]

    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]

    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

2019-12-17 13:51:32.539 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2;

2019-12-17 13:51:32.599 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.1

2019-12-17 13:51:32.608 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;TSM:INIT

2019-12-17 13:51:32.615 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;TSF:WUR:MS=0

2019-12-17 13:51:32.619 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;TSM:INIT:TSP OK

2019-12-17 13:51:32.623 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;TSM:INIT:GW MODE

2019-12-17 13:51:32.628 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0

2019-12-17 13:51:32.635 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;MCO:REG:NOT NEEDED

2019-12-17 13:51:32.640 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;14;Gateway startup complete.

2019-12-17 13:51:32.644 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;0;0;18;2.1.1

2019-12-17 13:51:32.648 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Presentation Message received

2019-12-17 13:51:32.662 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Writing on cache given_ids, content: [0,1,21,22,23,10,30,31,63,159,47,95]

2019-12-17 13:51:32.668 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;MCO:BGN:STP

2019-12-17 13:51:32.672 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;MCO:BGN:INIT OK,TSP=1

2019-12-17 13:51:33.539 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2;

2019-12-17 13:51:33.559 [DEBUG] [rsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;2;2.1.1

2019-12-17 13:51:33.567 [DEBUG] [rsAbstractConnection$MySensorsReader] - Good,Gateway is up and running! (Ver:2.1.1)

==> /var/log/openhab2/events.log <==

2019-12-17 13:51:33.586 [hingStatusInfoChangedEvent] - 'mysensors:bridge-ser:gateway' changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR): bundleContext to ONLINE

==> /var/log/openhab2/openhab.log <==

2019-12-17 13:51:33.608 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Writing on cache given_ids, content: [0,1,21,22,23,10,30,31,63,159,47,95]

2019-12-17 13:51:33.615 [INFO ] [col.serial.MySensorsSerialConnection] - Successfully connected to MySensors Bridge.

Expected Behavior

MySensors items should keep working oin OpenHab as previously.

Current Behavior

All MySensors items are unusable. Even though the OpenHAB logs show the binding is receiving updates from various sensor nodes, the associated OpenHAB items are not being updated. Setting OpenHAB switch items does not result in messages being sent to the gateway

Context

This has now left me with an unusable MySensors network (as ALL access is through OpenHab). As a result I am having to revert my Christmas Lights to manual switching just in time for Christmas.

Your Environment

OpenHab 2.5 on RPI 2+ with MySensors serial gateway on Arduino Nano nRF24 radios/

g0uus commented 4 years ago

It appears I was premature. Although I had restarted the bundle and received the results shown, a full reboot seems to have resolved the issue sorry.

Graham

g0uus commented 4 years ago

I was premature yet again :(

Although most actuators are working ok (so I can switch lights on/off) all sensors are failed :(

All Sensor things are showing their state as "UNINITIALIZED - BRIDGE UNINITIALIZED" Although the Gateway thing is showing as "ONLINE"

Further info - The actuators(Switches) that are working and showing state as ONLINE were all switched by sending commands to OpenHAB groups. Another switch that is not operated through a group is in the "UNINITIALIZED - BRIDGE UNINITIALIZED"

DheerajKhajuria commented 4 years ago

I am also facing same issue

2019-12-18 20:19:49.816 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.mysensors.handler.MySensorsBridgeHandler@18a8395': bundleContext java.lang.NoSuchFieldError: bundleContext at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.registerDeviceDiscoveryService(MySensorsBridgeHandler.java:216) ~[?:?] at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:86) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232] at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?] at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232] 2019-12-18 20:19:49.865 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'mysensors:bridge-ser:13424d90': bundleContext java.lang.NoSuchFieldError: bundleContext at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.registerDeviceDiscoveryService(MySensorsBridgeHandler.java:216) ~[?:?] at org.openhab.binding.mysensors.handler.MySensorsBridgeHandler.initialize(MySensorsBridgeHandler.java:86) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232] at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?] at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

tobof commented 4 years ago

Please use THIS binding while I'm working on a new release.

g0uus commented 4 years ago

Thanks Tim, Hopefully be able to try it out when I get home tonight.

Graham

On Thu, 19 Dec 2019 at 11:08, Tim notifications@github.com wrote:

Please use THIS http://oberfoell.com/openhab2/org.openhab.binding.mysensors-2.5.0-SNAPSHOT.jar binding while I'm working on a new release.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/tobof/openhab2-addons/issues/137?email_source=notifications&email_token=ADIEGRAL53RN4VJE4V4QF6DQZNI2PA5CNFSM4J34NF6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHJIMKQ#issuecomment-567445034, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADIEGRAFOGOXVR2HSTLLJALQZNI2PANCNFSM4J34NF6A .

g0uus commented 4 years ago

Installed the 2.5.0-SNAPSHOT - all working again.

I did look for a 2.5.0-SNAPSHOT but I couldn't find it :(

Thanks again for quick fix Tim

Graham.