/ tuesdaytooling

Tooling Tuesday: Tio

Connecting to a serial port is easy, and now it is even easier!

So what is it?

""tio" is a simple TTY terminal application which features a straightforward commandline interface to easily connect to TTY devices for basic input/output." - tio website.

Yeah but I use screen / byobu / dead badger for serial / tty comms.

This is an alternative which offers a great feature, if the device disconnects, for example when an Arduino board is flashed, tio will wait for the board to reappear and reconnect automatically!

If you like what you read...
BuyMeACoffee_blue@2x-1
Sorry to interrupt! But would you like to buy me a cup of coffee? It helps me to pay for hosting this blog, and to buy stuff to hack from Poundshops / Dollar Stores which are used in free projects on this blog. Thanks!

So how do I install it?

Ubuntu

sudo apt install tio

Snap

sudo apt install tio --classic

Fedora / Red Hat

dnf install tio

Mac

brew install tio

Thanks to John Kennedy for confirming this

So how do I use it?

Screenshot-from-2020-01-06-20-20-30
Open a terminal and type tio to see all of the options available.

To connect to a device at /dev/ttyUSB0 with a baud rate of 115200 I type

tio /dev/ttyUSB0 -b 115200

How do I know which tty my USB device is communicating on?
In a terminal type the following command to list all the tty connections.

dmesg | grep tty

I saw [37363.824357] usb 1-1.4: cp210x converter now attached to ttyUSB0 and so I know that my device is at /dev/ttyUSB0

In-Use
In this short GIF demo I connect to my RC2014 Micro Z80 board and type some BASIC commands. Then I pull the USB lead out of the board, wait a few seconds and then put it back in to show the board reconnecting. Handy!

So are you going to use it?

Yup. I typically use screen but I am going to add tio to my workflow and see how it works for me. So far, it has been really useful!

Happy Hacking