Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serialkit

A cross-platform Arduino serial monitor with optional HTTP forwarding. Works on macOS and Windows (and Linux). One pip install, zero other dependencies.

Full API reference, architecture and internals: docs/DOCUMENTATION.md

Features

  • Auto-detects the Arduino port across macOS (/dev/cu.usbmodem*), Windows (COM*), and Linux (/dev/ttyACM*, /dev/ttyUSB*)
  • Connects and streams lines to the console, just like the Arduino IDE serial monitor
  • Optionally POSTs each line as JSON to any HTTP/HTTPS endpoint (webhook, REST API, etc.)
  • Auto-reconnects on cable wobble or Arduino reset — no restart needed
  • Forwarding is non-blocking: a slow network never stalls the serial read loop
  • Coloured output on any terminal that supports ANSI codes (including Windows Terminal)

Install

pip install pyserial
pip install .        # from the repo root

Usage

# Auto-detect the Arduino, connect at 9600 baud
serialkit

# List all serial ports
serialkit --list

# Explicit port
serialkit --port /dev/cu.usbmodem14201        # macOS
serialkit --port COM3                          # Windows

# Different baud rate
serialkit --port COM3 --baud 115200

# Forward each line to a webhook as JSON
serialkit --forward https://api.example.com/serial-data

# All options
serialkit --help

Forwarded JSON format

Each line is POSTed with Content-Type: application/json:

{
  "line": "sensor=42",
  "port": "/dev/cu.usbmodem14201",
  "ts":   "2026-07-05T10:22:01.334512+00:00"
}

Library API

from serialkit import scan_ports, Monitor
from serialkit.forwarder import Forwarder

# Scan
ports = scan_ports()
for p in ports:
    print(p)   # /dev/cu.usbmodem14201 [Arduino?] — Arduino Uno [USB VID:PID=2341:0001]

# Monitor without forwarding
with Monitor(port="/dev/cu.usbmodem14201", baud=9600) as mon:
    for line in mon:
        print(line)

# Monitor with forwarding
fwd = Forwarder(url="https://api.example.com/data", port="/dev/cu.usbmodem14201")
with Monitor(port="/dev/cu.usbmodem14201", forwarder=fwd) as mon:
    for line in mon:
        print(line)

Run tests

python3 -m unittest tests.test_serialkit -v

All 32 tests run in under 1 second with no hardware or network required.

License

MIT

About

A cross-platform Arduino serial monitor with optional HTTP forwarding. Works on macOS and Windows (and hopefully Linux). One `pip install`, zero other dependencies.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages