Ask Your Question

How to access serial port on RPi3?

asked 2018-06-01 19:33:49 -0500

chrisalbertson gravatar image

I guess this is not exactly a ROS question but I'm wring a ROS node to control a hardware device. This runs on a Raspberry Pi3 under Ubuntu 16.04 The device connects to pins 8 and 10 (rx and tx) As best I can figure this is /dev/ttyAMA0.

A simple test "echo testing 123" > /dev/ttyAMA0" hangs and never completes. I get the same hang with my Python script.

It is not a permission problem, that would generate an error massage. I'm in the dialout group and so is /dev/ttyAMA0.

edit retag flag offensive close merge delete


It's odd that transmit hangs, I've only seen that happen when flow control is enabled. Do you have hardware or software flow control enabled?

ahendrix gravatar image ahendrix  ( 2018-06-01 20:49:27 -0500 )edit

Thanks, now I will have to figure out how to set/unset flow control. I did not do anything to the port other then try to write to it. But I can research flow control.

chrisalbertson gravatar image chrisalbertson  ( 2018-06-01 22:49:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-02 02:08:14 -0500

On the Pi3, the serial port is standard configured to the bluetooth adapter. To change this, you have to change the boot/config.txt file : "enable UART=1". After that, I could use the serial port with a python sketch. Tx/Rx is on Pin 14/15 from the Pi3 ! image description Success

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-06-01 19:33:49 -0500

Seen: 113 times

Last updated: Jun 01 '18