Robotics StackExchange | Archived questions

How to access serial port on RPi3?

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.

Asked by chrisalbertson on 2018-06-01 19:33:49 UTC

Comments

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?

Asked by ahendrix on 2018-06-01 20:49:27 UTC

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.

Asked by chrisalbertson on 2018-06-01 22:49:33 UTC

Answers

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

Asked by RP6conrad on 2018-06-02 02:08:14 UTC

Comments