# FastLED wasm compiler
Compiles an Arduino/Platformio sketch into a wasm binary that can be run directly in the web browser.
[![Linting](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)
[![Build and Push Multi Docker Image](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
[![MacOS_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml)
[![Ubuntu_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml)
[![Win_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml)
# 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
```bash
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
```bash
cd <SKETCH-DIRECTORY>
fastled-wasm
```
Or if you don't have docker then use our web compiler
```bash
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-wasm` package name has been changed to `fled`
* 1.0.15 - `fled` is an alias of `fastled-wasm` and will eventually replace it. `--web-host` was folded into `--web`, which if unspecified will attempt to run a local docker server and fallback to the cloud server if that fails. Specifying `--web` with no arguments will default to the cloud server while an argument (like `localhost`) 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`, `--debug` for different compile options. We also support `--profile` to profile the build process.
* 1.0.11 - `--web` compile 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 `--web` or `--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-open` and `--watch`, `--watch` is now assumed unless `--just-compile` is used.
* 1.0.5 - Implemented `--update` to update the compiler image from the docker registry.
* 1.0.4 - Implemented `--watch` which will watch for changes and then re-launch the compilation step.
* 1.0.3 - Integrated `live-server` to 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/zackees/fastled-wasm",
"name": "fled",
"maintainer": "Zachary Vorhies",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "template-python-cmd",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/85/7d/dbbed8f7187119dce2b4d3b25bb498213cea86a55c14823870d291dc6fe8/fled-1.0.17.tar.gz",
"platform": null,
"description": "# FastLED wasm compiler\r\n\r\nCompiles an Arduino/Platformio sketch into a wasm binary that can be run directly in the web browser.\r\n\r\n[![Linting](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)\r\n[![Build and Push Multi Docker Image](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)\r\n[![MacOS_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml)\r\n[![Ubuntu_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml)\r\n[![Win_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml)\r\n\r\n\r\n\r\n# About\r\n\r\nThis python app will compile your FastLED style sketches into html/js/wasm output that runs directly in the browser.\r\n\r\nCompile times are extremely fast - I've seen as low as 5 seconds but 8-15 seconds is typical.\r\n\r\nThis works on Windows/Linux/Mac(arm/x64).\r\n\r\nDocker is required.\r\n\r\nhttps://github.com/user-attachments/assets/64ae0e6c-5f8b-4830-ab87-dcc25bc61218\r\n\r\n# Demo\r\n\r\nhttps://zackees.github.io/fastled-wasm/\r\n\r\n\r\n\r\n# Install\r\n\r\n```bash\r\npip install fastled-wasm\r\n```\r\n\r\n**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.**\r\n\r\n# Use\r\n\r\nChange to the directory where the sketch lives and run\r\n\r\n```bash\r\ncd <SKETCH-DIRECTORY>\r\nfastled-wasm\r\n```\r\n\r\nOr if you don't have docker then use our web compiler\r\n\r\n```bash\r\ncd <SKETCH-DIRECTORY>\r\nfastled-wasm --web\r\n```\r\n\r\nAfter compilation a web browser windows will pop up.\r\n\r\n# Hot reload by default\r\n\r\nOnce launched, the compiler will remain open, listening to changes and recompiling as necessary and hot-reloading the sketch into the current browser.\r\n\r\nThis style of development should be familiar to those doing web development.\r\n\r\n# Data\r\n\r\nIf 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.\r\n\r\n\r\n### About the compilation.\r\n\r\nPre-processing is done to your source files. A fake Arduino.h will be inserted into your source files that will\r\nprovide shims for most of the common api points.\r\n\r\n\r\n# Revisions\r\n\r\n * 1.0.17 - Pulls updates when necessary. Removed dependency on keyring.\r\n * 1.0.16 - `fastled-wasm` package name has been changed to `fled`\r\n * 1.0.15 - `fled` is an alias of `fastled-wasm` and will eventually replace it. `--web-host` was folded into `--web`, which if unspecified will attempt to run a local docker server and fallback to the cloud server if that fails. Specifying `--web` with no arguments will default to the cloud server while an argument (like `localhost`) will cause it to bind to that already running server for compilation.\r\n * 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.\r\n * 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.\r\n * 1.0.12 - Added suppport for compile modes. Pass in `--release`, `--quick`, `--debug` for different compile options. We also support `--profile` to profile the build process.\r\n * 1.0.11 - `--web` compile will automatically be enabled if the local build using docker fails.\r\n * 1.0.10 - Watching files is now available for `--web`\r\n * 1.0.9 - Enabled web compile. Access it with `--web` or `--web-host`\r\n * 1.0.8 - Allow more than one fastled-wasm browser instances to co-exist by searching for unused ports after 8081.\r\n * 1.0.7 - Docker multi image build implemented, tool now points to new docker image compile.\r\n * 1.0.6 - Removed `--no-open` and `--watch`, `--watch` is now assumed unless `--just-compile` is used.\r\n * 1.0.5 - Implemented `--update` to update the compiler image from the docker registry.\r\n * 1.0.4 - Implemented `--watch` which will watch for changes and then re-launch the compilation step.\r\n * 1.0.3 - Integrated `live-server` to launch when available.\r\n * 1.0.2 - Small bug with new installs.\r\n * 1.0.1 - Re-use is no longer the default, due to problems.\r\n * 1.0.0 - Initial release.\r\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "FastLED Wasm Compiler",
"version": "1.0.17",
"project_urls": {
"Homepage": "https://github.com/zackees/fastled-wasm"
},
"split_keywords": [
"template-python-cmd"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1f6af473fd15534548f4e3073ac6a7d0b2d3bdb2400ce31fc1af355477db3949",
"md5": "ac38c637ecee9d36e4f733bc30364bf9",
"sha256": "52e6a544e9ca55941426bb2606aa769a84e1c39f96004e208763a6a319fecfed"
},
"downloads": -1,
"filename": "fled-1.0.17-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ac38c637ecee9d36e4f733bc30364bf9",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 18703,
"upload_time": "2024-11-15T06:34:31",
"upload_time_iso_8601": "2024-11-15T06:34:31.208342Z",
"url": "https://files.pythonhosted.org/packages/1f/6a/f473fd15534548f4e3073ac6a7d0b2d3bdb2400ce31fc1af355477db3949/fled-1.0.17-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "857ddbbed8f7187119dce2b4d3b25bb498213cea86a55c14823870d291dc6fe8",
"md5": "08d21bc4d27b2bd95d20f04d99cf47f2",
"sha256": "911f4e7477e7e02955323521c4b7b291d822749672c4b2e0d4c0332f511a7c43"
},
"downloads": -1,
"filename": "fled-1.0.17.tar.gz",
"has_sig": false,
"md5_digest": "08d21bc4d27b2bd95d20f04d99cf47f2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 157665,
"upload_time": "2024-11-15T06:34:33",
"upload_time_iso_8601": "2024-11-15T06:34:33.143494Z",
"url": "https://files.pythonhosted.org/packages/85/7d/dbbed8f7187119dce2b4d3b25bb498213cea86a55c14823870d291dc6fe8/fled-1.0.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 06:34:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zackees",
"github_project": "fastled-wasm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fled"
}