Port dev/ttyAMA0 does not exist

Uh, yes, that error is ‘correct’ - you have a /dev/ttyAMA0.

My guess is, the user that your application is running as is not root or a member of the tty group. I guess the best practice is to add the user to the tty group, but maybe the application is intended to run as root?

Hi pelnet,

sorry, I am a beginner only. How do I add the user “openhab” to the tty group?

Hey, no worries.

Depending on your distro it should be something like this:

usermod -G tty openhab

You will need to kill the process running as the user before any changes take effect as membership is only evaluated at login. Check that your openhab user now has the correct membership:

su openhab -c "id"

and ‘tty’ should be listed among them with the respective gid (5 on Debian).

oho,

I did the
usermod -G tty openhab
It seems to run.

But I have problems with:
su openhab -c "id"
The sytem ask for a password but it don’t run. The password is correct,because I need this passwort for my Samba access, but also after a reboot, when I try to login as user “openhab” I get no access.

Is this the problem?

Well, first of all, congrats, you fixed your problem :grinning:

That you cannot use the su command is odd, but can be caused by many things. You are doing this as root, right?

If your openhab user doesn’t have a proper shell configured, try

su openhab -s /bin/bash -c "id"

I did it with the same result:
logged in as pi.

pi@raspberrypi ~ $ su openhab -s /bin/bash -c "id"
Password:
su: Authentication failure

Judging by your prompt, you’re not doing this as root. As your problem is resolved, it doesn’t really matter, but you should become root (su, sudo su, … ) and then run the command. The command is effectively running id as the openhab user, which you cannot impersonate by default when you’re pi.

Thanx all of you. I’m not really sure but I think it runs. But now I have the next problem. I try ti incluse some z-wave device but unfortunately without any success. Do there exist a kind of logfile or whatever else what can indicate what’s going wrong.

By the way, within the openhab log I see some messages. Are these messages important?

!SESSION 2016-01-11 22:17:20.543 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=arm, WS=gtk, NL=en_US
Command-line arguments: -data /var/lib/openhab/workspace -console 5555

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:26.619
!MESSAGE Could not bind a reference of component org.openhab.core.itemregistry. The reference is: Reference[name = ItemProvider, interface = org.openhab.core.items.ItemProvider, policy = dynamic, cardinality = 0…n, target = null, bind = addItemProvider, unbind = removeItemProvider]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:26.622
!MESSAGE Could not bind a reference of component org.openhab.core.itemregistry. The reference is: Reference[name = ItemProvider, interface = org.openhab.core.items.ItemProvider, policy = dynamic, cardinality = 0…n, target = null, bind = addItemProvider, unbind = removeItemProvider]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:26.792
!MESSAGE Could not bind a reference of component org.openhab.core.persistence.extensions. The reference is: Reference[name = PersistenceService, interface = org.openhab.core.persistence.PersistenceService, policy = dynamic, cardinality = 0…n, target = null, bind = addPersistenceService, unbind = removePersistenceService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:26.793
!MESSAGE Could not bind a reference of component org.openhab.core.persistence.extensions. The reference is: Reference[name = PersistenceService, interface = org.openhab.core.persistence.PersistenceService, policy = dynamic, cardinality = 0…n, target = null, bind = addPersistenceService, unbind = removePersistenceService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:31.647
!MESSAGE Could not bind a reference of component org.openhab.core.persistence.manager. The reference is: Reference[name = PersistenceService, interface = org.openhab.core.persistence.PersistenceService, policy = dynamic, cardinality = 0…n, target = null, bind = addPersistenceService, unbind = removePersistenceService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:31.648
!MESSAGE Could not bind a reference of component org.openhab.core.persistence.manager. The reference is: Reference[name = PersistenceService, interface = org.openhab.core.persistence.PersistenceService, policy = dynamic, cardinality = 0…n, target = null, bind = addPersistenceService, unbind = removePersistenceService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:47.714
!MESSAGE Could not bind a reference of component org.openhab.ui.chart. The reference is: Reference[name = ChartProvider, interface = org.openhab.ui.chart.ChartProvider, policy = dynamic, cardinality = 0…n, target = null, bind = addChartProvider, unbind = removeChartProvider]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:47.716
!MESSAGE Could not bind a reference of component org.openhab.ui.chart. The reference is: Reference[name = ChartProvider, interface = org.openhab.ui.chart.ChartProvider, policy = dynamic, cardinality = 0…n, target = null, bind = addChartProvider, unbind = removeChartProvider]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:47.746
!MESSAGE Could not bind a reference of component org.openhab.ui.chart.defaultprovider. The reference is: Reference[name = PersistenceService, interface = org.openhab.core.persistence.PersistenceService, policy = dynamic, cardinality = 0…n, target = null, bind = addPersistenceService, unbind = removePersistenceService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:47.747
!MESSAGE Could not bind a reference of component org.openhab.ui.chart.defaultprovider. The reference is: Reference[name = PersistenceService, interface = org.openhab.core.persistence.PersistenceService, policy = dynamic, cardinality = 0…n, target = null, bind = addPersistenceService, unbind = removePersistenceService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:47.874
!MESSAGE Could not bind a reference of component org.openhab.ui.webapp.pagerenderer. The reference is: Reference[name = WidgetRenderer, interface = org.openhab.ui.webapp.render.WidgetRenderer, policy = dynamic, cardinality = 0…n, target = null, bind = addWidgetRenderer, unbind = removeWidgetRenderer]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:47.875
!MESSAGE Could not bind a reference of component org.openhab.ui.webapp.pagerenderer. The reference is: Reference[name = WidgetRenderer, interface = org.openhab.ui.webapp.render.WidgetRenderer, policy = dynamic, cardinality = 0…n, target = null, bind = addWidgetRenderer, unbind = removeWidgetRenderer]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:54.228
!MESSAGE Could not bind a reference of component org.openhab.io.habmin.servlet. The reference is: Reference[name = PersistenceService, interface = org.openhab.core.persistence.PersistenceService, policy = dynamic, cardinality = 0…n, target = null, bind = addPersistenceService, unbind = removePersistenceService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:54.229
!MESSAGE Could not bind a reference of component org.openhab.io.habmin.servlet. The reference is: Reference[name = PersistenceService, interface = org.openhab.core.persistence.PersistenceService, policy = dynamic, cardinality = 0…n, target = null, bind = addPersistenceService, unbind = removePersistenceService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:54.231
!MESSAGE Could not bind a reference of component org.openhab.io.habmin.servlet. The reference is: Reference[name = ConfigurationService, interface = org.openhab.binding.zwave.internal.config.OpenHABConfigurationService, policy = dynamic, cardinality = 0…n, target = null, bind = addConfigurationService, unbind = removeConfigurationService]

!ENTRY org.eclipse.equinox.ds 4 0 2016-01-11 22:26:54.232
!MESSAGE Could not bind a reference of component org.openhab.io.habmin.servlet. The reference is: Reference[name = ConfigurationService, interface = org.openhab.binding.zwave.internal.config.OpenHABConfigurationService, policy = dynamic, cardinality = 0…n, target = null, bind = addConfigurationService, unbind = removeConfigurationService]

Is there someone who can help me? I can do whaterver I want but I can’t include any z-wave device. What can I do to separate the mistake

Hi, well at least you can see your controller… I´m not even that far :-(. I´m also brand new to the zwave stuff and also using the module. With Razberry software it is working and i included my fibaro RGBW module. But in Openhab I can´t even get the controller in.

May the z-wave be with you… I know not a helping post, but at least you know you are not alone :slight_smile:

Greetz

Wizzo

Make sure the Z wave device you’re trying to join has not already been joined to another network.
The Z wave nodes store information about the Z wave controller. If the Z wave controller is reset, the joining is lost and must be unjoined then rejoined.

Does that help?

Hi,

can anyone help me out here? Still facing the issue “Port dev/ttyAMA0 does not exist” with my razberry.
The port seems to exist
ls -la /dev/ttyAMA0
crw-rw-rw- 1 root dialout 204, 64 Apr 3 01:27 /dev/ttyAMA0
These are the members of group dialout:
grep dialout /etc/group
dialout:x:20:pi,openhab

and group tty
grep tty /etc/group
tty:x:5:openhab,pi
What am I still missing here?

Nearly same issue here:

grep dialout /etc/group provides “dialout:x:20:pi,openhab”
but
grep tty /etc/group provides “tty:x:5:”
and > ls /dev/tty* provides “… /dev/ttyAMA0 …”

If you want to add multiple users to the groups, you have to add ‘-a’ parameter as ‘append’. Otherwise a second group change will remove the first user from that group.

sudo usermod -a -G tty openhab
sudo usermod -a -G tty pi
sudo usermod -a -G dialout openhab
sudo usermod -a -G dialout pi

In these commands the ‘-a’ makes the difference whether afterwards you have one or two users in the respective groups.

Setting these groups for both users and doing a reboot solved the issue for me. The device was found by the binding correctly.

Hello all:
I am having this same issue. And think I have tried everything! I am using a PC with Ububtu 16.10 and an AEON Z-Stick Gen 5.

The stick shows as ttyACM0 (different from th pi AMA0) but that seems to be the only difference in the posts I’ve been reading.

So Far:

john@Server:~$ grep tty /etc/group
tty:x:5:openhab,john

And

john@Server:~$ grep dialout /etc/group
dialout:x:20:john,openhab

But:

john@Server:~$  ls -l /dev/ttyA*
crw-rw---- 1 root dialout 166, 0 Mar 13 12:44 /dev/ttyACM0

I aslo did other things I found in other posts. I added a JAVA environment variable to the karaf script and to the start.sh as well. Nothing has worked!

To be fair I did get it to work at one time (a couple weeks ago) but after a power failure and reboot it never came back.
At that point I was reading about others who couldn’t get their dialout setting to “stick”. It does not appear that that is my problem any more.

Thank you for any ideas!

@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)