Author Topic: tio - A simple serial device I/O tool for linux  (Read 17809 times)

0 Members and 1 Guest are viewing this topic.

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
tio - A simple serial device I/O tool for linux
« on: September 26, 2017, 05:46:58 pm »
Hi guys,

If you are using Linux and you are looking for a nice clean cut serial device tool to connect to your embedded target then you should give tio a try: http://tio.github.io



"tio" is a simple serial device I/O tool which features a straightforward command-line and configuration file interface to easily connect to TTY devices for basic input/output.

Consider it a simpler alternative to minicom/picocom/screen etc. with less focus on classic terminal/modem features and more focus on the needs of embedded developers and hackers.
« Last Edit: July 19, 2022, 06:35:15 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 
The following users thanked this post: lem_ix, HoracioDos

Offline hermit

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
Re: tio - A simple TTY terminal I/O application for linux
« Reply #1 on: September 27, 2017, 06:29:58 pm »
The older I get the more loath I am to start adding packages that aren't in the official repos.  Things get very ugly very fast sometimes.
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #2 on: September 27, 2017, 07:36:43 pm »
The older I get the more loath I am to start adding packages that aren't in the official repos.  Things get very ugly very fast sometimes.

FYI - tio is included in the official Debian repos so if you are using Ubuntu/Debian you are in luck as you don't need to break your old habits.
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline hermit

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
Re: tio - A simple TTY terminal I/O application for linux
« Reply #3 on: September 28, 2017, 02:40:29 am »
I was posting a little more for 'bumps sake' to be honest.  ;) 
 

Offline Wirehead

  • Regular Contributor
  • *
  • Posts: 177
  • Country: be
    • Wirehead.be
Re: tio - A simple TTY terminal I/O application for linux
« Reply #4 on: September 28, 2017, 05:34:41 am »
try to get it in https://brew.sh/ as well.. Would be great on OSX as well, instead of the bloated old minicom.. :)
"to remain static is to lose ground"
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #5 on: September 28, 2017, 07:11:18 am »
try to get it in https://brew.sh/ as well.. Would be great on OSX as well, instead of the bloated old minicom.. :)

Well, I don't use mac but I'm looking for package maintainer volunteers so .... ;)
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #6 on: September 28, 2017, 08:55:25 am »
I was posting a little more for 'bumps sake' to be honest.  ;)

There is nothing wrong in doing that ;)
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #7 on: September 28, 2017, 11:04:20 am »
Why would I want to type
Code: [Select]
tio /dev/ttyUSB0 --baudrate 115200

when I could type
Code: [Select]
screen /dev/ttyUSB0 115200

?

Actually, you could just type
Code: [Select]
tio -b 115200 /dev/ttyUSB0

And in case of 115200 8n1, even shorter
Code: [Select]
tio /dev/ttyUSB0

Also, for users that use tmux it seems silly to start screen under a tmux session to access serial. Consider tmux + tio a more modern alternative to screen.

I'm saying this as long time screen user myself.
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline HoracioDos

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: ar
  • Just an IT monkey with a DSO
Re: tio - A simple TTY terminal I/O application for linux
« Reply #8 on: September 28, 2017, 12:18:14 pm »
"tio" is a simple TTY terminal application which features a straightforward commandline interface to easily connect to TTY devices for basic input/output.

Consider it a simpler alternative to minicom/picocom/screen etc..
Hi
I had to compile it because it's not available for 16.04 LTS (Xenial Xerus). Size is very small (70.5 Kb). I love simple and tiny software. I'll try to test it today. How does it compare to screen command or why did you write it?
Thanks!
« Last Edit: September 28, 2017, 12:28:09 pm by HoracioDos »
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #9 on: September 28, 2017, 01:10:04 pm »
"tio" is a simple TTY terminal application which features a straightforward commandline interface to easily connect to TTY devices for basic input/output.

Consider it a simpler alternative to minicom/picocom/screen etc..
Hi
I had to compile it because it's not available for 16.04 LTS (Xenial Xerus). Size is very small (70.5 Kb). I love simple and tiny software. I'll try to test it today. How does it compare to screen command or why did you write it?
Thanks!

Actually, if you strip the binary its only about 23 kb ;)

I'm sorry but binary packages for tio is only supported for recent/new Ubuntu/Debian distributions. Luckily it's easy to install manually, like you did, in case you need it.

I'm a professional embedded developer and I use serial on linux almost on a daily basis to connect to various embedded boards and I've found myself wanting something more straightforward and simpler than existing tools like minicom, picocom, cutecom, putty, etc.. These tools all work fine but all suffer from somewhat cumbersome interfaces or includes features that i have never had a need for. So I decided to create tio as a small and simpler alternative that would fit my work flow better. I used to use screen for everything but now that I've switched permanently to using tmux I find it silly to use screen in tmux sessions just to do serial stuff. Also, tio includes various useful key commands and features such as an autoconnect mechanism that is very useful when you disconnect and connect your usb-serial cables.

« Last Edit: September 28, 2017, 01:13:40 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline HoracioDos

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: ar
  • Just an IT monkey with a DSO
Re: tio - A simple TTY terminal I/O application for linux
« Reply #10 on: September 28, 2017, 01:43:52 pm »
Actually, if you strip the binary its only about 23 kb ;)
Yeap! Only 23.4 Kb  :-+
I'm sorry but binary packages for tio is only supported for recent/new Ubuntu/Debian distributions. Luckily it's easy to install manually, like you did, in case you need it.
It's not an issue. It's a good opportunity to learn how build .deb files. Always wanted to create a PPA to backport software like yours to LTS release.
Also, tio includes various useful key commands and features such as an autoconnect mechanism that is very useful when you disconnect and connect your usb-serial cables.
That's a good feature!
« Last Edit: September 28, 2017, 02:04:26 pm by HoracioDos »
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: tio - A simple TTY terminal I/O application for linux
« Reply #11 on: September 28, 2017, 01:52:51 pm »
For windows guys, I highly recommend this amazing tool

https://mobaxterm.mobatek.net/
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #12 on: September 28, 2017, 02:15:25 pm »
It's not an issue. It's a good opportunity to learn how build .deb files. Always wanted to create a PPA to backport software like yours to LTS release.

If you do end up successfully creating a PPA for older distribution releases let me know. I'll be happy to put a reference to it on http://tio.github.io
« Last Edit: September 28, 2017, 02:35:52 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline hermit

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
Re: tio - A simple TTY terminal I/O application for linux
« Reply #13 on: September 28, 2017, 04:13:45 pm »
I was posting a little more for 'bumps sake' to be honest.  ;)

There is nothing wrong in doing that ;)
Especially when it works.  ;D
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #14 on: September 28, 2017, 04:32:01 pm »
Some kind folks from Debian pushed me some typo fixes so I just pushed a new release of tio.

Who knew hexadecimal is not spelled hexidecimal   |O

Sometimes my danish ancestry makes me spell wrong in subtle ways ha ha
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline hermit

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
Re: tio - A simple TTY terminal I/O application for linux
« Reply #15 on: September 30, 2017, 02:31:59 am »
Blame the spell checker.  :phew:
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #16 on: September 30, 2017, 07:43:12 pm »
FYI - I've just pushed a new release with some minor documentation updates here: http://tio.github.io
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: tio - A simple TTY terminal I/O application for linux
« Reply #17 on: September 30, 2017, 08:46:06 pm »
Nice birthday gift for me :) I have been looking for a sane terminal emulator for MCU work for a while now.

I have been mostly using minicom, but the BBS/modem features get in the way. Screen is not bad - except when the device loses connection and/or you need to quit it. I don't like having to use various Vulcan nerve pinch combos to get out of programs.

There are a few more programs I have tried (cutecom, gtkterm, ssterm ...) but each has some warts that were driving me nuts.

EDIT Bug in your build script:

If I set prefix with configure --prefix=/opt/tio-1.23, make install has no business trying to write to /usr, that's a no-no:


make[2]: Entering directory '/home/janoc/Downloads/tio-1.23/src'
 /bin/mkdir -p '/opt/tio-1.23/bin'
  /bin/install -c tio '/opt/tio-1.23/bin'
 /bin/mkdir -p '/usr/share/bash-completion/completions'
 /bin/install -c -m 644 bash-completion/tio '/usr/share/bash-completion/completions'
/bin/install: cannot create regular file '/usr/share/bash-completion/completions/tio': Permission denied
Makefile:408: recipe for target 'install-bashcompletionDATA' failed


That will also prevent getting the software properly packaged for many distros - building packages often redirects the install into a different directory.
« Last Edit: September 30, 2017, 08:56:30 pm by janoc »
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #18 on: September 30, 2017, 09:12:58 pm »
Nice birthday gift for me :) I have been looking for a sane terminal emulator for MCU work for a while now.

I have been mostly using minicom, but the BBS/modem features get in the way. Screen is not bad - except when the device loses connection and/or you need to quit it. I don't like having to use various Vulcan nerve pinch combos to get out of programs.

There are a few more programs I have tried (cutecom, gtkterm, ssterm ...) but each has some warts that were driving me nuts.

You pretty much sum up the very reasons why I created tio. I have had the same experience with various tty programs. In the end I ended up using screen but even that has its annoying quirks as you point out and it was driving me crazy so I decided to create tio - a simple no nonsense tty application that doesn't get in the way.

I hope you will find tio useful as I do.

EDIT Bug in your build script:

If I set prefix with configure --prefix=/opt/tio-1.23, make install has no business trying to write to /usr, that's a no-no:


make[2]: Entering directory '/home/janoc/Downloads/tio-1.23/src'
 /bin/mkdir -p '/opt/tio-1.23/bin'
  /bin/install -c tio '/opt/tio-1.23/bin'
 /bin/mkdir -p '/usr/share/bash-completion/completions'
 /bin/install -c -m 644 bash-completion/tio '/usr/share/bash-completion/completions'
/bin/install: cannot create regular file '/usr/share/bash-completion/completions/tio': Permission denied
Makefile:408: recipe for target 'install-bashcompletionDATA' failed


That will also prevent getting the software properly packaged for many distros - building packages often redirects the install into a different directory.

Thanks - I actually forgot about this issue but I will fix it in the next release. For now, to bypass it, you can use the '--with-bash-completion-dir=' configure option.
« Last Edit: September 30, 2017, 09:15:52 pm by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline mib

  • Contributor
  • Posts: 14
Re: tio - A simple TTY terminal I/O application for linux
« Reply #19 on: September 30, 2017, 09:38:44 pm »
It's quite surprising how trivial a serial terminal program is if you remove all the extraneous stuff like modem support that no one uses anymore. I may actually switch to this from cu and screen if I can ever train my fingers to type a different command.

A few suggestions:

If you get a failure opening the tty do some simple checks and give a more useful error message. Check for idiots logged in as root, and give a suitable error - root isn't allowed to open serial ports by default for obvious (although now largely historical) reasons.
Also check if the user is a member of the correct group to access the tty and provide a helpful message if not. You should really read the group for the tty file etc, etc. Those are two serial port access error I get asked about frequently.

Make ctrl-t ctrl-t send a ctrl-t. That's a little easier to type reliably than taking a finger of ctrl.

Linux does have an interface for selecting arbitrary baud rates in addition to the standard ones. It is very occasionally useful to be able to use them.

Oh, and why the call the system("clear"); rather than just doing it inline? And the 'weird shit' with the status variable in the function? Other than that, nice clean code.
 

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #20 on: October 01, 2017, 09:03:55 am »
It's quite surprising how trivial a serial terminal program is if you remove all the extraneous stuff like modem support that no one uses anymore. I may actually switch to this from cu and screen if I can ever train my fingers to type a different command

I know the feeling - sometimes it can take a long time time to un-train those finger moves that we get so used to ;)

A few suggestions:

If you get a failure opening the tty do some simple checks and give a more useful error message. Check for idiots logged in as root, and give a suitable error - root isn't allowed to open serial ports by default for obvious (although now largely historical) reasons.
Also check if the user is a member of the correct group to access the tty and provide a helpful message if not. You should really read the group for the tty file etc, etc. Those are two serial port access error I get asked about frequently.

I think at best I can add a warning when you run as root because I really don't want to dictate policy. If you want to run as root I won't prevent you. We also have to keep in mind that tio is actually being used on embedded devices with very simple filesystems where root is still the normal user state. Regarding tty groups, I don't want to walk down the road of maintaining checks for specific groups since those can vary across distributions and over time.

Make ctrl-t ctrl-t send a ctrl-t. That's a little easier to type reliably than taking a finger of ctrl.

I know what you are saying but in this case I really prefer to keep the same type of key code sequence for all key commands to keep it consequential, simple and clean. Besides, the need for sending the raw ctrl-t key code is such a rare event that the vast majority of user fingers out there will never be affected by this non-standard Vulcan death grip ;)

Linux does have an interface for selecting arbitrary baud rates in addition to the standard ones. It is very occasionally useful to be able to use them.

Actually I did implement part of that feature but I didn't have a serial device that supported arbitrary baud rates so I couldn't test it. Either way, only a very few Linux serial device drivers support arbitrary baud rates so I ended up deciding against it and stick with what can be done through the standard c library API just to keep the code simple across all platforms (tio is also used on non-linux platforms). However, I might revisit that decision in the future if there becomes a big enough demand for it.

Oh, and why the call the system("clear"); rather than just doing it inline?

Admittedly, it was a lazy quick way of doing it because I didn't find the correct ANSI/VT100 code for it at the time. Fixed in https://github.com/tio/tio/commit/07255c94b94f2b9e40766757450f5b73745a9086

And the 'weird shit' with the status variable in the function? Other than that, nice clean code.

Thanks.

Actually the 'status' thing is not weird :) Think about it. A function returns a value that represents its status code. Hence I prefer 'status' over any of the less meaningful shorthand abbreviations 'r', 'ret', 'retval' etc.. Anyway, by the end of the day it's just a matter of coding style - generally I prefer not keeping everything super abbreviated just to save  a few characters and in the process muddle the expressed semantics :)
« Last Edit: October 01, 2017, 09:09:04 am by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26892
  • Country: nl
    • NCT Developments
Re: tio - A simple TTY terminal I/O application for linux
« Reply #21 on: October 01, 2017, 10:23:52 am »
What I'm missing on Linux is Hyperterminal. What I want is a terminal program which allows to open/close/changing the serial port using a button/menu instead of shutting the entire program down/restarting it. tio seems more like Putty (which I hate because you have to shut it down to change anything). With the serial port closed you should be able to scroll back and forth through the history. Hyperterminal does all that so I'm still using it through a VM because there simply isn't a Linux alternative.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: tooki

Offline lundmarTopic starter

  • Frequent Contributor
  • **
  • Posts: 436
  • Country: dk
Re: tio - A simple TTY terminal I/O application for linux
« Reply #22 on: October 01, 2017, 10:52:36 am »
What I'm missing on Linux is Hyperterminal. What I want is a terminal program which allows to open/close/changing the serial port using a button/menu instead of shutting the entire program down/restarting it. tio seems more like Putty (which I hate because you have to shut it down to change anything). With the serial port closed you should be able to scroll back and forth through the history. Hyperterminal does all that so I'm still using it through a VM because there simply isn't a Linux alternative.

Tio is a different beast, it's made for those commandline driven Linux hackers. What you are looking for is a GUI application and for that I can recommend to you: cutecom.
« Last Edit: October 01, 2017, 11:00:02 am by lundmar »
https://lxi-tools.github.io - Open source LXI tools
https://tio.github.io - A simple serial device I/O tool
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: tio - A simple TTY terminal I/O application for linux
« Reply #23 on: October 01, 2017, 12:51:30 pm »
What I'm missing on Linux is Hyperterminal. What I want is a terminal program which allows to open/close/changing the serial port using a button/menu instead of shutting the entire program down/restarting it. tio seems more like Putty (which I hate because you have to shut it down to change anything). With the serial port closed you should be able to scroll back and forth through the history. Hyperterminal does all that so I'm still using it through a VM because there simply isn't a Linux alternative.

Tio is a different beast, it's made for those commandline driven Linux hackers. What you are looking for is a GUI application and for that I can recommend to you: cutecom.

Or GTKTerm or the venerable minicom.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26892
  • Country: nl
    • NCT Developments
Re: tio - A simple TTY terminal I/O application for linux
« Reply #24 on: October 01, 2017, 01:08:54 pm »
What I'm missing on Linux is Hyperterminal. What I want is a terminal program which allows to open/close/changing the serial port using a button/menu instead of shutting the entire program down/restarting it. tio seems more like Putty (which I hate because you have to shut it down to change anything). With the serial port closed you should be able to scroll back and forth through the history. Hyperterminal does all that so I'm still using it through a VM because there simply isn't a Linux alternative.
Tio is a different beast, it's made for those commandline driven Linux hackers. What you are looking for is a GUI application and for that I can recommend to you: cutecom.
I've tried all (including cutecom) but none are as good and complete as Hyperterminal even when taking into account how prone Hyperterminal is to crashing.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf