Skip to content

The webrepl_client enables in-browser access to MicroPython boards via WebSockets. Using webrepl.html, webrepl.js, term.js, FileSaver.js, and webrepl.css, it provides a styled terminal, file transfer, and live REPL interaction over Wi-Fi.

Notifications You must be signed in to change notification settings

benax-rw/webrepl_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebREPL client for MicroPython

This repository contains the WebREPL client and related tools, for accessing a MicroPython REPL (interactive prompt) over WebSockets.

To start WebREPL terminal client, clone or download this repository (in full) and open webrepl.html in a browser. Recent versions of Firefox and Chrome (or Chromium) are supported.

The latest version of the client is also hosted online at http://micropython.org/webrepl (note: while it's hosted online, all interaction with your boards still happen locally in your own network).

At this time, WebREPL client cannot be accessed over HTTPS connections. This is due to not widely published policy that HTTPS pages may access only WSS (WebSocket Secure) protocol. ... As WebREPL is intended to be used only within a user's local network, HTTPS isn't strictly required, and not accessing webrepl.html over HTTPS is a suggested workaround.

WebREPL file transfer

WebREPL protocol includes experimental support for file transfer. This feature is currently in alpha and has known issues on systems which have it enabled (ESP8266).

To use WebREPL file transfer capabilities, a separate command line utility is provided, webrepl_cli.py (file transfer is not supported via webrepl.html client). Run

webrepl_cli.py --help

to see usage information. Note that there can be only one active WebREPL connection, so while webrepl.html is connected to device, webrepl_cli.py can't transfer files, and vice versa.

Technical details

WebREPL is the latest standard (in the sense of an Internet RFC) for communicating with and controlling a MicroPython-based board. ... Based on these requirements, WebREPL uses a single connection over WebSocket as a transport protocol. ... While WebREPL is primarily intended for network (usually, wireless) connection, due to its single-connection, multiplexed nature, the same protocol can be used over a lower-level, wired connection like UART, SPI, I²C, etc.

Few other traits of WebREPL:

  1. It is intended (whenever possible) to work in background ... normal REPL/user application should continue to run and be responsive ...
  2. ... it's not intended to support multiple, per-connection sessions. There's a single REPL session, and this same session is accessible via different media, like UART or WebREPL. ...
  3. ... WebSocket "text"-flagged messages are used to communicate terminal input and output ... There's a guaranteed password prompt ... If you're interested in developing a 3rd-party application to communicate using WebREPL terminal protocol, the information above should be enough to implement it (or feel free to study implementation of the official clients in this repository).# webrepl_client

About

The webrepl_client enables in-browser access to MicroPython boards via WebSockets. Using webrepl.html, webrepl.js, term.js, FileSaver.js, and webrepl.css, it provides a styled terminal, file transfer, and live REPL interaction over Wi-Fi.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages