Task definition and Python script to upload from VS Code to CircuitPython board via web workflow REST API.
CircuitPython 8.x adds web workflow allowing code to be edited/uploaded via the local network. There is built-in browser support and also a Web REST API. This project utilizes the latter to upload a file directly from VS Code.
- Python 3 installed and in your path.
- CircuitPython 8.x on your board.
- Board connected to same Wi-Fi with web workflow configured and reachable from machine running VS Code.
- Copy .vscode directory from this project to the root of your CircuitPython project. It does not have to be copied to your CircuitPython board, just the machine running VS Code.
- Edit .vscode/.env and set baseURL, CIRCUITPY_WEB_API_PASSWORD and the files and folders to be ignored.
- To update the files on the device, execute the "Run Task..." command.
- Menu: Terminal, Run Task...
- Command pallet: Tasks: Run Task
- Shortcut keys: TODO:DOCUMENT_THESE
- Keybindings can be configured to call a specific task.
NOTE:
- New files and folders that exist in the project folder but not on the device will be copied to the device.
- Files and folders present on the device but missing from the project folder will be deleted from the device.