SerialLink

command module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

README ΒΆ

Go Version License PRs Welcome

A cross-platform serial port management service with gRPC API

SerialLink runs as a background service, managing serial port connections on Windows, Linux, and Raspberry Pi. It exposes a high-performance gRPC API so any languageβ€”Python, C#, Node.js, Goβ€”can talk to your hardware over the network.

Your App (any language)  ──gRPC──▢  SerialLink  ──USB/UART──▢  Hardware

Problem SerialLink Solution
Port locked to one process πŸ”’ Session locks + clean handoffs
Different APIs per language/platform ⚑ One gRPC API, works everywhere
No remote access to serial devices 🌐 Network-accessible serial ports
Complex port configuration πŸ› οΈ Simple CLI + YAML config

πŸš€ Quick Start

# Install
go install github.com/Shoaibashk/SerialLink@latest

# Scan for ports
seriallink scan

# Start the server
seriallink serve

# In another terminal: open a port
seriallink open COM1 --baud 115200

That's it. Your serial port is now accessible via gRPC at localhost:50051.


πŸ“¦ Installation

go install github.com/Shoaibashk/SerialLink@latest
Build from Source
git clone https://github.com/Shoaibashk/SerialLink.git
cd SerialLink && make build
Download Binary

Releases


πŸ› οΈ CLI Reference

Command Description
seriallink serve Start the gRPC server
seriallink scan List available serial ports
seriallink open <port> Open a port with config
seriallink close <port> Close and release a port
seriallink read <port> Read data from port
seriallink write <port> <data> Write data to port
seriallink config <port> View/modify port settings
seriallink status <port> Get port statistics
seriallink info Service information
seriallink version Version info
Common Examples
# Start server with custom address
seriallink serve --address 0.0.0.0:50052

# Scan with JSON output (great for scripts)
seriallink scan --json

# Open with full config
seriallink open /dev/ttyUSB0 --baud 115200 --data-bits 8 --parity none

# Read with timeout
seriallink read COM1 --timeout 5000 --format hex

# Write hex data
seriallink write COM1 --hex "48454C4C4F"

πŸ’‘ Tip: Set SERIALLINK_ADDRESS env var to skip --address on every command.


🌐 gRPC API

Connect from any language:

# Python
import grpc
channel = grpc.insecure_channel('localhost:50051')
stub = SerialServiceStub(channel)
ports = stub.ListPorts(ListPortsRequest())
// Node.js
const client = new SerialService('localhost:50051', grpc.credentials.createInsecure());
client.ListPorts({}, (err, response) => console.log(response.ports));
// C#
var channel = GrpcChannel.ForAddress("http://localhost:50051");
var client = new SerialService.SerialServiceClient(channel);
var ports = await client.ListPortsAsync(new ListPortsRequest());

Key Methods:

  • ListPorts
  • OpenPort
  • ClosePort
  • Read
  • Write
  • StreamRead
  • BiDirectionalStream

πŸ“– Full API docs: docs/API.md


βš™οΈ Configuration

# ~/.seriallink/config.yaml
server:
  grpc_address: "0.0.0.0:50051"

serial:
  defaults:
    baud_rate: 9600
    data_bits: 8
    parity: "none"

logging:
  level: "info"    # debug | info | warn | error

Config locations: ~/.seriallink/config.yaml β†’ ./config.yaml β†’ /etc/seriallink/config.yaml


πŸ“š Documentation

Doc Description
API Reference gRPC methods, client examples, error codes
Deployment Guide systemd, Windows service, Docker, TLS
Development Guide Building, architecture, contributing

🀝 Contributing

We welcome contributions! Here's how to get started:

# Clone and build
git clone https://github.com/Shoaibashk/SerialLink.git
cd SerialLink
make build

# Run checks before submitting
make ci

Ways to contribute:

  • πŸ› Report bugs via Issues
  • πŸ’‘ Suggest features
  • πŸ“– Improve documentation
  • πŸ”§ Submit pull requests

See docs/DEVELOPMENT.md for detailed setup.


πŸ“„ License

Apache License 2.0 β€” use it freely in personal and commercial projects.


Made with ❀️ by Shoaibashk for hardware hackers, IoT builders, and serial port wranglers.

⭐ Star us on GitHub

Documentation ΒΆ

Overview ΒΆ

SerialLink is a cross-platform serial port background service that provides a gRPC API for managing serial port connections.

Directories ΒΆ

Path Synopsis
api
Package api provides the gRPC server implementation for SerialLink agent.
Package api provides the gRPC server implementation for SerialLink agent.
Package cmd provides the CLI commands for SerialLink using Cobra.
Package cmd provides the CLI commands for SerialLink using Cobra.
Package config provides configuration loading and management for SerialLink agent.
Package config provides configuration loading and management for SerialLink agent.
internal
serial
Package serial provides serial port management and communication functionality for SerialLink.
Package serial provides serial port management and communication functionality for SerialLink.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL