rudiratlos
Posts: 164
Joined: Tue May 01, 2012 8:47 am

rpi3 serial interface ttyAMA0 not working

Tue Jun 21, 2016 8:59 am

Hi,
I can't get my serial interface ttyAMA0 to work. I tried to find clear instructions, but was not successful. Can someone post clear instructions, setp by step to get the interface running please.

Here is my setup:
root@raspberrypi:/home/pi# dmesg | grep tty
[ 0.001330] console [tty0] enabled
[ 0.277486] 3f215040.uart: ttyS0 at MMIO 0x3f215040 (irq = 59, base_baud = 31250000) is a 16550
[ 1.822409] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[ 3.226307] systemd[1]: Starting system-getty.slice.
[ 3.229978] systemd[1]: Created slice system-getty.slice.

excert out of /boot/config.txt :
# Enable UART
core_freq=250
enable_uart=1
dtoverlay=pi3-disable-bt
dtoverlay=pi3-miniuart-bt

/boot/cmdline.txt :
dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

just update raspian and firmware today.
uname -a
Linux raspberrypi 4.4.13-v7+ #894 SMP Mon Jun 13 13:13:27 BST 2016 armv7l GNU/Linux

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: rpi3 serial interface ttyAMA0 not working

Tue Jun 21, 2016 9:09 am

There is serial, and there is serial console. ... then there is blue tooth...

Are you trying to use the serial line, or serial console?

I would disable ALL blue tooth options for the moment; even the miniuart

If you want a serial console you'll need to have the console line in cmdline.txt

Also, you may want to try using serial0, or serial1 (I think ttyAMA0 links to one of those anyways)

Did you do an apt-get update, and apt-get upgrade yet ?
marcus
:ugeek:

rudiratlos
Posts: 164
Joined: Tue May 01, 2012 8:47 am

Re: rpi3 serial interface ttyAMA0 not working

Tue Jun 21, 2016 9:21 am

I want to use the serial line for communication with serial GPS chip

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: rpi3 serial interface ttyAMA0 not working

Tue Jun 21, 2016 9:23 am

rudiratlos wrote:I want to use the serial line for communication with serial GPS chip
Try removing the miniuart bt line from config.txt

... also, make sure you do an

sudo apt-get update
sudo apt-get upgrade

... when done, look in /dev for your devices serial0 and serial1 ... see if ttyAMA0 links to one of those.
marcus
:ugeek:

rudiratlos
Posts: 164
Joined: Tue May 01, 2012 8:47 am

Re: rpi3 serial interface ttyAMA0 not working

Tue Jun 21, 2016 9:45 am

I removed the bt line from config.txt and rebooted. Also updated everything,

root@raspberrypi:/home/pi# ll /dev/ser*
lrwxrwxrwx 1 root root 7 Jun 21 09:33 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Jun 21 09:33 /dev/serial1 -> ttyS0

two terminals open:
cat < /dev/serial0

cat <file> > /dev/serial0

does not work.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: rpi3 serial interface ttyAMA0 not working

Tue Jun 21, 2016 10:16 am

rudiratlos wrote:I removed the bt line from config.txt and rebooted. Also updated everything,

root@raspberrypi:/home/pi# ll /dev/ser*
lrwxrwxrwx 1 root root 7 Jun 21 09:33 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Jun 21 09:33 /dev/serial1 -> ttyS0

two terminals open:
cat < /dev/serial0

cat <file> > /dev/serial0

does not work.
what errors do you get if any ? have you tried as root sudo?

edit: PS Make sure you have your Tx and Rx lines plugged into the right places Tx -> Rx Rx -> Tx

... and retry as sudo

Also, have you tried either minicom or screen to access the comm port (use sudo) so that you can control the baud rate 115200 and 8N1... also, try 9600...
marcus
:ugeek:

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: rpi3 serial interface ttyAMA0 not working

Tue Jun 21, 2016 10:25 am

bump
marcus
:ugeek:

rudiratlos
Posts: 164
Joined: Tue May 01, 2012 8:47 am

Re: rpi3 serial interface ttyAMA0 not working

Tue Jun 21, 2016 11:28 am

thanks for your help, now it works.

/boot/config.txt:
# Enable UART
core_freq=250
enable_uart=1
#dtoverlay=pi3-disable-bt
#dtoverlay=pi3-miniuart-bt

/boot/cmdline.txt:
dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

DavidGMX
Posts: 9
Joined: Sun Jun 19, 2016 2:30 pm

Re: rpi3 serial interface ttyAMA0 not working

Wed Jul 06, 2016 9:30 am

Hi,all

There is a cheap but powerful Lora/GPS HAT for your projects,you can get the example about "Getting GPS to work on a Raspberry Pi" from this link: http://wiki.dragino.com/index.php?title ... spberry_Pi

Image

You can also get the solution about 'how to get the GPS started with the RPi 3 ' there.
Hope it help to the people who need it!

Cheers!

fruitoftheloom
Posts: 23132
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: rpi3 serial interface ttyAMA0 not working

Wed Jul 06, 2016 10:17 am

Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

Return to “Interfacing (DSI, CSI, I2C, etc.)”