[Toybox] [PATCH] Add "microcom" to pending.

Rob Landley rob at landley.net
Sat Jan 14 14:50:42 PST 2017


On 01/14/2017 03:19 PM, enh wrote:
> Our device bringup folks wanted a simple serial console, both on the
> host and on the device. This is certainly enough to replace what I've
> been using personally on the host.

I've used "netcat -f /dev/ttyS0" but you need stty to set it up and it's
not properly handling ctrl-C and its guts need to be moved out to
lib/net.c and...

Sigh. I need time to work through my todo list.

> I'd never heard of "microcom" until I asked the internets what busybox
> users use, so I don't care what we call this or what the options are
> called. (But would like to decide before it gets ossified in a million
> factory test scripts and the like!)

The name microcom is fine. (It's a pun on "minicom" which is a common
external version.) I was meaning to add that as an alias to netcat -f
once I got that properly cleaned up and stty implemented.

(Honestly the hard part of microcom, netcat, stty, tcpserv, and so on is
making them all share infrastructure sanely. They all want _slightly_
different semntics...)

> The tool that this replaces for me defaulted to /dev/ttyUSB0, but since
> I don't know whether that default would be useful for most other people
> too, I left that out. Command-line history will solve my transition
> problem.

Indeed.

I'll merge this but I'll also try to get it cleaned up and promoted on
the flight to linuxconf.au so you're not using _another_ command out of
pending.

Thanks,

Rob

P.S. Hmmm... in lib/ my set_terminal() isn't setting speed, my
tty_sigreset() is only resetting stdin not a second fd, and my
pollinate() uses "shutdown()" so if you go:

  echo GET / | netcat old-http-1.0-server 80

You get output. But in _this_ case, stdin closing probably means you
want the program to exit because serial console doesn't do the
unidirectional close thing so you can't tell when/if the other end hung
up... Slightly Different Semantics. ALMOST the same enough to share
code. Hmmm...


More information about the Toybox mailing list