https://github.com/kkinos/easerial
A simple command line application for serial communication.
https://github.com/kkinos/easerial
cli go golang serial-communication
Last synced: over 1 year ago
JSON representation
A simple command line application for serial communication.
- Host: GitHub
- URL: https://github.com/kkinos/easerial
- Owner: kkinos
- License: mit
- Created: 2023-02-19T15:55:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-07T10:27:19.000Z (about 3 years ago)
- Last Synced: 2025-02-10T12:43:32.770Z (over 1 year ago)
- Topics: cli, go, golang, serial-communication
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# easerial
[](https://github.com/kinpoko/easerial/actions/workflows/go.yml)

A simple command line application for serial communication.
## Description
`easerial` is a simple command line application for sending data through a serial port. It provides two subcommands, `easerial string` and `easerial file`, which allow you to send hex data from a string or from a text file.
## Install
```bash
go install github.com/kinpoko/easerial@latest
```
## Usage
### `easerial string`
```bash
easerial string [--port ] [--baud ] [--data-bits ] [--read-bytes ] [--read-timeout-sec ]
```
- ``: Required. The string to send as hex data.
- `--port`: Optional. The serial port to use. Defaults to /dev/ttyUSB1.
- `--baud`: Optional. The baud rate to use. Defaults to 9600.
- `--data-bits`: Optional. The number of data bits to send. Defaults to 8.
- `--read-bytes`: Optional. The number of reading bytes after sending. Defaults to 4.
- `--read-timeout-sec`: Optional. The number of seconds of timeout for reading serial port after sending. Defaults to 1.
Example:
```bash
easerial string 68656c6c6f20776f726c64 --baud 115200 --port /dev/ttyUSB0
```
### `easerial file`
```bash
easerial file [--port ] [--baud ] [--data-bits ] [--read-bytes ][--read-timeout-sec ]
```
- ``: Required. The path to the file send as a hex data.
- `--port`: Optional. The serial port to use. Defaults to /dev/ttyUSB1.
- `--baud`: Optional. The baud rate to use. Defaults to 9600.
- `--data-bits`: Optional. The number of data bits to send. Defaults to 8.
- `--read-bytes`: Optional. The number of reading bytes after sending. Defaults to 4.
- `--read-timeout-sec`: Optional. The number of seconds of timeout for reading serial port after sending. Defaults to 1.
Example:
```bash
easerial file helloworld.txt --baud 115200 --port /dev/ttyUSB0
```
`helloworld.txt`
```text
68
65
6c
6c
6f
20
77
6f
72
6c
64
```
or
```text
68,65,6c,6c,6f,20,77,6f,72,6c,64
```