mkatter / openhab2-addons

Add-ons for openHAB 2.x
Eclipse Public License 1.0
3 stars 3 forks source link

Bridge and SL don´t go online #6

Closed Sbried closed 7 years ago

Sbried commented 7 years ago

Today I started testing the Nuki binding.

But the Bridge only goes online for some seconds, then falls back into initializing. The SmartLock never goes online. It stays at unintialized.

Here my trace: `2017-04-09 14:23:27.847 [DEBUG] [org.openhab.binding.nuki ] - BundleEvent STARTING - org.openhab.binding.nuki

2017-04-09 14:23:27.877 [DEBUG] [org.openhab.binding.nuki ] - BundleEvent STARTED - org.openhab.binding.nuki

2017-04-09 14:23:28.469 [DEBUG] [org.openhab.binding.nuki ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=binding.nuki, component.id=180, service.id=397, service.bundleid=195, service.scope=bundle} - org.openhab.binding.nuki

2017-04-09 14:23:28.938 [TRACE] [ing.nuki.dataexchange.NukiApiServlet] - Instantiating NukiApiServlet()

2017-04-09 14:23:28.975 [TRACE] [ing.nuki.dataexchange.NukiApiServlet] - NukiApiServlet:activate({component.name=binding.nuki.bcb, component.id=181})

2017-04-09 14:23:29.787 [DEBUG] [org.openhab.binding.nuki ] - ServiceEvent REGISTERED - {javax.servlet.ServletContext}={osgi.web.symbolicname=org.openhab.binding.nuki, osgi.web.version=2.1.0.201704072049, osgi.web.contextpath=/, service.id=399, service.bundleid=195, service.scope=singleton} - org.openhab.binding.nuki

2017-04-09 14:23:29.837 [DEBUG] [ing.nuki.dataexchange.NukiApiServlet] - Started NukiApiServlet at path[/nuki/bcb]

2017-04-09 14:23:29.859 [DEBUG] [org.openhab.binding.nuki ] - ServiceEvent REGISTERED - {javax.servlet.http.HttpServlet}={component.name=binding.nuki.bcb, component.id=181, service.id=398, service.bundleid=195, service.scope=bundle} - org.openhab.binding.nuki

2017-04-09 14:23:30.375 [DEBUG] [nding.nuki.handler.NukiBridgeHandler] - NukiBridgeHandler:initialize()

2017-04-09 14:23:30.381 [TRACE] [ing.nuki.dataexchange.NukiHttpClient] - Instantiating NukiHttpClient(Configuration[{key=apiToken; type=String; value=xxxxxx}, {key=port; type=BigDecimal; value=8080}, {key=ip; type=String; value=192.168.178.21}])

2017-04-09 14:23:30.413 [DEBUG] [ing.nuki.dataexchange.NukiHttpClient] - NukiHttpClient:getBridgeInfo()

2017-04-09 14:23:30.455 [TRACE] [ing.nuki.dataexchange.NukiHttpClient] - uri[http://192.168.178.21:8080/info?token=xxxxxx]

2017-04-09 14:23:30.476 [TRACE] [ing.nuki.dataexchange.NukiHttpClient] - Starting HttpClient

2017-04-09 14:23:30.559 [TRACE] [ing.nuki.dataexchange.NukiHttpClient] - Started httpClient[org.eclipse.jetty.client.HttpClient@51e133]

2017-04-09 14:23:30.732 [TRACE] [ing.nuki.dataexchange.NukiHttpClient] - contentResponseAsString[{"bridgeType": 1, "ids": {"hardwareId": 112896353, "serverId": 261643659}, "versions": {"firmwareVersion": "1.5.2", "wifiFirmwareVersion": "1.0.1"}, "uptime": 3812, "currentTime":

"2017-04-09T12:23:30+00:00", "serverConnected": true, "scanResults": [{"nukiId": xxxxxxx, "name": "Nuki_xxxxxxx", "rssi": -79, "paired": true}]}]

2017-04-09 14:23:30.737 [TRACE] [ing.nuki.dataexchange.NukiHttpClient] - Stopping HttpClient

2017-04-09 14:23:30.773 [TRACE] [ing.nuki.dataexchange.NukiHttpClient] - Stopped NukiHttpClient[org.eclipse.jetty.client.HttpClient@51e133]`

Maybe you find something? After setting the callback address the Nuki bridge returned "Success: true". The tokens/ID´s I replaced by xxxx. The SmartLock´s ID I think is correct because in the bridge´s scan results I see the decimal value of the hex value from the config file.

mkatter commented 7 years ago

Hi, from what I can see the binding is (at least for the Bridge) correctly configured. Are you using PaperUI or manual text file configuration?

Please send the full startup log, in the above log the Smart Lock part is missing.

Sbried commented 7 years ago

Well, there was not more in the log. It seemed to stop after the bridge configuration. I used the text file configuration.

Today I tried again. I removed all config files, stopped the binding and finally deleted it from the add-on folder. Then I restarted openhab to check if all is o.k. Then I did shut down openhab again. I put all configuration files in place, copies the binding again in the add on folder and started openhab.

After all that the nuki binding started working :-)

Sbried commented 7 years ago

Hello, yesterday I reloacated my raspberry and had it to shut down and restart again. The behaviour of the Nuki binding was the same as above: Bridge and lock fell into status "initializing" but I think the reason was different. I have no trace, just the error logging: 2017-04-20 17:55:18.843 [ERROR] [ing.nuki.dataexchange.NukiHttpClient] - Could not get Bridge Info! ERROR: java.net.NoRouteToHostException: No route to host 2017-04-20 17:55:18.873 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while initializing handler of thing 'nuki:bridge:NB1': java.lang.ClassCastException: org.openhab.binding.nuki.dataexchange.NukiBaseResponse cannot be cast to org.openhab.binding.nuki.dataexchange.BridgeInfoResponse java.util.concurrent.ExecutionException: java.lang.ClassCastException: org.openhab.binding.nuki.dataexchange.NukiBaseResponse cannot be cast to org.openhab.binding.nuki.dataexchange.BridgeInfoResponse at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_121] at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_121] at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:188)[98:org.eclipse.smarthome.core:0.9.0.b4] at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:81)[98:org.eclipse.smarthome.core:0.9.0.b4] at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:65)[98:org.eclipse.smarthome.core:0.9.0.b4] at org.eclipse.smarthome.core.thing.internal.ThingManager$9.run(ThingManager.java:710)[105:org.eclipse.smarthome.core.thing:0.9.0.b4] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121] at java.lang.Thread.run(Thread.java:745)[:1.8.0_121] Caused by: java.lang.ClassCastException: org.openhab.binding.nuki.dataexchange.NukiBaseResponse cannot be cast to org.openhab.binding.nuki.dataexchange.BridgeInfoResponse at org.openhab.binding.nuki.dataexchange.NukiHttpClient.getBridgeInfo(NukiHttpClient.java:119)[197:org.openhab.binding.nuki:2.1.0.201704072049] at org.openhab.binding.nuki.handler.NukiBridgeHandler.initialize(NukiBridgeHandler.java:39)[197:org.openhab.binding.nuki:2.1.0.201704072049] at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:713)[105:org.eclipse.smarthome.core.thing:0.9.0.b4] at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.b4] at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:179)[98:org.eclipse.smarthome.core:0.9.0.b4] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121] ... 3 more After that I tried to talk to the bridge from the browser: timeout error. Then after a ping the bridge started again to answer the browser. After shutting down openhab and restarting also the Nuki binding started working. I hadn´t luck to reproduce the error. I think the bridge has to be in a certain state. But I think with this info you now can catch this "no route to host" caused error.

nohum commented 7 years ago

I had that error too several times yesterday. You can e.g. reproduce it even if you use a wrong auth token for example.

On Fri, 21 Apr 2017, 04:52 Sbried, notifications@github.com wrote:

Hello, yesterday I reloacated my raspberry and had it to shut down and restart again. The behaviour of the Nuki binding was the same as above: Bridge and lock fell into status "initializing" but I think the reason was different. I have no trace, just the error logging: 2017-04-20 17:55:18.843 [ERROR] [ing.nuki.dataexchange.NukiHttpClient] - Could not get Bridge Info! ERROR: java.net.NoRouteToHostException: No route to host 2017-04-20 17:55:18.873 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while initializing handler of thing 'nuki:bridge:NB1': java.lang.ClassCastException: org.openhab.binding.nuki.dataexchange.NukiBaseResponse cannot be cast to org.openhab.binding.nuki.dataexchange.BridgeInfoResponse java.util.concurrent.ExecutionException: java.lang.ClassCastException: org.openhab.binding.nuki.dataexchange.NukiBaseResponse cannot be cast to org.openhab.binding.nuki.dataexchange.BridgeInfoResponse at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_121] at java.util.concurrent.FutureTask.get(FutureTask.java:206)[:1.8.0_121] at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:188)[98:org.eclipse.smarthome.core:0.9.0.b4] at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:81)[98:org.eclipse.smarthome.core:0.9.0.b4] at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:65)[98:org.eclipse.smarthome.core:0.9.0.b4] at org.eclipse.smarthome.core.thing.internal.ThingManager$9.run(ThingManager.java:710)[105:org.eclipse.smarthome.core.thing:0.9.0.b4] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121] at java.lang.Thread.run(Thread.java:745)[:1.8.0_121] Caused by: java.lang.ClassCastException: org.openhab.binding.nuki.dataexchange.NukiBaseResponse cannot be cast to org.openhab.binding.nuki.dataexchange.BridgeInfoResponse at org.openhab.binding.nuki.dataexchange.NukiHttpClient.getBridgeInfo(NukiHttpClient.java:119)[197:org.openhab.binding.nuki:2.1.0.201704072049] at org.openhab.binding.nuki.handler.NukiBridgeHandler.initialize(NukiBridgeHandler.java:39)[197:org.openhab.binding.nuki:2.1.0.201704072049] at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:713)[105:org.eclipse.smarthome.core.thing:0.9.0.b4] at org.eclipse.smarthome.core.thing.internal.ThingManager$9$1.call(ThingManager.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.b4] at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:179)[98:org.eclipse.smarthome.core:0.9.0.b4] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121] ... 3 more After that I tried to talk to the bridge from the browser: timeout error. Then after a ping the bridge started again to answer the browser. After shutting down openhab and restarting also the Nuki binding started working. I hadn´t luck to reproduce the error. I think the bridge has to be in a certain state. But I think with this info you now can catch this "no route to host" caused error.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mkatter/openhab2-addons/issues/6#issuecomment-296028953, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzLu1Wq7KkZzSg-q0WZTgvFI8X0Avj3ks5ryBnTgaJpZM4M4C-7 .

mkatter commented 7 years ago

Done - see https://github.com/openhab/openhab2-addons/pull/2019/commits/330cf647406f151eee59ba2773f1741a7b1ff115