tio

A serial device I/O tool

OTHER License

Downloads
11
Stars
1.8K
Committers
50
tio - tio v1.40

Published by lundmar over 2 years ago

Changes since tio v1.39:

  • Add config support for log-strip

  • Add config support for hex-mode

  • Rename --hex to --hex-mode

  • Fix completion for -e, --local-echo

  • Ignore newlines in hex output

  • Fix newline in warning_printf()

  • Fix ansi_printf_raw() in no color mode

  • Enter non-interactive mode when piping to tio

    Add support for a non interactive mode which allows other application to
    pipe data to tio which then forwards the data to the connected serial
    device.

    Non ineractive means that tio does not react to interactive key commands
    in the incoming stream. This allows users to pipe binary data directly
    to the connected serial device.

    Example use:

    $ cat commands.txt | tio /dev/ttyUSB0

  • Also strip backspace from log

    To make log strip feature consistent so that we remove all unprintable
    control characters and escape sequences.

  • Socket code cleanup

  • Cleanup man page

  • Rename --log-filename to --log-file

Yin Fengwei:

  • Allow strip escape sequence characters from log file

    The log without escape key stripped is like:

    ^M[12:47:17] ACRN:>
    ^M[12:47:17] ACRN:>lasdfjklsdjf
    ^M
    ^M[12:47:18] Error: Invalid command.
    ^M[12:47:19] ACRN:>
    ^M[12:47:26] ACRN:>
    ^M[12:47:26] ACRN:>sdafkljsdkaljfklsadjflksdjafjsda^H ^H^H...
    ^M
    ^M[12:47:31] Error: Invalid command.

    After strip escape key, the log is like:

    [12:49:18] ACRN:>
    [12:49:19] ACRN:>
    [12:49:19] ACRN:>ls

    [12:49:19] Error: Invalid command.
    [12:49:19] ACRN:>
    [12:49:19] ACRN:>dfaslhj

    [12:49:24] Error: Invalid command.

    Beside escape key, it also handle backspace key as well.

tio - tio v1.39

Published by lundmar over 2 years ago

Changes since tio v1.38:

  • Improve key command response for local echo and timestamp

  • Fix invalid hex character error message

  • Make sure only matched config section is parsed

  • Add support for "disable" keyword in config file

  • Unify error message formating

  • Cleanup list devices code

  • Fix command-line tty-device|config parsing

    Allow user to add options on both sides of the provided config argument.

    For example:

    $ tio -b 9600 am64-evm -e

    Before, tio only allowed adding arguments after the config argument.

    Implemented as simple as possible by introducing two stage option parsing.

  • Update bash completion

  • Add support for IPv4 and IPv6 network sockets

    Add support for IPv4 and IPv6 network sockets via socket syntax
    "inet:" and "inet6:" respectively.

    For example, to listen and redirect serial device I/O to a host bound
    IPv4 socket simply do:

    $ tio /dev/ttyUSB0 --socket inet:4444

    To connect do e.g.:

    $ nc 127.0.0.1 4444

    Likewise, for IPv6 do:

    $ tio /dev/ttyUSB0 --socket inet6:4444

    To connect do e.g.:

    $ nc ::1 4444

    If port is 0 or no port is provided default port 3333 is used.

  • Fix tio deleting unix socket file

    If tio has a unix file socket open, a second tio instance of tio may
    delete the socket file. This change fixes so that it will not be deleted
    and tio will instead error and complain about conflicting socket file.

  • Rework color option

    Rework the color option to support setting ANSI color code values
    ranging from 0..255 or "none" for no color or "list" to print a list of
    available ANSI colors codes.

    Also, disables color when piping.

  • Remove print of hex mode status at startup

  • Remove newline option in hex mode

  • Fix configfile memory leaks

  • Remove command-line option inconsistencies

    Optional arguments, as parsed by the getopt_long mechanism, are
    inherently inconsistent with how you define required arguments.

    To avoid confusion we decide to avoid this inconsistency by replacing
    optional options with additional options with required argmuments.

  • Replace '1' with 'enable' in config files

  • Convert errors to warnings

g0mb4:

  • Extended hexadecimal mode.

    While in hex mode (ctrl-t h) you can output hexadecimal values.
    E.g.: to send 0x0A you have to type 0A (always 2 characters).

    Added option -x, --hex to start in hexadecimal mode.

    Added option --newline-in-hex to interpret newline characters in hex mode.
    This is disabled by default, because, in my opinion, hex stream is
    fundamentally different from text, so a "new line" is meaningless in this
    context.

tio - tio v1.38

Published by lundmar over 2 years ago

Changes since tio v1.37:

  • Redirect error messages to stderr

  • Improve help and man page

  • Mention config file in --help

  • Fix running without config file

  • Fix config file error messages

  • Redirect error messages to stderr

  • Add repology packaging status

  • Fix parsing of default settings

    Default configuration file settings were not parsed in case a section
    was matched. Now we make sure that the default (unnamed) settings are
    always parsed.

  • Append to existing log file (no truncation)

  • Add socket info to show configuration

  • Print socket info at startup

  • Fix socket option parsing

Peter Collingbourne:

  • Match user input against config section names if pattern matching was unsuccessful.

    This allows for better config file ergonomics if the user has a diverse
    set of serial devices as the name does not need to be specified in
    the config file twice.

  • Add support for external control via a Unix domain socket.

    This feature allows an external program to inject output into and
    listen to input from a serial port via a Unix domain socket (path
    specified via the -S/--socket command line flag, or the socket
    config file option) while tio is running. This is useful for ad-hoc
    scripting of serial port interactions while still permitting manual
    control. Since many serial devices (at least on Linux) get confused
    when opened by multiple processes, and most commands do not know
    how to correctly open a serial device, this allows a more convenient
    usage model than directly writing to the device node from an external
    program.

    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.

    Example usage 1 (issue a command):

    echo command | nc -UN /path/to/socket > /dev/null

    Example usage 2 (use the expect command to script an interaction):

    #!/usr/bin/expect -f

    set timeout -1
    log_user 0

    spawn nc -UN /path/to/socket
    set uart $spawn_id

    send -i $uart "command1\n"
    expect -i $uart "prompt> "
    send -i $uart "command2\n"
    expect -i $uart "prompt> "

lexaone:

  • fix for using option 'log' without 'log-filename' in config file
tio - tio v1.37

Published by lundmar over 2 years ago

Changes since tio v1.36:

  • Make libinih a fallback dependency

    This means that in case meson does not find libinih it will
    automatically clone libinih and include it in the build.

    The libinih library is reconfigured to be statically built so that no
    shared object will be installed.

Sylvain LAFRASSE:

  • Fix timestamp parsing in INI conf

  • Factorize timestamp parsing to be coherent with command line format in configuration file.

tio - tio v1.36

Published by lundmar over 2 years ago

Changes since tio v1.35:

  • Add support for defaults in config file

    If no section name is specified the configuration will be considered the
    default one.

    This allows to set e.g. a default color code for sections which do not
    configure a color code.

  • Handle SIGHUP

    Handle SIGHUP so that the registered exit handlers are called to restore
    the terminal back to its orignal state.

  • Add color configuration support

  • Bypass unused result warnings

  • Force dependency on libinih

    Configuration file support is considered a mandatory feature.

  • Update headers

  • Update AUTHORS

  • Update man page

  • Move string_to_long() to misc.c

  • Update CircleCI config

  • Update tio gif

  • Update README

  • Update LICENSE date

  • Remove redundant COPYING file

Liam Beguin:

  • Document configuration file options

  • Add support for a configuration file

  • misc: add _unused macro

    Some parameters are expected to be unused.
    Add a basic macro to mute these compiler warnings.

  • options: expose string_to_long()

    Expose string_to_long() so that other source files can use it.

tio - tio v1.35

Published by lundmar over 2 years ago

Changes since tio v1.34:

  • Add support for automatically generated log filename

    Automatically generate log filename if none is provided.

    The auto generated file name is on the form:
    "tio_DEVICE_YYYY-MM-DDTHH:MM:SS.log"

  • Add support for configurable timestamp format

    Also changes default timestamp format from ISO8601 to classic 24-hour
    format as this is assumed to be the format that most users would prefer.

    And reintroduces strict but optional ISO8601 format.

    This feature allows to easily add more timestamp formats in the future.

  • Reintroduce asm-generic/ioctls.h

    It is needed for ppc builds.

  • Add macro hack to workaround older buggy glibc

Robey Pointer:

  • Add support for high bps on OS X
tio - tio v1.34

Published by lundmar over 2 years ago

Changes since tio v1.33:

  • Fix setspeed2 compilation

  • Only apply color formatting when using color option

    To help the color blind who may use custom terminal foreground /
    background colors.

  • Update README

  • Add '-c, --color' option

    Allow user to select which ANSI color code to use to colorize the tio
    text. To successfully set the color the color code must be in the range
    0..255.

    If color code is negative tio will print all available ANSI colors.

    The default color is changed to bold white to make tio defaults usable
    for most users, including color blind users.

  • Fix setspeed2 check

  • Fix meson header check string

  • Reintroduce long timestamp format

    But make the timestamp format RFC3339 compliant instead. The RFC states:

    NOTE: ISO 8601 defines date and time separated by "T".
    Applications using this syntax may choose, for the sake of
    readability, to specify a full-date and full-time separated by
    (say) a space character.

    This way we keep the information specified by ISO 8601 but make it more
    human readable which is better for the console output.

  • Update version year

Sylvain LAFRASSE:

  • Fix TTY device listing on Darwin. (#136)

  • Fix TCGETS2 search on Darwin.

tio - tio v1.33

Published by lundmar over 2 years ago

Changes since tio v1.32:

  • Show auto connect status in show configuration

  • Use '#pragma once' in all headers

  • Improve printed output

    Get rid of inconsistencies in the printed output (error printing,
    colors, etc.).

    Prepare for user configurable color.

  • Rename option -i to -L

  • Shorten timestamp description

  • Shorten timestamp

    We do not need the date part of the timestamp. It simply takes up too
    much precious line space. In case of logging to file, one can easily
    conclude the date from the file date information.

  • Replace Travis with circleCI

  • Replace autotools with meson

    To introduce much simpler build configuration which is also easier to
    maintain.

  • Add list serial devices feature

    For convenience, add a --list-devices option which lists the available
    serial devices.

  • Cleanup: Use dot notation for default options struct

  • Update AUTHORS

  • Add command to show version

    The key sequence ctrl-t v will now show the version of tio.

  • Align format of timestamps

  • Add Sylvain as official co-maintainer

Sylvain LAFRASSE:

  • Add '-t' option description for time stamping.

  • Add description for time stamping.

  • Resolved tio/tio#84: Added timestamps in log file if enabled.

attila-v:

  • Refine timestamps with milliseconds and ISO-8601 format (#129).

    • Show milliseconds too in the timestamp (#114) and log file (#124)
    • Change timestamp format to ISO-8601.

Yin Fengwei:

  • Output newline on stdout with hex print mode

    This is to fix the issue #104. The timestamp will always be
    printed at the beginning of line:

    [10:25:56] Switched to hexadecimal mode
    0d 0a 0d [10:25:57] 41 43 52 4e 3a 5c 3e 0d 0a 0d [10:25:58] 41

    is changed to:

    [12:34:56] 45 72 72 6f 72 3a 20 49 6e 76 61 6c 69 64 20
    [12:34:56] 41 43 52 4e 3a 5c 3e
    [12:34:56] 41 43 52 4e 3a 5c 3e
    [12:34:57] 41 43 52 4e 3a 5c 3e 6c 73

Jakob Haufe:

  • Make comparison POSIX compliant

    String comparison with == is not POSIX compliant and can fail with e.g.
    dash.

Henrik Brix Andersen:

  • Add bash completion of tty devices.

  • Add -t/--timestamp to bash completion script.

Henner Zeller:

  • Local echo: show character by character even if stdout buffered.

Björn Stenberg:

  • Show error when failing to open a tty

Alban Bedel:

  • Fix out of tree builds

    Out of tree builds are currently broken because $(top_srcdir)src/include
    is not in the search path. In tree builds are working because autconf add
    $(top_builddir)/src/include to the search path for the generated config.h.
    As $(top_builddir) and $(top_srcdir) are identical during in tree builds
    the search path still end up beeing somehow correct.

    To fix this add -I$(srcdir)/include to the CPPFLAGS in Makefile.am.

Fabrice Fontaine:

  • src/setspeed2.c: fix redefinition of termio

    Include ioctls.h and termbits.h from asm-generic instead of asm to avoid
    build failures.

Erik Moqvist

  • Exit if output speed cannot be set.

Lars Kellogg-Stedman:

  • fflush() after putchar() for print_hex and print_normal

    In order for local echo to work properly, we have to either call
    fflush(stdout) after every character or just disable line buffering.
    This change calls fflush() after putchar().

  • Disable line buffering in stdout

    In order for local echo to work properly, we have to either call
    fflush(stdout) after every character or just disable line buffering.
    This change uses setbuf(stdout, NULL) to do the latter.

George Stark:

  • dont show line state if ioctl failed

  • add serial lines manual control

arichi:

  • Flush every local echo char

    Flush stdout at every char in case it
    happens to be buffered.

Mariusz Midor:

  • Newline: handle booth NL and CR

    Flag ONLCRNL expects code \n after press Enter, but on some systems \r is send instead.

tio - tio v1.32

Published by lundmar almost 6 years ago

Changes since tio v1.31:

  • Update AUTHORS

  • Minor code style cleanups

  • Cleanup print macros

  • Flush output

    Make sure output is transmitted immediately by flushing the output.

Robey Pointer:

  • add optional timestamps

    with "-t" or "C-t T", toggle a timestamp prefix to each line.

Jakub Wilk:

  • Fix typos

Sylvain Lafrasse:

  • Added macOS compatibility

  • Made O_NONBLOCK flag to open() call specific to macOS only.

  • Added macOS-related details.

  • Added O_NONBLOCK flag to open() call for macOS (10.13.6) compatibility.

tio - tio v1.31

Published by lundmar over 6 years ago

Changes since tio v1.30:

  • Update date

  • Update AUTHORS

Henner Zeller:

  • Clarify the input/output variable names (No-op change)

  • Organize options the same sequence they are mentiond in cmdline help.

  • Update README.

  • Map CR->NL locally on output instead of using tio.c_oflag |= OCRNL.

    This mostly is intended to have local echo output exactly what is sent
    to the remote endpoint.
    A nice side-effect is, that it also fixes tty-implementations, that can't
    deal with the OCRNL flag on tio.c_oflag.

  • Provide local-echo option.

    Can be switched on with -e on the command line.
    Can be toggled with Ctrl t e while program is running.

  • Write to logfile as soon as we have the data, don't buffer.

    Logfiles are important to see what happend, in particular if something
    unexpected happened; so we want to make sure that the logfile is flushed
    to disk.

    Before this change, the logfile was typically written at the end in
    a large chunk as the default (large) buffering applied. Now, characters are
    written out ASAP, so it is possible to get a live-view with a
    tail -f <logfile>

tio - tio v1.30

Published by lundmar over 6 years ago

Changes since tio v1.29:

  • Update README

  • Update man page and bash completion

  • Update AUTHORS

qianfan Zhao:

  • ONLCRNL: change the method to map NL to CR-NL
tio - tio v1.29

Published by lundmar over 6 years ago

Changes since tio v1.28:

  • Add mapping flags INLCRNL and ODELBS

    The following new mapping flags are added:

    INLCRNL: Map NL to CR-NL on input.
    ODELBS: Map DEL to BS on output.

    Flags requested and tested by Jan Ciger (janoc).

tio - tio v1.28

Published by lundmar almost 7 years ago

Changes since tio v1.27:

  • Update README

  • Update AUTHORS

  • Add snap status to README.md

  • Add README.md to prettify GitHub page

  • Add missing header

Petr Vaněk:

  • Add missing header file under musl-libc

    Musl's inclusion tree slightly differs from glibc, therefore TCGETS2 is
    not reachable through sys/ioctl.h, so asm/ioctls.h needs to be included
    too.

Jakub Wilk:

  • Fix grammar and typos
tio - tio v1.27

Published by lundmar almost 7 years ago

Changes since tio v1.26:

  • Update man page

  • Add support for setting non-standard baudrates

    Support for non-standard baudrate settings will be automatically enabled
    if the termios2 interface is detected available. However, to play it
    safe, the old and widely supported termios interface will still be used
    when setting standard baudrates.

  • Cleanup

  • Update AUTHORS

tio - tio v1.26

Published by lundmar almost 7 years ago

Changes since tio v1.25:

  • Reconfigure stdin

    Make stdin behave more raw'ish. In particular, don't
    translate CR -> NL on input.

  • Add special character map feature

    Add a --map option which allows to map special characters, in particular CR and
    NL characters which are used in various combinations on varios platforms.

  • Cleanup

  • Update AUTHORS

  • Update README

  • Mention website

  • Update man page

tio - tio v1.25

Published by lundmar about 7 years ago

Changes since tio v1.24:

  • Fix error applying new stdout settings

    On Fedora 26 tio will quit with the following error message:

    "Error: Could not apply new stdout settings (Invalid argument)"

    In case of Fedora, it turns out that the new stdout settings used are a
    bit too agressive because an empty termios structure is used. To remedy
    this we reuse the existing stdout settings and only reconfigure the
    specific options we need to make a "raw" stdout configuration.

  • Remove unused pkgconfig in configure

  • Code cleanup

    Remove unused variable.

tio - tio v1.24

Published by lundmar about 7 years ago

Changes since tio v1.23:

  • Optimize clear screen command

    Replaced system call with inline ANSI/VT100 clear screen code sequence

  • Fix bash completion installation

    Fixed the configure script to avoid that the bash completion script gets
    installed outside of the prefix location. The default install location
    is now $prefix/share/bash-completion/completions.

    Use the configure option '--with-bash-completion-dir=PATH' if you need
    to install the bash completion script elsewhere.

Jakub Wilk:

  • Add missing commas in conditional sentences
tio - tio v1.23

Published by lundmar about 7 years ago

Changes since tio v1.22:

  • Update copyright headers

Jakub Wilk:

  • Fix typos
tio - tio v1.22

Published by lundmar about 7 years ago

  • Update README and man page

  • Code cleanup

  • Update man page date

  • Update copyright year

tio - tio v1.21

Published by lundmar about 7 years ago

Changes since tio v1.20:

  • Add support for hexidecimal mode

    A new key command 'ctrl-t h' is introduced which toggles between
    hexidecial mode and normal mode. When in hexidecimal mode data received
    will be printed in hexidecimal.

  • Do not distribute src/bash_completion/tio

    Since the bash completion tio script is now autogenerated from tio.in it
    should not be distributed in the tarball.

  • Add missing forward flag

  • Update AUTHORS file

Adam Borowski:

  • 'ctrl-t b' to send serial break.

Jakub Wilk:

  • Removed git commit references from ChangeLog

    ChangeLog is primary useful for users who don't have the git repository
    at hand.

    Replace git commit references with version numbers; or if the change
    only cleans up another change with no release in between, remove the
    changelog item completely.