A lightweight, cross-platform desktop application that bridges serial barcode scanners to web applications via WebSocket.
- π₯οΈ Cross-platform: Works on macOS and Windows (Linux coming soon)
- π Plug & Play: Auto-detects serial barcode scanners
- π WebSocket Server: Exposes scanner data to web apps on
localhost:7001 - π‘ System Tray: Runs silently in the background
- π Device Pairing: Remembers your scanner and auto-connects on startup
- β‘ Lightweight: Single binary, no dependencies (~10MB)
- π Secure: Only accepts connections from localhost
- Download
care-scanner-bridge-macos.dmgfrom Releases - Open the DMG and drag "Care Scanner Bridge" to Applications
- First launch (Important - the app is not notarized):
-
Option A: Right-click on the app in Applications β Select "Open" β Click "Open" in the dialog
-
Option B: If you see "not responding" or it won't open, run this command in Terminal:
xattr -cr /Applications/Care\ Scanner\ Bridge.app && open /Applications/Care\ Scanner\ Bridge.app
-
Option C: Go to System Settings β Privacy & Security β Scroll down and click "Open Anyway"
-
- Download
care-scanner-bridge-setup.exefrom Releases - Run the installer (click "More info" β "Run anyway" if Windows SmartScreen appears)
- Launch from Start Menu or Desktop shortcut
π§ Coming Soon - Linux support is under development.
- Connect your barcode scanner via USB
- Launch Care Scanner Bridge - it will appear in your system tray
- Select the scanner port from the tray menu
- Your web application can now connect to
ws://localhost:7001/ws
const ws = new WebSocket('ws://localhost:7001/ws');
ws.onmessage = (event) => {
const message = JSON.parse(event.data);
switch (message.type) {
case 'scan':
console.log('Barcode scanned:', message.payload.barcode);
break;
case 'status':
console.log('Connected:', message.payload.connected);
break;
}
};| Type | Payload | Description |
|---|---|---|
scan |
{ barcode, port, timestamp } |
A barcode was scanned |
status |
{ connected, currentPort } |
Connection status update |
ports |
[{ path, description, isConnected }] |
List of available ports |
error |
{ message } |
Error occurred |
pong |
- | Response to ping |
| Type | Payload | Description |
|---|---|---|
connect |
{ port, baudRate? } |
Connect to a port |
disconnect |
- | Disconnect from current port |
list_ports |
- | Request list of available ports |
status |
- | Request current status |
ping |
- | Keep-alive ping |
curl http://localhost:7001/healthReturns:
{
"status": "ok",
"connected": true,
"port": "/dev/cu.usbserial-1234"
}Configuration is stored in:
- macOS/Linux:
~/.care_scanner_bridge/config.json - Windows:
%USERPROFILE%\.care_scanner_bridge\config.json
{
"port": 7001,
"baudRate": 9600,
"autoConnect": true,
"lastDevice": "/dev/cu.usbserial-1234",
"startMinimized": false
}- Go 1.21 or later
- For Linux:
libgtk-3-dev,libayatana-appindicator3-dev
# Clone the repository
git clone https://github.com/ohcnetwork/care_scanner_bridge.git
cd care_scanner_bridge
# Download dependencies
go mod download
# Build
go build -o care-scanner-bridge .
# Run
./care-scanner-bridge# For macOS (from Linux/Windows)
GOOS=darwin GOARCH=amd64 go build -o care-scanner-bridge-macos .
# For Windows (from Linux/macOS)
GOOS=windows GOARCH=amd64 go build -o care-scanner-bridge.exe .
# For Linux (from macOS/Windows)
GOOS=linux GOARCH=amd64 go build -o care-scanner-bridge-linux .- Ensure the scanner is in "USB Serial" mode (not HID/Keyboard mode)
- Check if the port appears in the system:
- macOS:
ls /dev/cu.* - Linux:
ls /dev/ttyUSB* /dev/ttyACM* - Windows: Device Manager β Ports (COM & LPT)
- macOS:
- Try unplugging and reconnecting the scanner
Add your user to the dialout group:
sudo usermod -a -G dialout $USER
# Log out and back inRight-click the app β Open, then click "Open" in the dialog.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details.