[Solved] How to define a serial port on raspberry for openhab2 for my razberry zwave binding?

Please notice - if we use the razberry board and declare the seriel port with the java-option “Dgnu.io …” all other serial ports will be unknown. If someone use the USB0 for enocean he must edit the jave options: “Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0:/dev/ttyUSB0”. With OH 1.x this works fine - i hope in OH 2 just as well. :slightly_smiling:

Thank you for the tip. I’ve managed to get a bit further with my OH setup with this, however, I still cannot see my zwave devices (using HABmin 2.0).

Also, is it normal that I cannot see zwave binding under the bindings in OH2?

zwave_log.pdf (17.3 KB)

Is it still an issue with the serial port or anything else?

I’m having odd issues as well with my razbery. The log is full of activity and I see xml files for some of my nodes in the userdata/zwave folder but I can’t select any binding in the setup wizard, bore really do anything. then eventually the ui becomes unresponsive.

I can’t seem to figure out where I need to add this export EXTRA_JAVA_OPTS command. I’m currently running Openhab2 on a raspberry pi setup using the OpenhabianPi install. Everywhere I’ve tried putting the export command, it does not take effect for the automatically started Openhab service.

I tried adding the port to the following file…
/usr/share/openhab2/runtime/karaf/bin/setenv
It worked when starting manually but not via the service.

In the end I went for a far simpler option of giving the openhab user permission to access those ports with the following command.

sudo adduser openhab dialout

Edit the EXTRA_JAVA_OPTS environment variable defined in the /etc/default/openhab2 file.

If this file does not exist on your system check your startup file (eg /etc/init.d/openhab2). This will allow you to determine the path for a file that loads user defined environment variables.

Running (OpenHabian, R-pi3 b+)
I’ve been lurking for a couple weeks trying to get OH2 setup on my Rpi to replace OH1 running on my PC. The biggest roadblock I see still is the serial binding I need to connect to my Optoma projector via USB–>RS232 from the pi.

For the others out there trying the same with the oh1.x serial binding, this thread has gold in it but, the:

“Edit the EXTRA_JAVA_OPTS environment variable defined in the /etc/default/openhab2 file.”

does NOT seem to work. I’ve put all my usb ports in there, and verified that the ports are running with my usb->serial dongle functioning. I have verified the users(pi, openhab, and root) all have access to the ports/dialout. At this point I still get " /dev/ttyUSB0 does not exist" error in OH2. It may have worked for OH1, but it seems like OH2 is still a bit different. The next time I have to work on this I’ll try adding it to some of the other files suggested above, and report back what I find.

disclaimer - I’m a beginner/novice user in OH, but a complete armature in Linux

I’m a n00b on this. Also on Razberry and Raspberry Pi 3. And have no clue anymore what we are attempting to do to fix.
As understand from the posts so far the problem is in all attempts to get the Razberry operational with Openhab2.
In the paper ui it states I added
zwave:serial_zstick:9c5547a1
Z-Wave Serial Controller
Z-Wave USB Stick with Serial Interface

Did I maybe just missed the complete point and should I be adding another “thing”. Is there something coming up in the future?

I tried all the above advises and get the idea that there is no working solution. Strange since z-way works out of the box. Are we sure that we are looking at the right tty port?
Maybe I need to install a driver first?

So completely lost with no clue how to continue. Who can give us a push in the right direction.

Finally online

As I understand from domoticanoob.nl the razberry uses the same port on the raspberry pi 3 as bluetooth. So if you are not really need bluetooth :
sudo echo “dtoverlay=pi3-disable-bt” >> /boot/config.txt
sudo reboot now

after reboot /dev/ttyAMA0 is available again.

Why it does work with Z-way I completely don’t understand. But i’m online now!!!

Hi Peter,

i didn’t find the folder: runtime/karaf
can you tell me how can i to change the setenv file.?
Thanks

just start to use openhabian and you get the option to configure razberry via a menu. btw… there is not need to change setenv in /usr/share/openhab2/runtime/bin anymore… just configure the port via the menu in openhabian or do it manually via sudo nano /etc/default/openhab2
e.q. EXTRA_JAVA_OPTS=" -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0:/dev/ttyUSB0"

1 Like

In
/etc/udev/rules.d/
everyone may define their own USB device naming rules.

Here it is possible to create device names such as but not limited to
/dev/razberry
/dev/optoma
/dev/jeelink
/dev/cul868
etc.

instead of cryptic ones like
/dev/AMA0
/dev/ACM0
/dev/USB0
/dev/USB1

The later is the use case for this rules:
Assumed you have 2 USB->RS232 devices connected to your Raspberry Pi, both using the same adapter chip like the FTDI, they will be numbered /dev/USB0 and /dev/USB1. Now this is dangerous. If you replug them in an arbitray order into the usb sockets, the numbers may change. To prevent this the udev rules were invented.

You may even fix permissions (!), owner and group in rules, and they are automatically applied every time you plug in your device, no manual interaction needed and it will survive a reboot.

See for example:

1 Like

I spent hours on this, only to find that I was setting the variable EXTRA_JAVA_ARGS in /etc/default/openhab2 while the actual variable that /usr/share/openhab2/runtime/bin/shell uses is EXTRA_JAVA_OPTS. The very small difference in variable name is so easy to overlook that it took me a very long time to notice it.

Now that updated in /etc/default/openhab2 with the line I can finally get OH2 to start correctly even when Ubuntu decides to renumber my /dev/ttyUSB ports randomly.

EXTRA_JAVA_OPTS=-Dgnu.io.rxtx.SerialPorts=/dev/insteon:/dev/zwave:/dev/prolific

I hope this helps someone.

3 Likes

I had a similar problem, I always received an error that my Razberry serial device was not identified after upgrading from Openhab 2.0 to 2.1. The error console showed “OFFLINE (COMMUNICATION_ERROR): zwave.thingstate.serial_notfound”.

It turns out that the serial port needs to be specifically activated for Java. I had to manually edit /etc/default/openhab2 and add the line “EXTRA_JAVA_OPTS=”-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0". Then it worked.

1 Like

Hello guys n girls,

I’m having a nightmare trying to get my Z-wave controller and AEON 5-way sensor to work in OH2.2 I seem to be going round in circles when I try to search for the solution on the forum…many talk about similar issues but there does not seem to be an easy step by step guide to setting up the Z-wave USB stick on my Raspberry Pi. I just tried the above steps and rebooted my Pi to get the following errors in the log:

2018-08-18 22:28:57.795 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:5ad5c18c' changed from UNINITIALIZED to INITIALIZING

==> /var/log/openhab2/openhab.log <==

2018-08-18 22:28:57.930 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyAMA0'

==> /var/log/openhab2/events.log <==

2018-08-18 22:28:57.937 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:5ad5c18c' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline

==> /var/log/openhab2/openhab.log <==

2018-08-18 22:28:57.984 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Serial port is initialized

2018-08-18 22:28:58.011 [INFO ] [mmandclass.ZWaveSecurityCommandClass] - Update networkKey

2018-08-18 22:28:58.056 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller

2018-08-18 22:28:58.060 [INFO ] [ve.internal.protocol.ZWaveController] - ZWave timeout is set to 5000ms. Soft reset is false.

Also to clarify in my OH service Option I have the following line added:

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"

Any suggestions…and please help with a view that I’m a Linux noob :slight_smile:

Thanx Chris.

You’re not getting much in your log, so turn on debugging. In the Karaf console, run:

log:set DEBUG org.openhab.binding.zwave

Then restart OH and see what the log tells you. Remember to set the logging back to INFO or WARN when you are done troubleshooting! Just run this again, but replace DEBUG with the new logging level.

Thanx for the fast response 5iver!

I did say that I’m a Linux Noob…so how to get in to karaf…I searched and found the topic that should have given me the answer but alas like so many topics on here they are out of dated and lead the Linux novice like me around in circles!!

https://community.openhab.org/t/karaf-console/7982/15

In Putty I ran command: “ssh karaf@localhost -p 8101” but couldn’t pass the password prompt. Then I tried “sudo ssh karaf@localhost -p 8101” and it asked me for my openhabian password:

[09:28:34] openhabian@openHABianPi:~$ sudo ssh karaf@localhost -p 8101
[sudo] password for openhabian:
The authenticity of host '[localhost]:8101 ([::1]:8101)' can't be established.
RSA key fingerprint is SHA256:NktZswipTeJCra4vbkdWk7oFQ1XGOGwXXs9Xs8Z50P0.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '[localhost]:8101' (RSA) to the list of known hosts.
Password authentication
Password:

Here I exited Putty so as (hopefully) not proceed any further with something that I don’t know.

Can I extend the logs just using Putty and ssh?

Thanx and BR
Chris

That’s an old post… the docs are more current…

There may be some nuances using openHABian…

Here are some details on logging. You could also just edit a file, rather than use Karaf…

I’m using openhabian and this is how I access the Karaf console:

SSH in via Putty then type in sudo openhab-cli console (you may or may not need to use sudo)

User: openhab
Password: habopen (or whatever your password is)

Then as mentioned above

Thank you people for the replies and assistance, I made some headway but still can not get data out of the Aeon DSB05 4 way sensor …yet. But i have managed to get the Z-Wave 5 USB stick to work and now get the following logs from a system restart:

2018-08-26 00:07:58.736 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:5ad5c18c' changed from UNINITIALIZED to INITIALIZING

2018-08-26 00:07:58.802 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:5ad5c18c' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline

==> /var/log/openhab2/openhab.log <==

2018-08-26 00:07:58.804 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyACM0'

2018-08-26 00:07:58.828 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Serial port is initialized

2018-08-26 00:07:58.841 [INFO ] [mmandclass.ZWaveSecurityCommandClass] - Update networkKey

2018-08-26 00:07:58.864 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller

2018-08-26 00:07:58.866 [INFO ] [ve.internal.protocol.ZWaveController] - ZWave timeout is set to 5000ms. Soft reset is false.

==> /var/log/openhab2/events.log <==

2018-08-26 00:08:01.299 [ome.event.ItemCommandEvent] - Item 'OHFriendlyUptime' received command 0d 3h 3m

2018-08-26 00:08:01.307 [vent.ItemStateChangedEvent] - OHFriendlyUptime changed from 0d 3h 1m to 0d 3h 3m

2018-08-26 00:08:01.899 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 10 to 1

2018-08-26 00:08:01.901 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 10 to 1

2018-08-26 00:08:01.943 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 1 to 2

2018-08-26 00:08:01.944 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 1 to 2

2018-08-26 00:08:01.952 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 2 to 3

2018-08-26 00:08:01.954 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 2 to 3

2018-08-26 00:08:01.976 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 3 to 4

2018-08-26 00:08:01.981 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 3 to 4

2018-08-26 00:08:01.987 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 4 to 5

2018-08-26 00:08:01.990 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 4 to 5

2018-08-26 00:08:01.996 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 5 to 6

2018-08-26 00:08:02.092 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 5 to 6

==> /var/log/openhab2/openhab.log <==

2018-08-26 00:08:02.097 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 1: Node found

2018-08-26 00:08:02.099 [INFO ] [age.SerialApiGetInitDataMessageClass] - ZWave Controller using Controller API

2018-08-26 00:08:02.100 [INFO ] [age.SerialApiGetInitDataMessageClass] - ZWave Controller is Primary Controller

2018-08-26 00:08:02.101 [INFO ] [age.SerialApiGetInitDataMessageClass] - ------------Number of Nodes Found Registered to ZWave Controller------------

2018-08-26 00:08:02.103 [INFO ] [age.SerialApiGetInitDataMessageClass] - # Nodes = 1

2018-08-26 00:08:02.105 [INFO ] [age.SerialApiGetInitDataMessageClass] - ----------------------------------------------------------------------------

==> /var/log/openhab2/events.log <==

2018-08-26 00:08:02.115 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 6 to 7

2018-08-26 00:08:02.118 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 6 to 7

2018-08-26 00:08:02.721 [hingStatusInfoChangedEvent] - 'zwave:serial_zstick:5ad5c18c' changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to ONLINE

2018-08-26 00:08:02.730 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 7 to 8

2018-08-26 00:08:02.733 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 7 to 8

2018-08-26 00:08:02.745 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 8 to 9

2018-08-26 00:08:02.750 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 8 to 9

2018-08-26 00:08:02.774 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_ack changed from 9 to 10

2018-08-26 00:08:02.776 [vent.ItemStateChangedEvent] - zwave_serial_zstick_5ad5c18c_serial_sof changed from 9 to 10

But I cant figure out how to get the sensor data to output. I have the NULL data on my Sitemap. I think it is something to do with adding the sensor channels to OH but I have not found any solution yet. If i go in to Paper UI/Services/IO and the “Configure” option ther is at the top right side an option “Items to expose to apps such as IFTTT” and in the drop down menu that appears i can find the AEON sensor channels such as Hallway_Humidity, Hallway_Luminence, Hallway_Motion and Hallway_Temperture…so from this I deduce that the sensor has been “seen” by OH.

My Default.Items entry is like this:

// 5-Way Multi Sensor (temp, humid, light, motion, batt)
Number   Hallway_Temperature "Hallway Temperature [%.1f °C]"    <temperature>    (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=1,sensor_scale=0"}
Number   Hallway_Humidity    "Hallway Humidity    [%.0f %%]"    <humidity>       (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=5"}
Number   Hallway_Luminance   "Hallway Luminance   [%.0f Lux]"   <light-off>      (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=3"}
Contact  Hallway_Motion      "Hallway Motion [%s]"              <motion>         (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_binary,respond_to_basic=true"}
Number   sensor_1_battery    "Battery [%s %%]"                  <battery>        (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=battery"}

and my Default.sitemap is like this:

            Text item=Hallway_Temperature label="Hallway Temperature"    icon="temperature"
            Text item=Hallway_Humidity    label="Hallway Humidity"       icon="humidity"
            Text item=Hallway_Luminance   label="Hallway Luminance"      icon="light-off"
            Switch item=Hallway_Motion    label="Hallway Motion"         icon="motion"
            Text item=sensor_1_battery    label="Battery Level"          icon="battery"

If I go in to Paper UI and the Control then select my Z-wave item all I see there is:
Start Frames 10
Frames Acknowledged 10
Frames Rejected -NAN
Frames Cancelled -NAN
OOF Bytes Received -NAN

The AEON DSB05 has been updated to the latest firmware available from the AEON website.

Any suggestions?