[Zwave] Serial port opening fails on 2.5 Snapshot

Hi,

sometimes i’ve got the following error with the 2.5 snapshot (currently 1572).

2019-04-18 12:08:09.610 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port    '/dev/ttyAMA0'
2019-04-18 12:08:09.618 [WARN ] [erial.internal.SerialPortManagerImpl] - No SerialPortProvider found for: /dev/ttyAMA0
2019-04-18 12:08:09.622 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.zwave.handler.ZWaveSerialHandler@31ba2e': null 
java.lang.NullPointerException: null
    at org.openhab.binding.zwave.handler.ZWaveSerialHandler.initialize(ZWaveSerialHandler.java:86) ~[?:?]
    at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
    at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [134:org.openhab.core:2.5.0.201904152310]
    at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [134:org.openhab.core:2.5.0.201904152310]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
    at java.lang.Thread.run(Thread.java:748) [?:?]

I always get the error on a fresh start of my raspberry. If I restart the openhab service I can successfully connect to the port most of the time. This means around 30% of oh restart failed to init the controller (a Razberry).

I had no such problems with 2.4 but I can’t say if the error was there on older snapshots than 1572.

Bye

Starting point:

I think this error was fixed recently, however the underlying cause is not - ie we now trap this exception so that you don’t get the error. However, the cause is that the serial port can’t be opened - this is an issue with the serial driver, or your system so I can’t help there unfortunately.

Not sure if this is helpful at all, but when I get this I just remove the controller thing and re-add it using the same thing id. Everything comes back to life without any issues.

Unfortunately, I need to do it on every restart.

Same story here since using a recent snapshot of the Z-Wave binding (and manually install the serial driver after every system startup). And manually invert the percentage value for a control channel for 3 roller shutter nodes. But that’s also a known side effect of using development snapshots of bindings on top of an official build.

But at least I now have support for my Z-Wave devices :slight_smile:

I have had a simular hell… I´m not quite sure when it started, cause I have had serial port issue since start, I believe… I´m running openhab 2.5 M1 build #1575
My worries are, that I cant even get Symlinks to work proberly. Even though they´re set correctly, my USB devices doesn´t seem to make use of them. Each time I restart my Rpi, the nightmare starts all over. I use four USB devices. And it´s not just the Zwave dongle give problems.