Skip to main content

A command-line tool for uploading and running code on CircuitPython devices

Project description

circremote

A command-line tool for remotely executing CircuitPython code on devices over serial or Web Workflow connections.

It can run the commands included with it, your own commands from anywhere in the filesystem, and commands that it loads over HTTP/HTTPS. It can easily execute example programs from Github.

Features

  • Cross-platform support: Works on Windows, macOS, and Linux
  • Multiple connection types: Serial ports and CircuitPython Web Workflow
  • Built-in commands: 100+ sensor and utility commands included
  • Remote commands: Execute commands from URLs and GitHub repositories
  • Dependency management: Automatic installation of CircuitPython libraries via circup
  • Configuration: Device aliases and search paths for easy management
  • Quiet mode: Suppress output for scripting and automation

Installation

pip install circremote

Quick Start

Serial Connection (macOS/Linux)

# List files on device
circremote /dev/ttyUSB0 ls /

# Run a sensor command
circremote /dev/ttyUSB0 BME280

Serial Connection (Windows)

# List files on device
circremote COM3 ls /

# Run a sensor command
circremote COM3 BME280

Web Workflow Connection

# Connect to device over network
circremote 192.168.1.100 BME280

# With password
circremote -p mypassword 192.168.1.100 BME280

Remote Commands

# Run command from GitHub
circremote /dev/ttyUSB0 https://github.com/user/repo/tree/main/commands/BME280

# Run Python file from web
circremote /dev/ttyUSB0 https://example.com/my_sensor.py

Configuration

Create ~/.circremote/config.json (cross-platform):

{
  "devices": [
    {
      "name": "my-device",
      "device": "/dev/ttyUSB0",
      "friendly_name": "My CircuitPython Board",
      "defaults": {
        "sda": "board.IO1",
        "scl": "board.IO2",
        "address": "0x76"
      }
    }
  ],
  "command_aliases": [
    {
      "name": "temp",
      "command": "BME280"
    }
  ],
  "search_paths": [
    "/path/to/my/commands"
  ],
  "circup": "/usr/local/bin/circup",
  "variable_defaults": {
    "sda": "board.SDA",
    "scl": "board.SCL",
    "address": "0x76"
  }
}

Device Defaults

You can set default values for command variables on a per-device basis using the defaults field in your device configuration. This is especially useful for I2C pin assignments that are specific to your board layout.

Variable Resolution Priority:

  1. Command line values (highest priority)
  2. Device defaults (from config.json)
  3. Global variable defaults (from config.json)
  4. Command defaults (from info.json)

Example:

# With device defaults, you can run:
circremote my-device BME280

# Instead of having to specify pins every time:
circremote my-device BME280 sda=board.IO1 scl=board.IO2 address=0x76

Global Variable Defaults

You can also set global default values for command variables that apply to all devices and commands using the variable_defaults field in your configuration. This is useful for setting common defaults like I2C pins that are consistent across your setup.

Example:

# With global defaults, you can run:
circremote /dev/ttyUSB0 BME280  # Uses global sda/scl defaults

# Device-specific defaults still override global defaults:
circremote my-device BME280     # Uses device defaults, then global defaults

Then use device aliases:

circremote my-device temp

Options

  • -v, --verbose: Verbose output
  • -q, --quiet: Quiet mode (suppress output except device output)
  • -y, --yes: Auto-confirm all prompts
  • -c, --skip-circup: Skip dependency installation
  • -p, --password: Web Workflow password
  • -C, --config: Custom config file path
  • -u, --circup: Custom circup path
  • -t, --timeout: Connection timeout (seconds)

Documentation

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circremote-0.12.0.tar.gz (87.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

circremote-0.12.0-py3-none-any.whl (181.5 kB view details)

Uploaded Python 3

File details

Details for the file circremote-0.12.0.tar.gz.

File metadata

  • Download URL: circremote-0.12.0.tar.gz
  • Upload date:
  • Size: 87.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for circremote-0.12.0.tar.gz
Algorithm Hash digest
SHA256 c22b3eac78ad0f2ff82fef053d50da810eabe268a0a73736b36b17b70695e970
MD5 af690b284a29ce952ff5ab93364609d3
BLAKE2b-256 c7674c92e22593e479fd93452fd099333594c81a17ed761963db55196f6ae520

See more details on using hashes here.

File details

Details for the file circremote-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: circremote-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 181.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for circremote-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6199125664b1754871737204f97dc43cc68e1e32de3afa18525d7dede073f8c
MD5 44656af3f084a86039a260d6cb2e22f9
BLAKE2b-256 e4c3dcde3289304d45055b425ae9a2012d5705febb4087eb443cca5a387ac09c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page