General > General Technical Chat
tio - A simple serial device I/O tool for linux
eti:
How does this differ from "screen" or "minicom"? Unless there's a significant benefit, why is there a need for it?
lundmar:
--- Quote from: eti on October 16, 2022, 10:43:33 pm ---How does this differ from "screen" or "minicom"? Unless there's a significant benefit, why is there a need for it?
--- End quote ---
Well, if you take a quick look at the feature list here https://github.com/tio/tio you will see a lot of features that neither screen nor minicom have.
That being said, screen is not a serial tool but a screen manager so you will end up short quickly if you are looking for serial related features and most annoyingly screen does not handle disconnecting serial ports. On the other end of the spectrum, minicom has a lot of classic serial/modem features but it offers it all via a somewhat cumbersome interface which will require you to do work to connect to even the simplest of serial ports (disable modem init, not easy to set flow control, gui menu navigation, etc.). Additionally, minicom uses the text graphical ncurses library which causes problems when you use it within screen managers such as screen or tmux. Compared, tio offers a more straightforward interface for both command-line and configuration file and it does not conflict with neither screen nor tmux because it does not use ncurses.
Also, Minicom haven't been maintained for 10 years now and it shows. As GlowInTheDark said in the Raspberry Pi forum:
--- Quote ---"But the overriding point is that, as I've said many times in the past - whenever the name "minicom" is mentioned - I've never met a program that tried so hard to (and succeeded so well at) being hard to use."
--- End quote ---
He is right. With tio it will just work:
--- Code: ---tio /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A6009HU3-if00-port0
--- End code ---
With minicom:
--- Code: ---minicom -o -D /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A6009HU3-if00-port0
--- End code ---
After that you have to navigate deep into the minicom graphical menu to disable hardware flow control so that input will work with the rpi3 device. Hardware flow control can not be disabled via the command line. It is also silly you have to confirm to exit etc. In short, minicom requires too many key strokes to do anything. These are details that amount to the bad user experience that the forum user stressed.
Sometimes it is the little details that matter, especially if you use tools like these on the daily. You should give tio a try - the difference will be obvious.
lundmar:
tio v2.2 released - a quick follow up release that adds support for shell auto-completion of sub-configuration names. A useful feature requested by a user.
https://github.com/tio/tio/releases/tag/v2.2
lundmar:
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.
Navigation
[0] Message Index
[*] Previous page
Go to full version