Windows GUI for MPRemote Compatible Devices
Note: This project is not associated in any way with the Pyboard hardware project or the MicroPython organization.
BTW: Thanks Damien!
A simple GUI wrapper that executes the MPRemote application (https://github.com/micropython/micropython/tree/master/tools/mpremote) command to manipulate the files on an device running MicroPython. The device must support raw REPL over the serial port in order for this application to function properly.
It was written in C# in Visual Studio 2019, so you will need VS Express or better to compile it. It uses the Scintilla editor control (https://github.com/jacobslusser/ScintillaNET) which allows for MicroPython syntax highlighting.
As a development tool, I wrote the utility to mainly just edit the files directly off of the device. I have also embedded a simple terminal emulator to send commands to the serial REPL. The program works better though when paired with an external terminal such as puTTY or TeraTerm. See the configuration notes below on how to set this up.
To use, just unzip to a convenient location and run the MPRemoteEditor.exe.
DEPENDENCIES:
- Python 3.X
- MPRemote (pip3 install mpremote)
- .Net Framework (maybe)
HOW TO START:
- Plug your MicroPython device into your computer and determine what com port it was assigned to
- Start the application.
- Select the com port for your device (if there is more than one)
- The main window should appear with the files on the root of the device listed
- If there was a problem and the files were not listed, click on the Refresh button
HOW TO USE:
All the features are pretty self-explanatory, but here is just a short description of it's general use.
-
Navigation
- To open a file for viewing or editing, select the file and click "Open" (or just double-click the filename)
- To go into a sub-folder select the folder and click "Open" (or just double-click the folder name)
- To go back one directory click on the [..] entry at the top of the file list
-
Main Commands
- Refresh will re-read the file list of the current directory
- MkDir will allow you to create a sub-folder
- New will prepare a new file for editing
- Open will open a file for editing or change the directory
- Load will allow you to import a file from your computer
- Export will save the selected file to your computer
- Delete will delete the file or directory from the device
- Move will move (rename) the selected file
- View will open the selected file for viewing
- Run will attempt to import/run the selected file
- REPL will open a MicroPython REPL window
-
Editing Commands
- Undo/Redo/Cut/Copy/Paste/Delete standard editing commands
- Find will do a search on the current file being edited
- Replace will do a search and replace on the current file being edited
- Save As will save the current file to the device using the name you give it in the current directory
- Save will save the current file to the device
ADDITIONAL INFO:
- Configuration setting are located in the MPRemoteEditor.exe.config file
- CommPort designation can be a name like COM3 (no colon) or just a number
- The application defaults to 115200 baud for serial communications
- If ExternalTerminal is set to "Y" the TerminalApp, TerminalAppArgs and
TerminalAppTitle settings are used
-
TerminalApp is the EXE to run
-
TerminalAppArgs are the arguments to run the terminal app with
- The term {PORT} in this setting will be replaced at runtime with the current port
- The term {PORTNUM} in this setting will be replaced at runtime with the current port number
-
TerminalAppTitle is the title of the external window
-
Example:
<add key="ExternalTerminal" value="Y" />
<add key="TerminalApp" value="putty" />
<add key="TerminalAppArgs" value="-load "repl" -serial {PORT}" />
<add key="TerminalAppTitle" value="PuTTY" />
Invokes the putty.exe application and uses the "repl" session
-
- The EditExtensions setting determines what types of files are editable (text)
- The SaveDir setting determines where session files are created, if blank the EXE location is used
- UniqueSessions indicates if a single session directory is used or a new one for each program start
- The "session" directory is where a file is stored while being edited
- Color settings may be a WebColor name or a 3 value, comma-separated list of the RGB values to use
- CommPortExclusions should be just the numbers seperated by commas
- The editor now supports syntax highlighting for html/xml documents
- The editor now supports the Dragging and Dropping of multiple files from Windows Explorer. Just be sure to drop your file or files onto the directory list on the main window.
CAVEATS:
- Spaces in filenames and directories is NOT supported
- Be sure you have the latest version of MPRemote. Just execute pip install mpremote --upgrade
- Although it should work with any device that MPRemote works with, it has only been tested with...
- Pyboard v1.1
- TPYBoard
- Wemos D1 Mini
- Witty Cloud Board
- Generic NodeMCU Board
- Raspberry Pi Pico (requires DTR to be enabled)
- This can only edit basic text files and is focused on editing MicroPython source code
- Binary files can be loaded and exported
- This editor is only meant to edit a single file at a time
- You cannot delete a directory unless it is empty
- Switching between the REPL and the editor (and back) is a little rough... especially with an ESP8266 and the internal REPL.
- You may have to "Refresh" or try again to get a feature to work.
- Sometimes the software will pause until the device is momentarily unplugged
- This is highly dependent on the type of application that is running
- It is recommended you use an external application (such as putty or TeraTerm) for the REPL
ROADMAP:
- Proper Options/Configuration editing window.