Skip to main content

cpremote is a command line tool for interacting with a CircuitPython remote filesystem access using the web based workflow

Project description

cpremote

cpremote is a command line tool for interacting with a CircuitPython remote filesystem using the web based workflow

description

This command line tool implements the CircuitPython web based workflow and is great for

  • CircuitPython boards that do not support native USB
  • CircuitPython boards that are remote
  • Workflows in which a CircuitPython project is kept external from the CircuitPython board such as on a host computer

I use cpremote, circup and CircuitPython for Visual Studio Codewith all of my CircuitPython projects.

install

pip install cpremote

environment variables

cpremote will look for a .env file in the current directory which can contain the CircuitPython host name, password and/or file size units use with ls

# IP address recommended for better performance
CPREMOTE_HOST=http://192.168.1.90
# remote password
CPREMOTE_PASSWORD=mypassword
# file size units for 'ls' command: 'b' - bytes, 'kb' - kilobytes or 'blocks'
CPREMOTE_UNITS=kb

example command usage

ls

Show the root directory on the remote filesystem

cpremote ls

get

Copy code.py from the remote filesystem to the console

cpremote get code.py

put

Copy code.py from the local filesystem to the remote filesystem. Note that the CircuitPython board's hostname and password can be set in .env, or can be overriden on the command line

cpremote --host http://1.2.3.4 --password mypassword put code.py

repl

The repl command will launch a basic web repl using the default system browser

help

Full help. Also, note that help for individual command line options is available using -h or --help before a command

cpremote --help
usage: cpremote [-h] [--host HOST] [--password PASSWORD] [--units {b,kb,blocks}] [-v] {devices,diskinfo,get,ls,mkdir,mv,put,repl,rm,rmdir,version} ...

CircuitPython remote filesystem access for web based workflow

positional arguments:
  {devices,diskinfo,get,ls,mkdir,mv,put,repl,rm,rmdir,version}
                        command help
    devices             show info about CircuitPython devices on the local network
    diskinfo            show disk info about the remote filesystem
    get                 get a file from remote filesystem
    ls                  list a directory on the remote filesystem
    mkdir               make a directory on the remote filesystem
    mv                  move (rename) a file or directory on the remote filesystem
    put                 put a file on the remote filesystem
    repl                start Web REPL
    rm                  remove a file on the remote filesystem
    rmdir               remove the directory and all of its contents on the remote filesystem
    version             returns information about the device

optional arguments:
  -h, --help            show this help message and exit
  --host HOST           CircuitPython host name. Overrides CPREMOTE_HOST environment variable
  --password PASSWORD   CircuitPython password.Overrides CPREMOTE_PASSWORD environment variable
  --units {b,kb,blocks}
                        file size units. Overrides CPREMOTE_UNIT environment variable
  -v, --version         show program's version number and exit

IP addresses vs mDNS local host names

In my experience, using IP addresses seems to be more performant than mDNS local host names when accessing a CircuitPython board. However, this may be an issue in my local network so your experience may be different

Attribution

CircuitPython is created by Adafruit Industries.

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

cpremote-1.0.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

cpremote-1.0.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file cpremote-1.0.3.tar.gz.

File metadata

  • Download URL: cpremote-1.0.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for cpremote-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a128c430a566ed65c4eee636740f2aae523c48a1bdd4c9e861f3d0333ffdc468
MD5 1c19ca5be43d83a7cce6218b21075718
BLAKE2b-256 ed788ddd6a9d74851d8bfd213627dc0e01c1ae69fbe7105360e705ca501013b7

See more details on using hashes here.

File details

Details for the file cpremote-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: cpremote-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for cpremote-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c7eab0571b2b9d5b5241ce93a398123a9abea11f0d2137ad4761127b47ce1af0
MD5 c8ed4a5ed1b197479ba867c41a438100
BLAKE2b-256 73a2198c8431e43ee444714224da14da9cc1e8ab403927cd45c3253a5674cefc

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