The RS232 loopback

You can check whether the serial port connections are working correctly using a serial loopback.

A simple loopback consists of connecting RXD and TXD together. These are pins 8 and 10 on the Raspberry Pi GPIO header, or pins 2 and 3 on the standard RS232 D9 connector on the USB-RS232 adapter:

Serial loopback connections to test the Raspberry Pi GPIO (left) and RS232 9-Way D connector (right)

An RS232 full loopback cable also connects pin 4 (DTR) and pin 6 (DSR) as well as pin 7 (RTS) and pin 8 (CTS) on the RS232 adapter. However, this is not required for most situations, unless these signals are used. By default, no pins ...

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.