This commit is contained in:
xenia 2021-05-12 15:42:27 -04:00
parent e007f7b986
commit 4eecac0c56
2 changed files with 76 additions and 1 deletions

74
README.md Normal file
View File

@ -0,0 +1,74 @@
# megacom
because minicom sucks
## installation
it's a standard setuptools project, clone this repo, then do
```
pip3 install --user .
```
or for development
```
pip3 install --user -e .
```
## usage
```
usage: megacom [-h] [-b BAUD] [-m MODE] [tty]
Alternative console-based UART client
positional arguments:
tty Path to UART device [/dev/ttyUSB0]
optional arguments:
-h, --help show this help message and exit
-b BAUD, --baud BAUD UART baud rate [115200]
-m MODE, --mode MODE UART mode string [8N1]
```
### sudo
to avoid using sudo, add yourself to the `uucp` group (on arch) or `dialout` group (ubuntu/debian),
and make sure you don't have ModemManager installed
if you have ModemManager installed it's likely you will need to use sudo. if you absolutely _need_
ModemManager on your system, try stopping it with `sudo systemctl stop ModemManager`, then
unplugging and replugging UART devices. once you're done using megacom, you can restart ModemManager
with `sudo systemctl start ModemManager`, if it was previously running
### keyboard shortcuts
CTRL-A is the escape character. CTRL-A + Q quits megacom. CTRL-A + CTRL-A sends a literal CTRL-A
there will be more keyboard shortcuts later, hopefully
### baud
any standard baud rate (as an integer) which is supported by pyserial can be used. usually you want
the default (115200)
### mode strings
composed of bytesize, parity, and stopbits. usually you want the default (8N1)
the following options are supported
- bytesize: 8, 5, 6
- parity: N (none), E (even), O (odd), M (mark), S (space)
- stopbits: 1, 1.5, 2
examples:
```
8N1
5E2
6S1.5
```
### windows
untested. it might work tho. don't expect windows to be actively supported because serial on windows
is extremely annoying. just use WSL

View File

@ -126,7 +126,8 @@ async def megacom(tty: str, baud: int, mode: str) -> None:
def main() -> None: def main() -> None:
parser = argparse.ArgumentParser(description="Alternative console-based UART client") parser = argparse.ArgumentParser(prog="megacom",
description="Alternative console-based UART client")
parser.add_argument("tty", type=str, default="/dev/ttyUSB0", nargs="?", parser.add_argument("tty", type=str, default="/dev/ttyUSB0", nargs="?",
help="Path to UART device [/dev/ttyUSB0]") help="Path to UART device [/dev/ttyUSB0]")
parser.add_argument("-b", "--baud", type=int, default=115200, help="UART baud rate [115200]") parser.add_argument("-b", "--baud", type=int, default=115200, help="UART baud rate [115200]")