Talking to a Raspberry Pi 3B Over Serial For Fun and… Profit?

It has only taken me 19 years, 5 months, and 18 days since creating a blog titled “Baud Attitude” before I finally wrote something that justified the horrible pun contained therein.

For anyone that did not come of nerd age during the years of the BBS, “baud” is a measurement of speed in serial communications, so the higher the baud rate your modem could handle the faster your connection was.  Technically “baud” isn’t correct for any speed above 300 baud, but nobody ever cared about the distinction unless you were a crazy pedant.

For the sake of decency, we will not explore the question of whether I personally am one of these crazy pedants.

I think we all know the answer to that one.

Moving on!  Some weeks ago, one of the people I follow on X because they post nerdy things posted a question of what they could do with a Raspberry Pi that wasn’t displaying any image when connected to a monitor, and I asked whether they could connect to it over a serial port.  See, way back in the days when dinosaurs walked the earth, a “terminal” wasn’t a program you ran on your computer.  A “terminal” was a piece of hardware that contained a keyboard and monitor and no local processing power of its own.  You connected a terminal to a serial port on a Unix system or other computer and interacted with the computer that way.

I used to own a couple of terminals.  It’s been a very long time.  I was looking for pictures of one online, but when I started googling “Wyse amber crt terminals” I started being hit with massive waves of nostalgia and an urge to start projects I should not start.  So, I will not post a picture.  Just imagine an old CRT monitor with a clunky beige keyboard in front of it.

This suggestion was not useful.  In fact, it was met with a certain degree of confusion because it turns out that nobody under a certain age has ever connected anything to a serial port.  So I apologized and moved on.  I don’t know whether he ever did get his Pi working again.

BUT IT GOT ME THINKING.

It turns out that the Raspberry Pi does have a serial port hidden in the GPIO pins, and I found a couple of pages (page1) (page2) talking about how to set up a connection and a $10 cable on the Adafruit website that was a USB-to-Serial cable designed for this specific task.

With shipping it was closer to $17, but I will forgive them that.  Technically I could have put more stuff into my cart to qualify for free shipping, but can we talk for a moment about how dangerous that site is to browse?

The cable arrived this week, and it’s something of a personal record that it only took me two days before I took it out of the mailer, plugged it in, and set about trying to make things work.

This isn’t a super involved process.  You need a network connection to the Raspberry Pi (or you can edit a config file on the SD card directly, but this didn’t work for me), you need a power supply for the Raspberry Pi (Here provided via a USB-C-to-Micro-B cable to my laptop) and you need the Adafruit cable.  You also need terminal emulation software on whatever computer you will be using to make the connection, and while it wasn’t installed by default for me, a simple

pacman -Syu && pacman -S screen

was all I needed to get it installed.

To enable terminal emulation on the Pi, I strongly recommend just sshing into the Pi, running raspi-config and enabling the Serial Port under “Interface Options”.  You’re supposed to be able to edit a file under /boot but even after doing so I could not make it work.

Once I sorted this out and rebooted the Pi, I was greeted with a glorious sight:

OK, probably not super glorious.  But it was a success!

I did have some twitchiness working with the Pi over serial to start with.  It seemed to drop a lot of the characters I was typing.  Initially I blamed this on the power from the laptop not being enough for the Pi, but then I fiddled with the connections to the GPIO pins and the problem went away.  So I think I hadn’t pushed the connectors in far enough.

It’s wild to me, by the way, that the connection to the Pi is at 115200 baud with NO HARDWARE HANDSHAKING.  Like, back in the Long-Ago Times it was understood that you could not reliably work over 2400 baud without RTS/CTS handshaking on the serial line.

There was only one remaining annoyance, which was that the official Raspberry Pi case does not allow GPIO access with the case closed.

So it was off to Makerworld for a very simple case to solve the issue and then just a matter of waiting an hour for my A1 to stop making noise and smells.

I used orange because (a) I had a lot of orange filament remaining on a 1 kg spool I bought a few months ago and haven’t had many uses for and (b) I think a bright orange case on a gadget makes it look cool and especially hacky.

It came out pretty well, though it’s a little less clean if I have the requisite cables attached.

The creator of this case has made a “v2” and “v3” version of the case that look even better and allow you to screw the lid down instead of relying on a friction fit, but I didn’t see those when I was grabbing the first case that looked good and clicking “send to printer”.

One last link, because I had a couple of tweaks I wanted to make to the terminal connection after I got it established.  This site has some suggestions on using screen for the connection to your Pi that I appreciated.

What I’d like to find next is a terminal emulator for iPadOS.  That would let me turn this thing into a small companion device for an iPad while I’m out and about.  You can do this natively on a Raspberry Pi 4 or newer, since those switched from micro USB to USB-C, but I haven’t wanted to buy an entirely new Pi just to try that.  I’d also kinda like a way to avoid stress on the GPIO connection because it feels pretty flimsy.

Anyway, there we go.  Finally, an article about a serial connection on a blog whose name itself is a pun on modem speeds.  It didn’t even take twenty years.

This entry was posted in gadgets, linux. Bookmark the permalink.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.