Serial port problem

  • Platform information:
    • Hardware: Raspberry Pi 1
    • OS: Raspbian Stretch
    • Java Runtime Environment: OpenJDK Runtime Environment (Zulu Embedded (build 1.8.0_152-b76)
    • openHAB version: 2.2.0

Currently, I have issues bringing the Z-Wave PLugin to life. The Error I get is: Serial Error: Port /dev/ttyAMA0 does not exist

I manually installed openhab, sticking to

Things I have checked:

  • in the service configuration, in /lib/systemd/system/openhab2.service, i uncommented the line
  • put

into a new file named /etc/default/openhab2

added the openhab user to groups “dialout” and “tty”, so when i

grep tty /etc/group

i get


and when i

grep dialout /etc/group

i get


also, to verify openhab is called with the right parameters, is did

ps ax |grep ttyAMA0

and got

 435 ?        Ss+    0:00 /sbin/agetty --keep-baud 115200,38400,9600 ttyAMA0 vt220
    535 ?        Sl    29:25 /usr/bin/java -Dopenhab.home=/opt/openhab2 -Dopenhab.conf=/opt/openhab2/conf -
    Dopenhab.runtime=/opt/openhab2/runtime -Dopenhab.userdata=/opt/openhab2/userdata -
    Dopenhab.logdir=/opt/openhab2/userdata/logs -
    Djetty.http.compliance=RFC2616 -Dorg.ops4j.pax.web.listening.addresses= -Dorg.osgi.service.http.port=8080 -Djava.awt.headless=true **** -
    armhf/lib/endorsed:/opt/openhab2/runtime/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/zulu-embedded-8-
    armhf/jre/lib/ext:/usr/lib/jvm/zulu-embedded-8-armhf/lib/ext:/opt/openhab2/runtime/lib/ext -
    Dkaraf.instances=/opt/openhab2/userdata/tmp/instances -Dkaraf.home=/opt/openhab2/runtime -
    Dkaraf.base=/opt/openhab2/userdata -Dkaraf.etc=/opt/openhab2/userdata/etc -
    Dkaraf.logs=/opt/openhab2/userdata/logs -Dkaraf.restart.jvm.supported=true - -
    Djava.util.logging.config.file=/opt/openhab2/userdata/etc/ -Dkaraf.startLocalConsole=false -
    Dkaraf.startRemoteShell=true -classpath /opt/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-
    6.0.0.jar org.apache.karaf.main.Main
    13080 pts/0    S+     0:00 grep --color=auto ttyAMA0

I made the interesting part bold, so you don’t have to search the whole thing. So the parameter is in the command line…
Also, to verify that there is a /dev/ttyAMA0:

 ls -la /dev/ttyAMA0


crw--w---- 1 root tty 204, 64 Dec 31 15:29 /dev/ttyAMA0

The java version should be the recommended 32 bit version of zulu,

 java -version


 openjdk version "1.8.0_152"
   OpenJDK Runtime Environment (Zulu Embedded (build 1.8.0_152-b76)
   OpenJDK Client VM (Zulu Embedded (build 25.152-b76, mixed mode, Evaluation)

Any suggestions where to look next?
Thanks a lot,

PS: i already had the thing running with raspbian jessie, oracle java and oh 2.1, but the sd card crashed and so i had to set it up new…

I had a similar problem after upgrading to openhab 2.2. It disappeared after I used the appropriate options in openhabian.

So I was searching around for 3 days now, then decided to ask for help, and now i found it: In a fresh Raspbian Installation, the serial port is occupied by the serial console. I had to switch it off using raspi-config. This was one of the first things I did when I installed my first openhab, half a year ago.
Nevertheless, thanks for your help.

1 Like