FastLED Wasm Compiler
Project description
FastLED wasm compiler
Compiles an Arduino/Platformio sketch into a wasm binary that can be run directly in the web browser.
About
This python app will compile your FastLED style sketches into html/js/wasm output that runs directly in the browser.
Compile times are extremely fast - I've seen as low as 5 seconds but 8-15 seconds is typical.
This works on Windows/Linux/Mac(arm/x64).
Docker is required.
https://github.com/user-attachments/assets/64ae0e6c-5f8b-4830-ab87-dcc25bc61218
Demo
https://zackees.github.io/fastled-wasm/
Install
pip install fastled-wasm
Note that you may need to install x86 docker emulation on Mac-m1 and later, as this is an x86 only image at the prsent.
Use
Change to the directory where the sketch lives and run
cd <SKETCH-DIRECTORY>
fastled-wasm
Or if you don't have docker then use our web compiler
cd <SKETCH-DIRECTORY>
fastled-wasm --web
After compilation a web browser windows will pop up.
Hot reload by default
Once launched, the compiler will remain open, listening to changes and recompiling as necessary and hot-reloading the sketch into the current browser.
This style of development should be familiar to those doing web development.
Data
If you want to embed data, then do so in the data/ directory at the project root. The files will appear in the data/ director of any spawned FileSystem or SDCard.
About the compilation.
Pre-processing is done to your source files. A fake Arduino.h will be inserted into your source files that will provide shims for most of the common api points.
Revisions
- 1.0.17 - Pulls updates when necessary. Removed dependency on keyring.
- 1.0.16 -
fastled-wasmpackage name has been changed tofled - 1.0.15 -
fledis an alias offastled-wasmand will eventually replace it.--web-hostwas folded into--web, which if unspecified will attempt to run a local docker server and fallback to the cloud server if that fails. Specifying--webwith no arguments will default to the cloud server while an argument (likelocalhost) will cause it to bind to that already running server for compilation. - 1.0.14 - For non significant changes (comments, whitespace) in C++/ino/*.h files, compilation is skipped. This significantly reduces load on the server and prevents unnecessary local client browser refreshes.
- 1.0.13 - Increase speed of local compiles by running the server version of the compiler so it can keep it's cache and not have to pay docker startup costs because now it's a persistant server until exit.
- 1.0.12 - Added suppport for compile modes. Pass in
--release,--quick,--debugfor different compile options. We also support--profileto profile the build process. - 1.0.11 -
--webcompile will automatically be enabled if the local build using docker fails. - 1.0.10 - Watching files is now available for
--web - 1.0.9 - Enabled web compile. Access it with
--webor--web-host - 1.0.8 - Allow more than one fastled-wasm browser instances to co-exist by searching for unused ports after 8081.
- 1.0.7 - Docker multi image build implemented, tool now points to new docker image compile.
- 1.0.6 - Removed
--no-openand--watch,--watchis now assumed unless--just-compileis used. - 1.0.5 - Implemented
--updateto update the compiler image from the docker registry. - 1.0.4 - Implemented
--watchwhich will watch for changes and then re-launch the compilation step. - 1.0.3 - Integrated
live-serverto launch when available. - 1.0.2 - Small bug with new installs.
- 1.0.1 - Re-use is no longer the default, due to problems.
- 1.0.0 - Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fled-1.0.17.tar.gz.
File metadata
- Download URL: fled-1.0.17.tar.gz
- Upload date:
- Size: 157.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
911f4e7477e7e02955323521c4b7b291d822749672c4b2e0d4c0332f511a7c43
|
|
| MD5 |
08d21bc4d27b2bd95d20f04d99cf47f2
|
|
| BLAKE2b-256 |
857ddbbed8f7187119dce2b4d3b25bb498213cea86a55c14823870d291dc6fe8
|
File details
Details for the file fled-1.0.17-py2.py3-none-any.whl.
File metadata
- Download URL: fled-1.0.17-py2.py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52e6a544e9ca55941426bb2606aa769a84e1c39f96004e208763a6a319fecfed
|
|
| MD5 |
ac38c637ecee9d36e4f733bc30364bf9
|
|
| BLAKE2b-256 |
1f6af473fd15534548f4e3073ac6a7d0b2d3bdb2400ce31fc1af355477db3949
|