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:
- Tio Toggle serial lines and also Pulse serial lines with configurable pulse duration.
- Tio supports Local Echo support and remapping of characters with line timestamps.
- Tio supports delayed output per character and line.
- It comes with hexadecimal mode when transferring data and also log to file with autogeneration of log filename.
- It comes with configuration file support, activating sub-configuration by name or pattern.
- 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.
- 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
After the Updating and Upgrading Completes, you can now install Tio by typing the following command:
sudo apt-get install 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 + b | Send Breakdown |
ctrl + c | Show Configuration |
ctrl + e | Toggle local echo mode |
ctrl + f | Toggle log to file |
ctrl + g | Toggle seril port line |
ctrl + h | Toggle hexadecimal mode |
ctrl + I | Clear Screen |
ctrl + L | Show line states |
ctrl + p | Pulse serial port line |
ctrl + q | Quit |
ctrl + s | Show Statistics |
ctrl + t | Toggle line timestamp mode |
ctrl + u | Toggle conversion to uppercase |
ctrl + v | Show Version |
ctrl + x | Send file using the XMODEM protocol |
ctrl + y | Send 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