How to Install Tio on Linux-Based Distributions

Tio Serial I/O (Input/Output) tools are used in today’s life for Cost-effectiveness, as serial communication requires fewer wires than parallel communication and Long-distance communication. Some common applications used for communication are dial-up modems, Configuration, and management of networking equipment, barcode scanners, LED (Light Emitting Diode), and LCD (Liquid Crystal Display) text displays.

Tio is a simple serial device I/O tool used on Linux for serial data communication. It comes with only a command-line configuration interface to connect to TTY devices to transfer data for Basic I/O purposes. It is highly designed for embedded developers and hackers.

By default, Tio automatically connects to the provided device if needed. If not, it will wait for the device to appear and then connect to the device. However, it also comes with the Timestamp additional to it, with various time formats which is used to display for how long the data transfer takes place. Let us see various features that come with Tio.

What features come with Tio?

Easy Connect: It gets easily connected with TTY device for data transfer and also tends to connect and disconnect automatically.

Special Default standards: Special support for non-standard baud rates and also mark and space parity and also supports RS-485 mode, which is basically an electrical characteristic of drivers and receivers for use in serial communication.

Defined Output: It shows the list of available serial devices by ID number with little information regarding particular devices and also supports to show Receiving /Transmitting statistics.

General features:

  1. Tio Toggle serial lines and also Pulse serial lines with configurable pulse duration.
  2. Tio supports Local Echo support and remapping of characters with line timestamps.
  3. Tio supports delayed output per character and line.
  4. It comes with hexadecimal mode when transferring data and also log to file with autogeneration of log filename.
  5. It comes with configuration file support, activating sub-configuration by name or pattern.
  6. It also redirects I/O to a UNIX socket or IPv4/v6 network socket for TTY-sharing devices to monitor output for the devices, and also pipes input and/or output.
  7. It supports simple line request/response handling.

Let us see the installation process of Tio.

How to Install Tio on Linux?

Before the Installation of Tio, let’s update and upgrade our repositories.

To update and upgrade repositories, type the following command:

sudo apt-get update
sudo apt-get upgrade
Updating And Upgrading Repo
Updating And Upgrading Repo

After the Updating and Upgrading Completes, you can now install Tio by typing the following command:

sudo apt-get install tio
Installation Of Tio
Installation Of Tio

You can also download it via the Brew installer. Type the following command in your terminal:

brew install tio

You can also install Tio via Snap. Type the following command in the terminal:

snap install tio --classic

Connecting with the device

It is recommended to connect to serial TTY devices by ID:

tio /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGQVXBL-if00-port0

Using serial devices by ID ensures that tio automatically reconnects to the correct serial device if it is disconnected and then reconnected.

List all available serial devices by ID:

$ tio --list-devices

If you want to log into a file with an autogenerated filename:

$ tio --log /dev/tty2

Now, send a command to the serial device and wait for the line response:

echo "*IDN?" | tio /dev/ttyACM0 --response-wait
KORAD KD3305P V4.2 SN:32475045

Redirect I/O to IPv4 network socket on port 4242:

tio --socket inet:4242 /dev/ttyUSB0

Inject data to the serial device:

$ cat data.bin | tio /dev/ttyUSB0

Common Keyboard Shortcuts

Various in-session key commands are supported. When it is started, press ctrl. To list the available key commands.

ctrl + ?List the available key commands
 
ctrl + bSend Breakdown
ctrl + cShow Configuration
ctrl + eToggle local echo mode
ctrl + fToggle log to file
ctrl + gToggle seril port line
ctrl + hToggle hexadecimal mode
ctrl + IClear Screen
ctrl + LShow line states
ctrl + pPulse serial port line
ctrl + qQuit
ctrl + sShow Statistics
ctrl + tToggle line timestamp mode
ctrl + uToggle conversion to uppercase
ctrl + vShow Version
ctrl + xSend file using the XMODEM protocol
ctrl + ySend file using the YMODEM protocol
ctrl Send ctrl character

Summary

Nevertheless, Tio only uses specific commands to monitor and transfer data serially that are highly designed for developers and hackers. Tio is an open-source platform, so anyone can contribute to this source via GitHub. It is an essential tool for embedded developers and if you are going to learn or are already working with embedded devices, then this CLI tool is a must-have application for you!

References

For more information, visit: https://github.com/tio/tio

To follow more tutorials, visit: https://www.linuxfordevices.com/tutorials