
Bears Machines
Run the Arduino USB balance edge service that publishes calibrated mass telemetry over NATS for gravimetric lab automation.
Overview
Bears-machines (balance-machine) is an agent skill for the Build phase that drives an Arduino USB mass balance on Linux and publishes calibrated readings to NATS.
Install
npx skills add https://github.com/pudap/bears-skills --skill bears-machinesWhat is this skill?
- Linear calibration from load-cell CSV raw ADC values to grams via balance_driver
- Edge service (`balance.py`) publishes telemetry to NATS with configurable MACHINE_ID and SERIAL_PORT
- Background reader thread with `get_mass()` for latest reading; automatic retry on fatal errors (5 s backoff)
- uv workspace workflow: `uv sync --all-packages` and `uv run --package balance-edge`
- Automatic fatal-error retry with 5 s backoff
- Typical serial baud rate 115200 noted in setup table
Adoption & trust: 1 installs on skills.sh; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You have a USB load-cell balance on Linux but no documented path from serial ADC data to grams and NATS telemetry for automated experiments.
Who is it for?
Solo builders running pudap bears-style lab automation with NATS and an Arduino balance on a known serial device.
Skip if: Pure software SaaS with no edge hardware, or teams not using NATS and Linux USB serial for measurement.
When should I use this skill?
Arduino-based USB mass balance driver for Linux; gravimetric feedback in liquid handling experiments; NATS telemetry from calibrated mass.
What do I get? / Deliverables
You configure edge `.env`, run the balance-edge service with uv, and expose continuous mass via NATS and `get_mass()` for downstream automation.
- Running balance-edge service publishing mass telemetry
- Calibration CSV–backed gram readings exposed via driver API
Recommended Skills
Journey fit
Hardware-serial and messaging integration is Build work before unattended operation in the lab or edge environment. Integrations fits USB serial drivers, NATS publish paths, and calibration glue between physical device and software stack.
How it compares
Device integration skill for gravimetric edge telemetry—not a general IoT platform or cloud observability package.
Common Questions / FAQ
Who is bears-machines for?
Indie hardware-lab developers integrating an Arduino balance into NATS-backed liquid-handling or measurement workflows on Linux.
When should I use bears-machines?
During Build integrations while bringing up serial calibration, the edge publisher, and NATS subjects before unattended experiment runs.
Is bears-machines safe to install?
It implies serial device access and network publish to NATS; review the Security Audits panel on this page and lock down `.env`, USB paths, and broker credentials on shared lab hosts.
SKILL.md
READMESKILL.md - Bears Machines
# Balance Machine Arduino-based USB mass balance connected via Linux USB serial (`/dev/ttyUSB0` or `/dev/ttyACM0`). ## What It Does - Reads raw ADC values from an Arduino over USB serial and converts them to grams using a linear calibration model fitted from a load-cell CSV. - Runs an edge service that connects to NATS and publishes calibrated mass readings as telemetry. - Background reader thread streams readings continuously; latest value is available at any time via `get_mass()`. --- ## Setup ### Prerequisites - Python 3.11+ and `uv` - Arduino balance connected at `/dev/ttyUSB3` or `/dev/ttyACM3` ### Environment ```bash cp edge/.env.example edge/.env ``` Edit `edge/.env`: | Variable | Description | |---|---| | `MACHINE_ID` | Unique ID for this balance instance | | `SERIAL_PORT` | e.g. `/dev/ttyUSB1` | | `BAUDRATE` | Must match Arduino sketch (typically `115200`) | | `NATS_SERVERS` | NATS server URL | ### Start Edge Service ```bash uv sync --all-packages uv run --package balance-edge python edge/balance.py ``` The service retries automatically on fatal errors (5 s backoff) and ignores `KeyboardInterrupt` to stay running in unattended environments. --- ## Calibration - Default calibration CSV: `driver/src/balance_driver/controller/100g load cell calibration.csv` - A custom CSV can be supplied via `Balance(calibration_csv="path/to/file.csv")` - Calibration uses a linear model: `mass_g = slope * raw_adc + intercept` --- ## Rules 1. Always call `startup()` before reading and `shutdown()` after — do not skip. 2. Always tare (`driver.tare(wait=2.0)`) immediately after every successful balance connection/startup. 3. Always check `fresh == True` before using `get_mass()` values; stale data (`age > 5 s`) indicates a disconnection. 4. Serial port is Linux-only (`/dev/ttyUSB*` or `/dev/ttyACM*`). Ask the user for the correct port — do not assume. 5. Ask user if unsure — **do not assume**. --- name: first-machine description: Generate commands for First machine liquid handling robots, including aspiration, dispensing, tip management, and deck configuration. --- # First Machine Skills Generate commands for First machine liquid handling robots. ## Purpose This skill enables generation of commands for First machine liquid handling robots. These commands automate liquid handling operations including aspiration, dispensing, tip management, and deck configuration. ## When to Use Load this skill when: - Users describe protocols that need to be executed on liquid handling robots - Converting manual lab protocols into automated puda protocols - Processing natural language instructions for liquid handling operations - Working with liquid handling workflows involving aspiration, dispensing, or tip management ## Required Resources **IMPORTANT**: Before generating any commands, **always consult these resources**: 1. **Consult CLI**: Run `puda machine commands first` to review available commands and parameters 2. **Labware Help**: See [labwares](labware.md) for available labware and details **Do not generate commands without first consulting these resources** to ensure accuracy and compatibility. ## Command Structure Each First machine command follows the standard protocol command structure (see protocol-generator reference). Key First-specific details: - `machine_id`: Must be `"first"` (string) ## Rules and Restrictions The following rules **must** be strictly followed when generating First machine commands: ### Handling Missing Information - If any information is missing from the user's request, **do not assume or guess values**. Use a placeholder value (e.g., `"PLACEHOLDER"` or `"?"`) in the command and explicitly ask the user to provide the missing information. - If the la