# cu(1) - a serial terminal emulator

Normally there's an Adafruit Feather M4 Express with some weather sensors connected to one of the machines.  While I did write a simple serial terminal in Go for displaying the output, something had gone wrong and the program was no longer working the last time I tested it under Void Linux, so I switched to Picocom.  There is also an issue where the Feather will stop updating and the terminal will freeze with some errors about the device not being a tty...

Switching to NetBSD on the RPi Zero W was annoying because the documentation is not very good for some topics, particularly external storage and serial device communication.  It took a while to figure out which of the _many_ tty devices in /dev were actual devices and not just placeholders, but eventually I was able to connect the Feather to the Pi, though this required root privilages to read from /dev/ttyU0.  It also had the same issue of freezing up with a similar message that the device is not a tty...

So when OpenBSD was installed on _all the machines_, it seemed logical to install Picocom and get some weather data from the Feather, except that there's already a serial terminal emulator on OpenBSD, called 'cu'.  It's a rewrite of a "call unix" tool that first appeared in PWB/UNIX 1.0, according to the man page.  It also happens that I _don't_ need root privilages to read from dialout devices, which is exactly what the Feather is.  Either I missed this on NetBSD or the man pages on OpenBSD were more clear on this point.  Either way, it was nice to _not_ install another tool.

First I run dmesg to find out which ucom device is associated with the Feather. It shows 'ucom1 at umodem1', so then I run 'cu -dr -l cuaU1 -s 115200'.  Within seconds, the sensor data shows up on the terminal, and I didn't even have to use doas(1), su(1) or even sudo (which isn't installed).  Awesome!


=> ../../index.gmi Home
=> index.gmi Back to "Adventures in OpenBSD" index