A cross-platform Go application that monitors serial ports for URLs and automatically opens them in the default browser. Perfect for QR code scanners, barcode readers, or any device that outputs URLs via serial communication.
- π Monitors all available serial ports automatically
- π Detects URLs in serial data using regex pattern matching
- π Opens URLs in the default browser across Windows, macOS, and Linux
- π Runs as a background service/daemon on startup
- β‘ Zero-configuration installation with one-line installers
- π¦ Self-contained executable with no external dependencies
iwr -useb https://raw.githubusercontent.com/crbnos/serial/main/scripts/install-windows.ps1 | iex
curl -fsSL https://raw.githubusercontent.com/crbnos/serial/main/scripts/install-mac.sh | bash
curl -fsSL https://raw.githubusercontent.com/crbnos/serial/main/scripts/install-linux.sh | sudo bash
The one-liner installation scripts automatically:
- Install Go Runtime - Downloads and installs the latest Go runtime if not already present
- Download Executable - Fetches the latest pre-built binary for your platform and architecture
- Setup Auto-Start - Configures the scanner to run automatically on system startup:
- Windows: Creates a Windows Scheduled Task
- macOS: Creates a LaunchAgent
- Linux: Creates a systemd service
- Start Service - Immediately starts the scanner in the background
The scanner continuously:
- Detects all available serial ports on the system
- Monitors each port for incoming data (9600 baud, 8N1 by default)
- Scans received text for URL patterns (
http://localhost
orcarbon.ms
) - Validates found URLs and opens them in the default browser
- Logs all activity for debugging purposes
- Windows (x64, ARM64)
- macOS (Intel, Apple Silicon)
- Linux (x64, ARM64)
The scanner uses these default serial settings:
- Baud Rate: 9600
- Data Bits: 8
- Stop Bits: 1
- Parity: None
These settings work with most QR code scanners and barcode readers. If you need different settings, you can modify the source code and rebuild.
Windows:
Get-Content "$env:ProgramData\SerialURLScanner\scanner.log" -Tail 50 -Wait
macOS:
tail -f ~/.serial-scanner/scanner.log
Linux:
sudo journalctl -u serial-scanner -f
Windows:
# Check status
Get-ScheduledTask -TaskName "SerialURLScanner"
# Stop/Start
Stop-ScheduledTask -TaskName "SerialURLScanner"
Start-ScheduledTask -TaskName "SerialURLScanner"
macOS:
# Check status
launchctl list | grep serialscanner
# Stop/Start
launchctl stop com.barbinbrad.serialscanner
launchctl start com.barbinbrad.serialscanner
Linux:
# Check status
sudo systemctl status serial-scanner
# Stop/Start/Restart
sudo systemctl stop serial-scanner
sudo systemctl start serial-scanner
sudo systemctl restart serial-scanner
If you prefer to build from source:
git clone https://github.com/crbnos/serial.git
cd serial-url-scanner
go build -o serial-scanner main.go
Windows:
Unregister-ScheduledTask -TaskName "SerialURLScanner" -Confirm:$false
Remove-Item -Recurse -Force "$env:ProgramData\SerialURLScanner"
macOS:
launchctl unload ~/Library/LaunchAgents/com.barbinbrad.serialscanner.plist
rm ~/Library/LaunchAgents/com.barbinbrad.serialscanner.plist
rm -rf ~/.serial-scanner
Linux:
sudo systemctl stop serial-scanner
sudo systemctl disable serial-scanner
sudo rm /etc/systemd/system/serial-scanner.service
sudo rm -rf /opt/serial-scanner
sudo systemctl daemon-reload
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.