A minimal serial / UART command line terminal that focus on being easy to use.
Project description
sterm
sterm is a minimal serial terminal that focus on being easy to use and not sucking. - This client simply works. It has inline input and supports Unicode (utf-8). Each character typed gets directly send to the connected device without buffering. It writes whatever it receives to stdout so that also ANSI escape sequences work as expected.
Ideal for debugging:
With the --binary
option, the received data will be output byte wise as hexadecimal numbers.
Ideal for a remote Linux shell:
With the --noecho
option, each character typed gets directly send to the connected device without buffering and echoing.
This makes the Linux console usage seamlessly like using telnet or ssh.
Project State: Alive and maintained
Installation
There are two ways to install sterm.
Directly using pip
or from the cloned repository.
Using pip
pip install sterm
From Repository
# Download
git clone https://github.com/rstemmer/sterm.git
cd sterm
# Dependencies
pip install pyserial
# Install Package
pip install .
Usage
Command Line Arguments
sterm [-h] [--noecho] [--escape character] [--binary] [-b BAUDRATE] [-f FORMAT] [-w logfile] DEVICE
- -h: Print help.
- -n: Enable noecho mode. Default is echoing each entered key to stdout.
- --escape: Define an alternative escape character. Default is escape ("\e").
- --binary: Print hexadecimal values instead of Unicode characters. (Only applied on output, input will still be UTF-8)
- -b: Baudrate. Default: 115200 baud.
- -f: Configuration-triple: xyz with x = bytelength in bits {5,6,7,8}; y = parity {N,E,O}; z = stopbits {1,2}. Default: "8N1" - 8 data bits, no parity bits and 1 stop bit.
- -w: Write received data into a file.
DEVICE is the path to the serial terminal. For example /dev/ttyS0, /dev/ttyUSB0, /dev/ttyUART0, /dev/ttyACM0, /dev/pts/42.
For details read the man-page.
Internal commands
The following strings get not send to the device. Instead they are interpreted by sterm. They have a preceded escape character defined with --escape. Default is the escape key ("\e").
- exit: quit sterm
- version: print version
Examples
Send ping to UART0 and exit:
sterm /dev/ttyUART0
ping
pong
^[exit
Send hello to a serial device with 9600 baud, 7 data bits, even parity, and 2 stop bits. Then exit:
sterm -b 9600 -f 7E2 /dev/ttyS0
hello
world
^[exit
Connecting to a Linux device
sterm --noecho --escape _ /dev/ttyUSB0
~# whoami
root
~# _exit
Communicating with two sterm instances via a pseudo terminal for testing:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.