Hello
This is the Solution to get ttyAMA0 working:
add to config.txt:
dtoverlay=pi3-miniuart-bt
open terminal connection and use these commands:
sudo systemctl stop serial-getty@ttyAMA0.service
sudo systemctl disable serial-getty@ttyAMA0.service
sudo systemctl mask serial-getty@ttyAMA0.service
to get access with user created python script you have to edit accessrights with (use this after every reboot):
sudo chmod 666 /dev/ttyAMA0
this is my python testscript:
import os
import serialos.popen(‘sudo chmod 666 /dev/ttyAMA0’)
ser = serial.Serial(
port=‘/dev/ttyAMA0’,
baudrate=38400,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=None)print(‘[%s] connected’ % ser.portstr)
count = 1try:
while True:
message = ser.read_until(‘\r’).strip()
if message != ‘’:
print(‘Line %s: %s’ % (count, message))
count += 1except KeyboardInterrupt:
passser.close()
print(‘\n[%s] closed’ % ser.portstr)
Old Request:
Yesterday and today I tried more hours to get the GPIO Uart ttyAMA0 working on Pi3.
My aim is to use the GPIO Uart for Communication to/from Arduinow with Kodi Addon with Baud 38400.
After lot of dtoverlay and systemctl (from lot of outdated websites) i got the message output with simple python script. But i have to run the script with sudo.:
deleted code…
The messages came in, but there are some other messages between, like “password incorrect” “osmc login:”
Do you know what it is, and how to disable this stuff?
Could you tell me how to get access without sudo and kill the confuse messages between?
And yes, i did found the threads in this forum, but i mean these are outdated also.
the image what i’m using is: OSMC_TGT_rbp2_20180316.img.gz
regards