ESP32 is a low-cost MCU that is very rich in features and of course portable. Meanwhile, Svelte is a compile time front-end framework (basically just HTML + JS compiler) that outputs responsive UI without relying on vDOM like React or Vue. This template ease uploading static assets to ESP32 persistent memory (in this case, SPIFFS is used).
- Node.js
- Python 3.x
- Arduino-CLI (in PATH) is recommended, or
- Arduino SDK (installed with Arduino IDE)
- If using IDE 1.x, just use Arduino extension for Visual Studio Code, or the IDE itself.
- Just the same for IDE 2.x, but this version also has built-in Arduino-CLI (usually NOT in PATH, put the path to cli to
cli
inarduino-config.json
). - Or if you don't feel like it, we'll download it for you. Just run
upload
/deploy
script.
- Use Visual Studio Code
- Clone this repo.
npm i
pip install -r requirements.txt
npm run upload port=COM7
to upload web server assets to SPIFFS of esp32 atCOM7
.npm run deploy
to deploy program (script automatically use previous set port:COM7
).
Port is saved as port
configuration in arduino-config.json
. Set this value or call upload
/deploy
with port
argument provided. Subsequent calls of those scripts do not need port
to be provided. Exception will be thrown if port
configuration is undefined or is an empty string.
Board configuration is default to DOIT ESP32 DEVKIT V! (set as
board
inarduino-config.json
). List avaiable esp32 boards withnpm run lisboards
command.
build
,dev
,start
: Svelte scripts to build/watch/test web server on localhost.mkfs
: Build SPIF file system (.spiffs.bin
) frompublic
folder.upload
: Build SPIFFS frompublic
folder then upload to esp32, accept port argument withport=PORT
.deploy
: Upload arduino program to esp32, accept port argument withport=PORT
.listboards
: List all available esp32 boards, set accordingly inboard
inarduino-config.json