tio v3.1 has been released - see
https://github.com/tio/tio/releases for release notes.
It's been a while sine my last tio release announcement in this forum but a lot has happened to tio since then. Over the years tio has evolved from a very simple serial device tool into a really great command line serial device tool for embedded developers and hackers to connect to their embedded targets.
The recently released v3.x series offers scripting support and new ways to manage serial devices.
For example, to connect to the first new appearing serial device simply do:
$ tio --auto-connect new
Or to connect to the latest registered serial device:
$ tio --auto-connect latest
These auto connect strategies come handy when plugging/unplugging your embedded targets via USB serial ports.
To list available serial devices do:
$ tio --list
Device TID Uptime (s) Driver Description
----------------- ---- ------------- ---------------- --------------------------
/dev/ttyS4 BaaB 19526.576 port 16550A UART
/dev/ttyS5 eV0Z 19525.845 port 16550A UART
/dev/ttyUSB1 bCC2 1023.274 ftdi_sio TTL232R-3V3
/dev/ttyUSB0 SPpw 978.527 ftdi_sio TTL232RG-VREG3V3
/dev/ttyACM0 i5q4 2.079 cdc_acm ST-Link VCP Ctrl
By-id
--------------------------------------------------------------------------------
/dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTCHUV56-if00-port0
/dev/serial/by-id/usb-FTDI_TTL232RG-VREG3V3_FT1NELUB-if00-port0
/dev/serial/by-id/usb-STMicroelectronics_STLINK-V3_004900343438510234313939-if02
By-path
--------------------------------------------------------------------------------
/dev/serial/by-path/pci-0000:00:14.0-usb-0:8.1.3.1.4:1.0-port0
/dev/serial/by-path/pci-0000:00:14.0-usbv2-0:8.1.3.1.4:1.0-port0
/dev/serial/by-path/pci-0000:00:14.0-usbv2-0:6.4:1.0-port0
/dev/serial/by-path/pci-0000:00:14.0-usb-0:6.4:1.0-port0
/dev/serial/by-path/pci-0000:00:14.0-usbv2-0:6.3:1.2
/dev/serial/by-path/pci-0000:00:14.0-usb-0:6.3:1.2
Configuration profiles (/home/lundmar/.config/tio/config)
--------------------------------------------------------------------------------
rpi3 stm32 esp32 am64-evm
imx8mp-evk nucleo-h743zi2 usb-devices
With tio you can define your own configuration profiles in the configuration file. Your typical configuration file may look like this:
[default]
baudrate = 115200
databits = 8
parity = none
stopbits = 1
color = 10
[rpi3]
device = /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGQVXBL-if00-port0
no-reconnect = true
log = true
log-file = rpi3.log
color = 11
[svf2]
device = /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTCHUV56-if00-port0
baudrate = 9600
script = expect("login: "); send("root\n"); expect("Password: "); send("root\n")
color = 12
[esp32]
device = /dev/serial/by-id/usb-0403_6014-if00-port0
script = set{DTR=high,RTS=low}; msleep(100); set{DTR=low,RTS=high}; msleep(100); set{RTS=low}
script-run = once
color = 13
[usb-devices]
pattern = ^usb([0-9]*)
device = /dev/ttyUSB%m1
color = 14
To connect to one of the profiles simply do e.g.:
$ tio esp32
To connect to profile via its pattern do e.g.:
$ tio usb12
Which will match and connect to /dev/ttyUSB12.
Now it is also possible to set independent input and output modes. For example:
$ tio /dev/ttyUSB0 --output-mode hex16
[19:09:48.061] tio v3.1
[19:09:48.061] Press ctrl-t q to quit
[19:09:48.062] Connected to /dev/serial/by-id/usb-STMicroelectronics_STLINK-V3_004900343438510234313939-if02
2a 2a 2a 20 42 6f 6f 74 69 6e 67 20 5a 65 70 68
79 72 20 4f 53 20 62 75 69 6c 64 20 7a 65 70 68
79 72 2d 76 33 2e 34 2e 30 2d 33 39 31 35 2d 67
37 63 33 63 35 33 66 36 66 63 31 30 20 2a 2a 2a
0d 0a 6c 78 69 2d 67 70 69 62 20 64 72 69 76 65
72 20 74 65 73 74 20 76 30 2e 31 0d 0a
[19:09:53.382] Disconnected
Or you can output in hex mode with timeout based timestamps:
$ tio /dev/ttyUSB0 --output-mode hex --timestamp --timestamp-timeout 200
[19:11:06.133] tio v3.1
[19:11:06.133] Press ctrl-t q to quit
[19:11:06.133] Connected to /dev/serial/by-id/usb-STMicroelectronics_STLINK-V3_004900343438510234313939-if02
[19:11:11.033] 2a 2a 2a 20 42 6f 6f 74 69 6e 67 20
[19:11:13.633] 20 4f 53 20 62 75 69 6c
[19:11:14.104] 2a 2a 2a 20 42 6f 6f 74 69 6e 67 20 5a 65 70 68 79 72 20 4f 53 20 62 75 69
[19:11:21.263] 49 76 65 72 20 74 65 73 74 20 76 30 2e 31 0d 0a 2a 2a 2a 20 42 6f 6f 74 69 6e 67 20
[19:11:23.199] 65 73 74 20 76 30 2e 31 0d 0a
This way received data will get a new timestamp if no data has been received for 200 ms. This is very useful when debugging and inspecting e.g. protocol data from a device.
Give tio v3.1 a try - it may help make it easier to manage connections to your embedded devices.
See
https://github.com/tio/tio for more details.