Zwave binding crashes OH2 on new installation

Hi recently I decided to update my old an manually set installation on my Wheezy Raspberry2 of OH2 using what was available on apt-get packages.

I followed the installation instructions here https://docs.openhab.org/installation/linux.html#installation and initaillay everything seemed to be fine, but after couple of minutes java process dissapeared. What I’ve observed was that after forking many threads all of a sudden java process exited with no error in the logs. I increased the log level but still nothing.
What one could see in the zwave logs was

2018-01-15 23:25:58.487 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:cd7e4f2d' changed from UNINITIALIZED to INITIALIZING
2018-01-15 23:25:58.526 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:cd7e4f2d' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline

my zwave stick is on /dev/ttUSB0

[    2.924737] usb 1-1.5: new full-speed USB device number 4 using dwc_otg  
[    3.041680] usb 1-1.5: New USB device found, idVendor=10c4, idProduct=ea60  
[    3.052544] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.061976] usb 1-1.5: Product: CP2102 USB to UART Bridge Controller   
[    3.061988] usb 1-1.5: Manufacturer: Silicon Labs   
[    3.062005] usb 1-1.5: SerialNumber: 0001  
[    3.370473] usbcore: registered new interface driver usbserial
[    3.380702] usbcore: registered new interface driver usbserial_generic
[    3.389593] usbserial: USB Serial support registered for generic 
[    3.401791] usbcore: registered new interface driver cp210x 
[    3.409959] usbserial: USB Serial support registered for cp210x 
[    3.428718] usb 1-1.5: cp210x converter now attached to ttyUSB0

I read that may be it could be a permissions problem, so I included openhab user in the corresponding groups , but this didn’t help

pi@raspberrypi ~ $ sudo ls -l /dev/ttyUSB0
crw-rw---T 1 root dialout 188, 0 Jan  1  1970 /dev/ttyUSB0
pi@raspberrypi ~ $ id openhab
uid=111(openhab) gid=115(openhab) groups=115(openhab),5(tty),20(dialout)

I’ve purged the packages and re-installed again. Until the moment of installing zwave plugin OH2 was working fine. After installing zwave plugin again the same problem. I’ve also removed any previously saved configurations that i had in /etc/openhab2 folder

I reinstalled again (apt-get purge and then install). The same behavior can be observed. Initially OH can start and it’s working, then I install zwave plugin, still OH2 is working.
Then I configure t he serial port for the zwave stick and as soon as it tries to open the port in the logs you can see that the port doesn’t exist then java process exits.

I just went through this same problem, and changed ttyUSB0 ownership to ‘openhab’ via chown, now it works. If you unplug it long enough (as in a soft reset (I think)) or even a system reboot, I’ve found those permissions seem to be reset to root again, so the permissions need to be reset again. There is a fix mentioned in the old forum that I’m trying to locate.

Thanks I’ll try that. I think that every time you unplug/plug device it gets some default ownership:permissions so there must be another way. I just wonder how the whole story worked with OH manually installed half an year ago. I didn’t face those problems?!
I wonder if there is a simple test (script) to check if one could open and read /dev/ttyUSB0…so at least to confirm that it’s not permission/OS level problem

After spending some more time and getting nowhere I decided to go the easy route. I flashed the SD card with openhabian and everything works now.

I could somehow only recommend the OpenHab contributors to thing of some tool that tests such problems with serial port. Seems common problem within the openhab community. Whether it’s permission problem or don’t know which device the z-stick is attached to, or may be wrong drivers…all of these problematic areas could benefit if there is tool that help to diagnose the problematic area.