https://github.com/alvarowolfx/wasm-arduino-wifi
Running TinyGo/Rust/Assemblyscript on an ESP32 using WebAssembly.
https://github.com/alvarowolfx/wasm-arduino-wifi
Last synced: 4 months ago
JSON representation
Running TinyGo/Rust/Assemblyscript on an ESP32 using WebAssembly.
- Host: GitHub
- URL: https://github.com/alvarowolfx/wasm-arduino-wifi
- Owner: alvarowolfx
- Created: 2020-01-20T15:27:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-03T22:33:25.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T15:19:45.750Z (about 1 year ago)
- Language: C++
- Homepage: https://twitter.com/alvaroviebrantz/status/1221618910803513344?s=20
- Size: 118 KB
- Stars: 67
- Watchers: 7
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Running WASM on Arduino
Testing WebAssembly on IoT devices.
This is a Work in Progress - [Demo video](https://twitter.com/alvaroviebrantz/status/1221618910803513344?s=20)
### OTA Update WASM file
The file is being saved on SPIFFS and the Arduino is loading from it to run on WASM3 VM. So we can update the WASM code without changing the host code.
Steps to update WASM code:
* `cd` into `assemblyscript` folder and run `npm run build`.
* This will compile the AS code to Wasm and also copy the file to the `data` folder#### To update locally via cable
* Run the command `pio run --target uploadfs`#### To update via WiFi
* Your device needs to sucessfully connect to the network. Then follow the steps:
* First search for the MDNS service using `dns-sd -B _ota .`. Example output:
```
Browsing for _ota._tcp
DATE: ---Thu 23 Jan 2020---
0:04:57.636 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name
0:07:10.852 Add 2 8 local. _ota._tcp. esp-38A4AE30
```
* Them send an Wasm file on the /upload endpoint on the device:
```
curl -X POST -F "app.wasm=@./app.wasm" http://esp-38A4AE30.local/upload
```