[solved] Zwave controller shows "Offline" when executed within eclipse

I want to debug the zwave binding within eclipse.

I have a working environment of eclipse + habmin + zwave
When running openhab within eclipse, in habmin -> Configuration -> Things
I add the zwave controller (by clicking on “+” -> “Z-Wwave binding” -> “Z-Wave serial controller” -> Save)
After that, I see the Z-Wave serial controller in habmin -> Configuration -> Things with an Initializing icon
I click on the Z-Wave serial controller to configure it and set the field Serial Port to /dev/ttyUSB0
(I checked that /dev/ttyUSB0 exists, once the zwave controller is checked in into the computer)
Once I hit Save, the icon of the Z-Wave serial controller changes to Offline

For comparison, I run the user installed openhab2.
I add the zwave controller, similar to above and it shows up with an Online icon.

What could be the reason for the Z-Wave serial controller showing up with Offline icon when run within eclipse (see img1)?

The console in eclipse complains that /dev/ttyUSB0 does not exist (see snippet1), but /dev/ttyUSB0 does exist and also works for the user install:

ll /dev/ttyUSB0 
crw-rw---- 1 root dialout 188, 0 Nov 26 21:36 /dev/ttyUSB0


2016-11-26 21:02:23.320 [INFO ] [ome.event.ThingStatusInfoEvent:43   ] - 'zwave:serial_zstick:158a41ff96d' updated: INITIALIZING
2016-11-26 21:02:23.320 [DEBUG] [b.z.handler.ZWaveSerialHandler:69   ] - Initializing ZWave serial controller.
2016-11-26 21:02:23.320 [DEBUG] [o.b.z.h.ZWaveControllerHandler:87   ] - Initializing ZWave Controller.
2016-11-26 21:02:23.322 [INFO ] [b.z.handler.ZWaveSerialHandler:79   ] - Connecting to serial port '/dev/ttyUSB0'
2016-11-26 21:02:23.324 [DEBUG] [s.c.d.internal.PersistentInbox:197  ] - Discovery result with thing 'ntp:ntp:local' not added as inbox entry. It is already present as thing in the ThingRegistry.
2016-11-26 21:02:23.325 [INFO ] [nt.ThingStatusInfoChangedEvent:43   ] - 'zwave:serial_zstick:158a41ff96d' changed from UNINITIALIZED to INITIALIZING
2016-11-26 21:02:23.327 [INFO ] [ome.event.ThingStatusInfoEvent:43   ] - 'zwave:serial_zstick:158a41ff96d' updated: OFFLINE (BRIDGE_OFFLINE): Controller is offline
2016-11-26 21:02:23.327 [INFO ] [nt.ThingStatusInfoChangedEvent:43   ] - 'zwave:serial_zstick:158a41ff96d' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline
2016-11-26 21:02:23.341 [DEBUG] [s.m.r.r.i.e.RuleTriggerManager:570  ] - Scheduled rule 'Set random room temperatures' with cron expression '0 0/5 * * * ?'
2016-11-26 21:02:23.342 [INFO ] [ome.event.ThingStatusInfoEvent:43   ] - 'zwave:serial_zstick:158a41ff96d' updated: OFFLINE (COMMUNICATION_ERROR): Serial Error: Port /dev/ttyUSB0 does not exist
2016-11-26 21:02:23.342 [DEBUG] [s.m.r.r.i.e.RuleTriggerManager:570  ] - Scheduled rule 'ut' with cron expression '0 0 0 * * ?'
2016-11-26 21:02:23.342 [INFO ] [nt.ThingStatusInfoChangedEvent:43   ] - 'zwave:serial_zstick:158a41ff96d' changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to OFFLINE (COMMUNICATION_ERROR): Serial Error: Port /dev/ttyUSB0 does not exist


This was easy. All I had to do is change the permissions on /dev/ttyUSB0

sudo chmod 666 /dev/ttyUSB0
ll /dev/ttyUSB0 
crw-rw-rw- 1 root dialout 188, 0 Nov 26 21:36 /dev/ttyUSB0

After this, the zwave controller changes it’s icon to Online

Came across this post via google and so may do other, while chmod 666 does works, the more proper solution would be to add the openhab user to the dialout group, for example like this:

sudo usermod -aG dialout openhab