Skip to main content

webrepl

Python module to handle micropython websocket (WS) repl protocol (client side only). It is modified original implementation to automatize working with web repl.

Examples

Simple example to get output of command:

import webrepl
repl=webrepl.Webrepl(**{'host':'192.168.4.1','port':8266,'password':'ulx3s'})
resp=repl.sendcmd("import os; os.listdir()")
print(resp.decode("ascii"))

Example to get version of webrepl on device:

import webrepl
repl=webrepl.Webrepl(**{'host':'192.168.4.1','port':8266,'password':'ulx3s','debug':True})
ver=repl.get_ver()
print(ver)

Requirements

It should work with both python2 and python3 with simple pip commands:

pip install webrepl

webreplcmd examples

Few webreplcmd examples:


webreplcmd --host 192.168.4.1 --password ulx3s ls
webreplcmd --host 192.168.4.1 --password ulx3s get src-remote-file.txt dest-local-file.txt
webreplcmd --host 192.168.4.1 --password ulx3s -v get src-remote-file.txt dest-local-file.txt
webreplcmd --host 192.168.4.1 --password ulx3s put src-local-file.txt dest-remote-file.txt
webreplcmd --host 192.168.4.1 --password ulx3s -v put src-local-file.txt dest-remote-file.txt
webreplcmd --host 192.168.4.1 --password ulx3s cat main.py
webreplcmd --host 192.168.4.1 --password ulx3s cmd 'import os; os.listdir()'
webreplcmd --host 192.168.4.1 --password ulx3s rm uftpd.py

Note that you can also specify basic parameters using environment variables:

export WEBREPL_HOST=127.0.0.1
export WEBREPL_PASSWORD=ulx3s
export WEBREPL_PORT=8266

and then you can just specify command:

webreplcmd ls

All options are listed using --help:

webreplcmd --help

Requirements

It should work with both python2 and python3 with simple pip commands:

sudo apt-get update
sudo apt-get install -y python3 python3-pip
sudo pip3 install webrepl

Manual

usage: webreplcmd [-h] [--host HOST] [--port PORT] [--verbose] [--debug]
                    [--password PASSWORD] [--before BEFORE] [--cmd CMD]
                    [--after AFTER]
                    CMD [CMD ...]

webrepl - connect to websocket webrepl

positional arguments:
  CMD                   commands for repl

optional arguments:
  -h, --help            show this help message and exit
  --host HOST, -i HOST  Host to connect to
  --port PORT, -P PORT  Port to connect to
  --verbose, -v         Verbose information
  --debug, -d           Enable debugging messages
  --password PASSWORD, -p PASSWORD
                        Password used to connect to
  --before BEFORE, -B BEFORE
                        command to execute before
  --cmd CMD, -c CMD     command to execute
  --after AFTER, -A AFTER
                        command to execute after

webreplcmd --host 192.168.4.1 --password ulx3s ls
webreplcmd --host 192.168.4.1 --password ulx3s get src-remote-file.txt dest-local-file.txt
webreplcmd --host 192.168.4.1 --password ulx3s put src-local-file.txt dest-remote-file.txt
webreplcmd --host 192.168.4.1 --password ulx3s cat main.py
webreplcmd --host 192.168.4.1 --password ulx3s cmd 'import os; os.listdir()'

Metadata

Release files for webrepl 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webrepl 0.2.0
File Size Uploaded Provenance Actions
webrepl-0.2.0.tar.gz 5.7 kB Without provenance Details for webrepl-0.2.0.tar.gz

Release files / webrepl-0.2.0.tar.gz

Download URL webrepl-0.2.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ae37eb21994d0ba1a0caf59928acf60bb9261f43777fd9bd6f7ecbb0b5474c5e
BLAKE2b-256 checksum
How to use checksums
e6e5a0345dcd6584d70fc049783a3594f21ecb587fb47e7fa59b804d001c683a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.5

Security for webrepl 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page