tio(1)

NAME
tio - a simple serial terminal I/O tool

SYNOPSIS

tio [<options>] <tty-device|config>

DESCRIPTION

tio is a simple serial terminal tool which features a straightforward command-line interface to easily connect to serial TTY devices for basic I/O operations.

OPTIONS

-b, --baudrate <bps>
    Set baud rate [bps] (default: 115200).

-d, --databits 5|6|7|8
    Set data bits (default: 8).

-f, --flow hard|soft|none
    Set flow control (default: none).

-s, --stopbits 1|2
    Set stop bits (default: 1).

-p, --parity odd|even|none
    Set parity (default: none).

-o, --output-delay <ms>
    Set output delay [ms] inserted between each sent character (default: 0).

-n, --no-autoconnect
    Disable automatic connect. By default tio automatically connects to the provided device if present. If the device is not present, it will wait for it to appear and then connect. If the connection is lost (eg. device disconnects), it will wait for the device to reappear and then reconnect. However, if the --no-autoconnect option is provided, tio will exit if the device is not present or an established connection is lost.

-e, --local-echo
    Enable local echo.

-t, --timestamp
    Enable line timestamp.

--timestamp-format <format>
    Set timestamp format to any of the following timestamp formats:

    24hour
    24-hour format ("hh:mm:ss.sss")

    24hour-start
        24-hour format relative to start time

    iso8601
        ISO8601 format ("YYYY-MM-DDThh:mm:ss.sss")

    Default format is 24hour

-L, --list-devices
    List available serial devices.

-l, --log
    Enable log to file. If no filename is provided the filename will be automatically generated.

--log-filename <filename>
    Set log filename.

-m, --map <flags>
    Map (replace, translate) special characters on input or output. The following mapping flags are supported:

    ICRNL
    Map CR to NL on input (unless IGNCR is set).

    IGNCR
        Ignore CR on input.

    INLCR
        Map NL to CR on input.

    INLCRNL
        Map NL to CR-NL on input.

    OCRNL
        Map CR to NL on output.

    ODELBS
        Map DEL to BS on output.

    ONLCRNL
        Map NL to CR-NL on output.

    If defining more than one flag, the flags must be comma separated.

-x, --hex
    Enable hexadecimal mode.

-c, --color <code>
    Colorize tio text using ANSI color code ranging from 0 to 255. If color code is negative a list of available ANSI colors will be printed.

-S, --socket <socket>
    Listen on socket. Any input from clients connected to the socket is sent on the serial port as if entered at the terminal where tio is running (except that ctrl-t sequences are not recognized), and any input from the serial port is multiplexed to the terminal and all connected clients. Sockets remain open while the serial port is disconnected, and writes will block. Two socket types are supported using different prefixes in the socket field: unix:<filename> - Unix Domain Socket (file) inet:<IP>:<port> - Internet Socket (network) (NOT YET SUPPORTED) At present there is a hardcoded limit of 16 clients connected at one time.

-v, --version
    Display program version.

-h, --help
    Display help.

KEYS

In session, the following key sequences are intercepted as tio commands:

ctrl-t ?
    List available key commands

ctrl-t b
    Send serial break (triggers SysRq on Linux, etc.)

ctrl-t c
    Show configuration (baudrate, databits, etc.)

ctrl-t e
    Toggle local echo mode

ctrl-t h
    Toggle hexadecimal mode

ctrl-t l
    Clear screen

ctrl-t q
    Quit

ctrl-t s
    Show TX/RX statistics

ctrl-t t
    Send ctrl-t key code

ctrl-t L
    Show line states (DTR, RTS, CTS, DSR, DCD, RI)

ctrl-t d
    Toggle DTR

ctrl-t r
    Toggle RTS

ctrl-t v
    Show version

HEXADECIMAL MODE

In hexadecimal mode each incoming byte is printed out as a hexadecimal value.

Bytes can be sent in this mode by typing the two-character hexadecimal representation of the value, e.g.: to send 0xA you must type 0a or 0A.

CONFIGURATION

Options can be set via a configuration file using the INI format. tio uses the configuration file first found in the following locations in the order listed: $XDG_CONFIG_HOME/tio/tiorc, $HOME/.config/tio/tiorc, $HOME/.tiorc

Config sections can be used to group settings.

tio will try to match the user input to a config section by name or by pattern to get the tty and other options.

Options without any config section name sets the default options.

The following configuration file options are available:

pattern
pattern matching user input. This pattern can be an extended regular expression with a single group.

tty tty device to open. If tty contains a "%s" it will be substituted with the first group match.

baudrate
    Set baud rate

databits
    Set data bits

flow
    Set flow control

stopbits
    Set stop bits

parity
    Set parity

output-delay
    Set output delay

no-autoconnect
    Disable automatic connect

log Enable log to file

log-filename
    Set log filename

local-echo
    Enable local echo

timestamp
    Enable line timestamp

timestamp-format
    Set timestamp format

map Map special characters on input or output

color
    Colorize tio text using ANSI color code ranging from 0 to 255.

socket
    Set socket path (must include unix:).

CONFIGURATION EXAMPLES

A typical config section used as a short-hand would be defined as such:
    [ftdi]
    baudrate=115200
    tty=/dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGQVXBL-if00-port0
    color=11

With this config section defined in the configuration file the following commands would be equivalent:
    tio ftdi tio -b 115200 /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGQVXBL-if00-port0

A config section can also be matched by its pattern which supports regular expressions:
    [usb device]
    pattern=usb([0-9]*)
    baudrate=115200
    tty=/dev/ttyUSB%s

Making the following commands equivalent:
    tio usb12 tio -b 115200 /dev/ttyUSB12

EXAMPLES

Typical use is without options. For example:
    tio /dev/ttyUSB0

Which corresponds to the commonly used options:
    tio -b 115200 -d 8 -f none -s 1 -p none /dev/ttyUSB0

It is recommended to connect serial tty devices by ID. For example:
    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 the device is disconnected and then reconnected.

WEBSITE

Visit https://tio.github.io

AUTHOR

Created by Martin Lund <martin.lund@keep-it-simple.com>.