OpenHAB won't recognise zwave dongle

After several restarts and also putting -Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0 into start.sh, I am now getting some warnings and errors:

2016-10-07 21:46:02.440 [DEBUG] [WaveController$ZWaveSendThread:1268]- NODE 255: Sending REQUEST Message = 01 03 00 20 DC 
2016-10-07 21:46:02.449 [DEBUG] [eController$ZWaveReceiveThread:1481]- Receive Message = 01 01 20 
2016-10-07 21:46:02.466 [ERROR] [eController$ZWaveReceiveThread:1393]- Message is not valid, discarding
2016-10-07 21:46:02.506 [WARN ] [eController$ZWaveReceiveThread:1508]- Protocol error (OOF). Got 0xD7. Sending NAK.
2016-10-07 21:46:02.516 [WARN ] [eController$ZWaveReceiveThread:1508]- Protocol error (OOF). Got 0xF3. Sending NAK.
2016-10-07 21:46:02.560 [WARN ] [eController$ZWaveReceiveThread:1508]- Protocol error (OOF). Got 0x51. Sending NAK.
2016-10-07 21:46:02.576 [WARN ] [eController$ZWaveReceiveThread:1508]- Protocol error (OOF). Got 0x94. Sending NAK.
2016-10-07 21:46:02.644 [WARN ] [eController$ZWaveReceiveThread:1508]- Protocol error (OOF). Got 0x08. Sending NAK.
2016-10-07 21:46:07.073 [DEBUG] [z.internal.ZWaveNetworkMonitor:315 ]- Network Monitor: Queue length is 3 - deferring network monitor functions.
2016-10-07 21:46:07.484 [ERROR] [WaveController$ZWaveSendThread:1309]- NODE 255: Timeout while sending message. Requeueing - 2 attempts left!
2016-10-07 21:46:07.487 [DEBUG] [b.z.i.protocol.ZWaveController:620 ]- Enqueueing message. Queue length = 4
2016-10-07 21:46:12.092 [DEBUG] [z.internal.ZWaveNetworkMonitor:315 ]- Network Monitor: Queue length is 4 - deferring network monitor functions.
2016-10-07 21:46:12.502 [WARN ] [WaveController$ZWaveSendThread:1203]- Receive queue TIMEOUT:

The last two lines are repeated every five seconds.
Sorry for pushing this, but I am really desperate because it feels like I am really close ā€¦

Talking about ā€œreally closeā€: Now it works. Please donā€™t ask me, what Iā€™ve done differently this time. However for the sake of everybody encountering similar troubles as me (and especially for those running a z-wave stick on a synology device) here comes once more the list of what Iā€™ve done (gathered from different forums and sites). Maybe itā€™s going to help someone ā€¦

(0.5 in newer DSM versions you donā€™t have root access via SSH, so log in as admin and run sudo -i and enter admin pw again)

  1. check if stick is accessible by openhb user: ls -l /dev/ttyA*

  2. if itā€™s root only do the following (maybe simply putting openhab into dialout is sufficient):
    Create groups ā€œdialoutā€ and ā€œuucpā€ in DSM
    Change user id of ā€œopenhabā€ to make it a system user
    Edit /etc/passwd and replace id by a number < 100 (e.g. 95)
    Change user id for existing files to new user id, here 1066 is the old user id and 95 the new one:
    find / -user 1066 -exec chown -h 95 {} ;
    Change group ids of ā€œdialoutā€ and "uucp"
    Edit /etc/group and replace group ids by 800 / 801
    Assign user openhab to both groups (also in /etc/group)

  3. continue with setting ownerships and usage rights
    chown -R root.uucp /run/lock
    chmod -R g+w /run/lock
    chown -R root.uucp /var/lock
    chmod -R g+w /var/lock/
    chown -R root.dialout /dev/ttyACM0
    chmod 660 /dev/ttyACM0

  4. If openhab was started as root before, there may be lock-files remaining in folder /var/locks that cannot be removed by user openhab, so remove them manually

  5. add -Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0 \ to your start script (I couldnā€™t find any scripts on my synology (no init.d, no nothing) and put it directly into the java command in start.sh at /volume1/@appstore/OpenHAB/)

  6. instead of starting the packet in the webGUI, I am starting OH via SSH with sudo ā€“u openhab ./start.sh (you might have to give openhab access to the whole folder, for the java files to run correctly: chown openhab /OpenHAB ā€“R)

You can see, I am no Linux pro, thatā€™s why some steps might seem awkward, redundant or unnecessary. I am just putting down what finally (after days of fiddling around) got it working for me.
Good luck! :slight_smile: