[SOLVED] Pi3 ttyAMA0 does not exist

Issue
After reading all the topics on the OH community I am still stuck…

When trying to add an mqttSensor binding with the MySensors serialGateway the /dev/ttyAMA0 is not recognized by OH, I get he following error:

[ERROR] [col.serial.MySensorsSerialConnection] - No such port: /dev/ttyAMA0

Hardware/Software

Raspberry Pi3
OpenHabian (OH 2.4.0)
rfm69 radio module

Setup

The rfm69 radio module is directly hooked up to the Pi GPIOs.

MySensors install to set Pi as a serial gateway is OK.

Jul 23 20:01:48 INFO Starting gateway…
Jul 23 20:01:48 INFO Protocol version - 2.3.2-beta
Jul 23 20:01:48 DEBUG Serial port /dev/ttyAMA0 (115200 baud) created
Jul 23 20:01:48 DEBUG MCO:BGN:INIT GW,CP=RPNGL—,FQ=NA,REL=6,VER=2.3.2-beta
Jul 23 20:01:48 DEBUG TSF:LRT:OK
Jul 23 20:01:48 DEBUG TSM:INIT
Jul 23 20:01:48 DEBUG TSF:WUR:MS=0
Jul 23 20:01:48 DEBUG TSM:INIT:TSP OK
Jul 23 20:01:48 DEBUG TSM:INIT:GW MODE
Jul 23 20:01:48 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
Jul 23 20:01:48 DEBUG MCO:REG:NOT NEEDED
Jul 23 20:01:48 DEBUG MCO:BGN:STP
Jul 23 20:01:48 DEBUG MCO:BGN:INIT OK,TSP=1
Jul 23 20:01:48 DEBUG TSM:READY:NWD REQ
Jul 23 20:01:48 DEBUG TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:

OpenHab serial configuration

  1. Conf 1

First I tried to configure with the openhabian-config built in menu. System Config / Serial Port then disabled Bluetooth module and added common serial ports to openhab and rebooted.

Still the same error:

[ERROR] [col.serial.MySensorsSerialConnection] - No such port: /dev/ttyAMA0

  1. Conf 2

Then I tried a manual configuration

Add openhab user to dialout and tty

sudo adduser openhab dialout
sudo adduser openhab tty

Added the following to disable Bluetooth

sudo vi /boot/config.txt
dtoverlay=pi3-disable-bt
enable_uart=1

result

dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=60fc9108-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Added the Env vars

sudo vi /etc/default/openhab2
EXTRA_JAVA_OPTS=”-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyAMA0″

I made sure that all other extra opts are commented out.

I ran dmesg | grep tty

[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000 dwc_otg.lpm_enable=0 console= tty 1 root=PARTUUID=60fc9108-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[ 0.000903] console [ tty 1] enabled
[ 0.899751] 3f201000.serial: tty AMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2

Still the same error

[ERROR] [col.serial.MySensorsSerialConnection] - No such port: /dev/ttyAMA0

Any ideas? Thank you for your help.

Does /dev/ttyAMA0 exist? Does the openHAB user have permission to read/write to it? This is usually accomplished by adding the openHAB user to the dialout or tty group.

Thank you for your reply,

openHab belongs to tty and dialout:

grep tty /etc/group
tty ::5:openhab,openhabian

grep dialout /etc/group
dialout ::20:openhabian,openhab

/dev/ttyAMA0 seems to exist:

dmesg | grep tty
[ 0.000903] console [ tty 1] enabled
[ 0.899838] 3f201000.serial: tty AMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2

Found the issue, the MySensors pty port is identical as in openhab, therefore ttyAMA0 is busy. changed pty to any dummy name, now it is working.