Nrjavaserial upgrade causes "Serial Error: Port /dev/ttyACM0 does not exist"

The online package was update today to resolve this:

Preparing to replace openhab2-online 2.0.0~20161226183012 (using .../openhab2-online_2.0.0~20161227112533_all.deb) ...
Unpacking replacement openhab2-online ...
Setting up openhab2-online (2.0.0~20161227112533) ...

It went from 3012 to 2533 as you can see.
Can you see is the offline package was also updated today?

Edit: Second one on the ball …

Hmmm. This what I just got doing an upgrade. Seems be over writing the same version

$ sudo apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages will be upgraded:
openhab2-offline
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/181 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database … 235679 files and directories currently installed.)
Preparing to unpack …/openhab2-offline_2.0.0~20161227112533_all.deb …
Unpacking openhab2-offline (2.0.0~20161227112533) over (2.0.0~20161227112533) …
Processing triggers for systemd (215-17+deb8u5) …
Setting up openhab2-offline (2.0.0~20161227112533) …

Ok I think I may have found the problem. Just dont know how to fix it. Some thing with my Java?

Dec 27 15:00:24 pine64 start.sh[15381]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Dec 27 15:00:24 pine64 start.sh[15381]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
Dec 27 15:00:24 pine64 start.sh[15381]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Dec 27 15:00:24 pine64 start.sh[15381]: at java.lang.Thread.run(Thread.java:745)
Dec 27 15:00:24 pine64 start.sh[15381]: java.lang.ExceptionInInitializerError thrown while loading gnu.io.RXTXCommDriver
Dec 27 15:00:24 pine64 start.sh[15381]: java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while load…mmDriver
Dec 27 15:01:10 pine64 start.sh[15381]: java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while load…mmDriver
Dec 27 15:06:53 pine64 start.sh[15381]: java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while load…mmDriver
Dec 27 15:09:04 pine64 start.sh[15381]: java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while load…mmDriver
Dec 27 15:09:40 pine64 start.sh[15381]: java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while load…mmDriver
Hint: Some lines were ellipsized, use -l to show in full.

I submitted this reinstallation issue here last night. https://github.com/openhab/openhab-linuxpkg/issues/11

Is this supposed to be fixed with the latest build (#682, 2.0.0~20161229034207)?
I still get: Serial Error: Port /dev/ttyS1 does not exist
I have added the openhab user to dialout group and my /etc/default/openhab2 looks like this:
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyS1"
Btw, i do not use a RPi but a Odroid-C2 which also runs Ubuntu 16.04, but a 64-bit one, uname -m gives me aarch64. Might this be a problem?
The serialport and the controller (a RaZberry) is working and responding, i tested it with the MinOZW example from the OpenZWave project.

I am on a rPi2 with a Razberry and having the same problem even after installing build #694. On the offline and the online build I get bundle:list | grep serial
175 | Active | 80 | 3.12.0.OH | nrjavaserial
(where I was expecting to see something like 3.9.x from comments above) and the error persists:
Controller is offline to OFFLINE (COMMUNICATION_ERROR): Serial Error: Port /dev/ttyAMA0 does not exist.
(Note on rPi2 the Razberry is /dev/ttyAMA0).
The apt-get install is still Build #688 so I will do an update and try there.

I have made other comments on Zwave Binding Uninstalls[SOLVED] and Razberry is Offline
Thanks to all those who have posted so we have had things to try with this issue.

Anyone know how to revert to a version like Build #651?

Here is a solution, just in case someone has the same problem with a 64-bit system:
You have to run Openhab2 with a 32-bit JVM. The Serialport library used in Openhab2 currently does not has support for 64-bit.

Found the solution in a comment in this issue:

I loaded up 2.0.0b5 and found that nrjavaserial is not loaded but /dev/ttyAMA0 still does not exist.
Went back to Offline Snapshot Build #697 (there appears to be a need to delete all userdata/etc/ files to change between the two. Is this correct?) and nrjavaserial is version 3.12.0.OH and /dev/ttyAMA0 again does not exist.
Looking for a way to get my zwave devices working again.
Any help appreciated.

If it is a problem that only exists on specific Linux versions (as you now assume), you might try to seek for some help at https://github.com/NeuronRobotics/nrjavaserial and see if others came across similar problems.

Some more specific and detailed log files might also be helpful.

Can anybody else confirm here that he is successfully using Z-Wave with a recent build with /dev/ttyAMA0?

Confirmed with build #710, but using not a Razberry but a USB Zwave stick on /dev/ttyACM0.

2017-01-10 09:32:50.257 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyACM0'
2017-01-10 09:32:50.406 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Serial port is initialized
2017-01-10 09:32:50.526 [INFO ] [mmandclass.ZWaveSecurityCommandClass] - Update networkKey
2017-01-10 09:32:50.575 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller

In this situation the more detail the better to isolate the problem. Which Raspberry Pi are you using and are you running Debian Wheezy or Jessie?
The other difference of course is that the Razberry sits on the RX and TX pins of the gpio and not on the USB bus. This comes down to serial device recognition that was working fine on version 3.9 of nrjavaserial and does not work at all (for me in the situation stated) on version 3.12 of this library.

Thanks Kai. I will pursue this on the github link you provided and am happy to keep testing.
In the meantime I expect it could take a little while to fully shake this one out. Could you please provide a link to an archived version from early December using 3.9 of the library. I have not been able to run my zwave devices for several weeks now.

Did you ask me?

So my answer above is not of any interest and should be ignored.

Yes sorry sihui, I hit the wrong Reply button. Thanks for yr response.

New installation of openhabian on a clean SD card on the rPi2 (installs under Debian Jessie) works with Razberry card :slight_smile: after :
adding -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0" to setenv and
sudo chmod 666 /dev/ttyAMA0
which gives
ls -la /dev/ttyAMA0
crw-rw-rw- 1 root tty 204, 64 Jan 11 18:24 /dev/ttyAMA0
Thanks to all of those involved over at openHABian hassle-free openHAB Setup in putting openhabian together. The installation works very smoothly.

So this may support the case that NrjavaSerial 3.12 does not work under Debian Wheezy - at least on rPi2 devices whereas the previous version 3.9 worked fine. Maybe Wheezy does not support a required dependency of nrjavaserial library.

Hey @robb01 I didn’t get if the new system with openHABian + the two commands helped you in whatever you are trying to do. Please be aware, that these commands are not all that’s needed and that the file setenv is the wrong place for your modifications. There is a menu entry under sudo openhabian-config to do everything for you in the right way: https://github.com/openhab/openhabian/issues/33#issuecomment-267465644

Thanks @ThomDietrich for this comment and all of your good work. I am happy that the new installation went well and the razberry device is recognised. All is looking good after some weeks struggling with nrjavaserial. I will defintely check out the openhabian-config tool and make sure everything is good there. Should I then remove the line I addded to setenv?

It would be redundant then and would get overwritten with one of the future openHAB updates anyhow. So yes, remove it and execute the openHABian steps. Good luck!

Fresh Openhabian(OH2) on R-pi 3b, using usb to serial cable to my Optoma projector. I was stumped up until yesterday. I was getting the /dev/ttyUSB0 does not exist error until I did this as stated above:

  • Update system sudo apt-get update
  • Install: liblockdev1-dev package sudo apt-get install liblockdev1-dev

The projector fired right up on the first try after that.
Thanks guys!

1 Like