Port dev/ttyAMA0 does not exist

@JDMcQ,
On my system (Ubuntu 16 Xenial VM), I tweaked the settings in /etc/default/openhab2 so it listed /dev/ttyACM0 instead of /dev/ttyAMA0, and then restarted the openhab2 service.

This got it going for me.

The /etc/default/openhab2 file now looks like:

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyACM0"
OPENHAB_HTTP_PORT=8082
OPENHAB_HTTPS_PORT=8445

For my Z-Wave stick, the device was already in the dialout group, and I’d set my Host/Hypervisor (Proxmox) to pass the USB for that port through to my Guest VM.

Mark:
Thank you for the response. I think I have been down this road, but my install seems to vary form others in one way and I’m not sure if it is significant. The apt-get install did not work so I follow another post. The result being everything is installed under /opt/openhab2. As far as I know this has no bearing on functionality but file/folder references never match what 's in posts. Also I didn’t mention that I am using openhab2.

What I have edited:

/opt/openhab2/conf/services/runtime.cfg

Code:

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyAMC0"

As well as in:

/opt/openhab2/runtime/bin/karaf

And:

/opt/openhab2/runtime/bin/setenv

In the last one “setenv” I preceded the line with: export

All these were in responses to posts I had read.

Also note I got it to work by:

sudo chmod  777 /dev/ttyACM0

Then it works until reboot, when I have to do it again. I know this is very silly, but leads me to believe there is some security issue somewhere.

Thank you for your indulgence.

John

Ok. My install is for openhab2, and it was setup using apt-get. Do you have links to the post you’ve used to get it installed?

I’m guessing the /etc/default/openhab2 file, when I’ve installed my environment overrides, is coming out of that apt-get install type.

A few things that might get you further along the way, on my machine.

Permissions on the tty device:

mark$ ls -l /dev/ttyACM0 
crw-rw---- 1 root dialout 166, 0 Mar 12 16:37 /dev/ttyACM0

Group memberships of the openhab account that’s running the stack:

mark$ groups openhab
openhab : openhab tty dialout

The resulting running Java process for openhab, including the env sourced (in the apt-get install-type) from /etc/default/openhab2:

$ ps -elf | grep java
0 S openhab  21503 21345  0  80   0 - 824477 -     Mar12 ?        00:42:04 /usr/bin/java 
-Dopenhab.home=/usr/share/openhab2 
-Dopenhab.conf=/etc/openhab2 
-Dopenhab.runtime=/usr/share/openhab2/runtime 
-Dopenhab.userdata=/var/lib/openhab2 
-Dopenhab.logdir=/var/log/openhab2 
-Dfelix.cm.dir=/var/lib/openhab2/config 
-Dorg.osgi.service.http.port=8082 
-Dorg.osgi.service.http.port.secure=8445 
-Djava.awt.headless=true -XX:+UseG1GC 
-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyACM0 
-Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed 
-Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/ext:/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/share/openhab2/runtime/lib/ext 
-Dkaraf.instances=/usr/share/openhab2/runtime/instances 
-Dkaraf.home=/usr/share/openhab2/runtime 
-Dkaraf.base=/var/lib/openhab2 
-Dkaraf.data=/var/lib/openhab2 
-Dkaraf.etc=/var/lib/openhab2/etc 
-Dkaraf.restart.jvm.supported=true 
-Djava.io.tmpdir=/var/lib/openhab2/tmp 
-Djava.util.logging.config.file=/var/lib/openhab2/etc/java.util.logging.properties 
-Dkaraf.startLocalConsole=false 
-Dkaraf.startRemoteShell=true -classpath /usr/share/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.jaas.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.main-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main

Guessed:

 I'm not finding the link that I followed (still looking). I do 

remember why I had trouble with the initial install though, I put the
wrong version of Java on the system. The ps command you showed, listed
my stuff and I remembered changing the Java install. See below (it’s
long and I’m not sure what you are looking for…

:~$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Mar 16 15:43 /dev/ttyACM0

:~$ groups openhab
openhab : openhab tty dialout

and finally:

:~$ ps -elf |grep java
0 S openhab 2823 2399 0 80 0 - 1693111 - Mar16 ? 00:03:03
/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
-Dfelix.cm.dir=/opt/openhab2/userdata/config
-Dorg.osgi.service.http.port=8080
-Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true
-XX:+UseG1GC -Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0
-Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/opt/openhab2/runtime/lib/endorsed
-Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/ext:/usr/lib/jvm/java-8-oracle/jre/lib/ext:/opt/openhab2/runtime/lib/ext
-Dkaraf.instances=/opt/openhab2/runtime/instances
-Dkaraf.home=/opt/openhab2/runtime -Dkaraf.base=/opt/openhab2/userdata
-Dkaraf.data=/opt/openhab2/userdata
-Dkaraf.etc=/opt/openhab2/userdata/etc
-Dkaraf.restart.jvm.supported=true
-Djava.io.tmpdir=/opt/openhab2/userdata/tmp
-Djava.util.logging.config.file=/opt/openhab2/userdata/etc/java.util.logging.properties
-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath
/opt/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.0.8.jar:/opt/openhab2/runtime/lib/boot/org.apache.karaf.jaas.boot-4.0.8.jar:/opt/openhab2/runtime/lib/boot/org.apache.karaf.main-4.0.8.jar:/opt/openhab2/runtime/lib/boot/org.osgi.core-6.0.0.jar
org.apache.karaf.main.Main
0 S john 22302 22256 0 80 0 - 3557 pipe_w 12:00 pts/6 00:00:00
grep --color=auto java

If you don’t see anything pop out at you, I may wait until U 17.04 hits
the streets and do a complete rebuild. What is the proper Java install
for an AMD box that I plan to use ZWave and Arduinos with. I also have a
pi I may test on n the meantime.

Happy St. Patti’s day, and thank you for going through this with me!

John

Nothing pops, here are a few more details versions, in case one of these is causing it:

java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Ubuntu VM:

cat /proc/version
Linux version 4.4.0-62-generic (buildd@lcy01-30) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017

and my Host is an Intel NUC (NUC6i5SYH) running Proxmox (4.2-4/2660193c)