Additionally it’s needed to allow the java environment to access the serial port of the connected peripheral. Therefore the following setting has to be added/adapted on your system in file /etc/default/openhab2:
Yes that can be a place but. It’s it strange to set a variable in the system while its needed in the program.
And i’m working on a Synology so i’m not sure /def/default/openhad2 will stay after any major update.
There should be a file somewhere in the userdata where this could be defined.
In the end i found that the Synology has also something like a dailout group called HTTP settings this made it work.
Reviving an old thread as it looks like you may have solved a serial device access issue similar to what I am facing.
I’ve installed OpenHab2 (2.2.0.008-SNAPSHOT) on a Synology Diskstation (DS415play running DSM 6.1.4). I have OpenHab running with the Paper UI and have Bindings working that require only network access (Weather, etc). I’ve been trying without success to get the UPB (Universal Powerline Bus) Binding working but logs show “java.lang.RuntimeException: Port does not exist” and the Binding fails to start.
After reading this and other threads I have added the “openhab2” user to the “http” User Group using the “User” Control Panel widget. This did not seem to fix the issue.
I’ve also seen reference to modifying the “EXTRA_JAVA_OPTS environmental variable” as noted in this thread but my installation has no /etc/defaults/openhab2 file and I’m not familiar enough with this OS to know where to go looking.
If you have any pointers on how to get over this hurdle I would really appreciate it.
I put the
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyEnocean"
in
/volume1/@appstore/openHAB/runtime/bin/setenv
somewhere above the line "export EXTRA_JAVA_OPTS … "
Also make sure the device has the right permissions set to be readable and writable by openhab.
I have similar problem. I run Openhab2 (2.3.0 snapshot) from command line in a custom folder ( /testfield/openhab/openhab-2.3.0-snapshot ) and want to use a virtual serial port that was set up with socat at /tmp/virtualcom0.
I tried to add EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyS0:/dev/ttyS1:/tmp/virtualcom0" to different files without success.
The documentation of openhab serial binding still says to edit start.sh.
Other posts recommend to edit /etc/default/openhab2, which I do not have. Creating such a file does not work.
I even tried to edit .../runtime/bin/setenv.
The output on openhab is always:
21:07:06.284 [ERROR] [del.item.internal.GenericItemProvider] - Binding configuration of type 'serial' of item 'E_Wo_Beam_RS232' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Could not open serial port /tmp/virtualcom0: Serial port '/tmp/virtualcom0' could not be found. Available ports are:
/dev/ttyUSB0
/dev/ttyS0
I am lost. Where is the right location to set additional ports, if openhab is running from individual folder by command line?
me@home:~$ groups openhab
openhab : openhab tty dialout
this is correct, or?
to put it in /dev/, I had to run socat as root. But the result is the same…
00:08:06.832 [ERROR] [del.item.internal.GenericItemProvider] - Binding configuration of type 'serial' of item 'E_Wo_Beam_RS232out' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Could not open serial port /dev/virtualcom0: Serial port '/dev/virtualcom0' could not be found. Available ports are:
/dev/ttyUSB0
/dev/ttyS0
I tripple-checked every line for spelling errors, but cant find anything. Probably its a total stupid reason
Hi Rainer,
It looks like you are give the solution for my Serialport issue with OpenHAB 2.5 on my synology system. Thanks. I cab locate the file and find the location to add EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyEnocean" Problem is that I can save the file. The rights seem to be correct. See error message. Can you help to get this solved. scp: /volume1/@appstore/openHAB/runtime/bin/setenv: set times: Operation not permitted