ksieluk
Posts: 15
Joined: Tue Sep 11, 2012 8:03 pm

UART from GPIO connection

Mon Nov 19, 2012 10:47 pm

Hi,

I am trying to communicate Raspberry PI with AVR uC. I thought the simplest way to do that would be UART protocol.

I wrote simple code for uC where I send few bytes via UART (it works correctly) and also short script in Python on Raspberry to receive that data.

However, i failed in attempt to prepare RPi GPIO UART.

In every tutorial there is something like this:
You also have to edit /etc/innitab to remove the login (getty)

comment out:
2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
(http://baldwisdom.com/preparing-for-a-l ... d-arduino/)

Butin ArchLinux I am using, there is no such file /etc/innitab!

I guess that this is my problem becouse when I run my script I get message:
File "./uart.py", line 9, in <module>
ser.open()
File "/usr/lib/python2.7/site-packages/serial/serialposix.py", line 271, in open
raise SerialException("Port is already open.")
serial.serialutil.SerialException: Port is already open.
To me, that means that UART has already been initialized by kernel, so my question is: how to forbid him to do it :)

I do apologize for all language mestakes,
greetings,
ksieluk

jwatte
Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

Re: UART from GPIO connection

Tue Jan 08, 2013 6:20 am

This is a little late, but Arch uses the newer "systemd" way of starting processes, rather than init.

This command will remove a particular getty process:

systemctl disable getty@tty1
systemctl stop getty@tty1

dolson14
Posts: 21
Joined: Sat May 12, 2012 12:20 am
Contact: Website

Re: UART from GPIO connection

Sun Feb 10, 2013 2:07 am

systemctl disable getty@tty1
systemctl stop getty@tty1
In this case, I think you actually want to stop getty@ttyAMA0? I'm in the middle of figuring out for the first time how to use the GPIO on my Pi. Shame I haven't done it before.. =( Anyway, my understanding is that tty1 is the terminal that sends output to the monitor, and ttyAMA0 is the one connected to the UART pins. Am I correct in my thinking here?

Return to “Beginners”