warduino

📟 A dynamic WebAssembly VM for embedded systems

https://github.com/topllab/warduino

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • ✓
    CITATION.cff file
    Found CITATION.cff file
  • ✓
    codemeta.json file
    Found codemeta.json file
  • ✓
    .zenodo.json file
    Found .zenodo.json file
  • ✓
    DOI references
    Found 3 DOI reference(s) in README
  • â—‹
    Academic publication links
  • â—‹
    Academic email domains
  • â—‹
    Institutional organization owner
  • â—‹
    JOSS paper metadata
  • â—‹
    Scientific vocabulary similarity
    Low similarity (15.0%) to scientific vocabulary

Keywords

arduino debugger debugging-tool embedded esp32 espressif interpreter iot runtime wasm webassembly webassembly-runtime zephyr
Last synced: 4 months ago · JSON representation ·

Repository

📟 A dynamic WebAssembly VM for embedded systems

Basic Info
Statistics
  • Stars: 94
  • Watchers: 6
  • Forks: 9
  • Open Issues: 106
  • Releases: 19
Topics
arduino debugger debugging-tool embedded esp32 espressif interpreter iot runtime wasm webassembly webassembly-runtime zephyr
Created about 6 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Citation

README.md

WARDuino

Wasm virtual machine for ESP32 / Arduino

Installation | Examples | Run Specification tests | Documentation

About

This project is released under the Mozilla Public License 2.0, and is being developed as part of an active research project at the University of Ghent's TOPL Lab.

  • The WARDuino virtual machine is a WebAssembly runtime for microcontrollers, which runs both under the Arduino and ESP-IDF toolchains.
  • The WARDuino virtual machine features an extensive debugger with novel techniques such as out-of-place debugging.
  • The virtual machine allows developers to implement their own primitives in C++, which are callable from Wasm.
  • The WARDuino project also includes a VS Code extension to use both the remote debugging and the out-of-place debugging facilities offered by the virtual machine.

[!WARNING] WARDuino is not 1.0, since this is an active research project. Expect possible bugs or performance issues.

Build and Development Instructions

[!NOTE] Supported platforms: Linux (Ubuntu), macOS, ESP-IDF, Arduino

The project uses CMake. Quick install looks like this:

bash git clone --recursive git@github.com:TOPLLab/WARDuino.git cd WARDuino mkdir build-emu cd build-emu cmake .. -D BUILD_EMULATOR=ON make

This will build the command-line tool (emulator), which has been tested on both linux and macOS.

The WARDuino VM can be compiled with both the Arduino and ESP-IDF toolchains, and has been extensively tested on different ESP8266 and ESP32 microcontrollers.

Build for ESP-IDF

[!WARNING] Primitive support for IDF is under construction.

Before you can compile and flash with ESP-IDF, you must install and enable the toolchain. You also need to disable the watchdog timer:

  1. Go to the root folder of the WARDuino repo
  2. run idf.py menuconfig
  3. Under Component config → ESP System Settings disable the following options:
    • Interrupt watchdog
    • Initialize Task Watchdog Timer on startup
  4. Save and quit the menu

Make sure the ESP-IDF tools are enabled, otherwise these steps will not work.

To install the WARDuino with the ESP-IDF toolchain perform the following steps starting from the project root folder:

bash mkdir build cd build cmake .. -D BUILD_ESP=ON make flash

Or simply run idf.py flash.

Build for Arduino

First, install the arduino-cli. You will also need python3 with the pyserial pacakge.

Second, create the config file:

bash arduino-cli config init

If you need additional boards, such as the esp32 boards, you can add them in the generated config file. More information on how to install the esp32 boards can be found here. (note: WARDuino requires at least version 3.0.0 of the esp32 board manager when using esp32 devices)

Thirdly, make sure you install the PubSubClient and Adafruit NeoPixel library. (used for MQTT and pixel primitives)

bash arduino-cli lib install "PubSubClient" # for MQTT arduino-cli lib install "Adafruit NeoPixel" # for some primitives

To build for Arduino with Wi-Fi support you need to also install the following third-party libraries. (You might need to set enable_unsafe_install to true in your Arduino config)

bash arduino-cli lib install FreeRTOS arduino-cli lib install --git-url https://github.com/me-no-dev/AsyncTCP.git

If you haven't done so already, clone (or symlink) this repository to ~/Arduino/libraries to make WARDuino available to Arduino.

After this initial installation steps you can start using WARDuino with the Arduino toolchain. You can upload the example file as follows, starting from the project root:

bash cd platforms/Arduino make compile BINARY={{Path to .wasm file}} make flash

For more information on how to change the board type, or configure the serial port, see the platform specific documentation.

Build for Emulator

WARDuino can also be build as a command-line tool for a desktop environment. The purpose of this CLI is to allow developers to test WARDuino applications without the need to buy a microcontroller. The CLI is also used to run the various unit and specification tests for WARDuino.

To install the CLI perform the following steps starting from the project root folder:

bash mkdir build-emu cd build-emu cmake .. -D BUILD_EMULATOR=ON make

WebAssembly Specification tests

shell cd tests/latch npm run spectest

Technical support and feedback

For a feature request or bug report, create a GitHub issue.

Acknowledgments

WARDuino by Robbert Gurdeep Singh, Tom Lauwaerts, Carlos Rojas Castillo, Maarten Steevens and Christophe Scholliers is licensed under a MPL-2.0 License. An early version of this work was derived from kanaka/wac by Joel Martin.

If you need to cite WARDuino in your research, use:

bibtex @article{ WARDuino2024, title = {WARDuino: An Embedded WebAssembly Virtual Machine}, shorttitle = {WARDuino}, author = {Lauwaerts, Tom and Gurdeep Singh, Robbert and Scholliers, Christophe}, year = {2024}, month = feb, journal = {Journal of Computer Languages}, pages = {101268}, issn = {2590-1184}, doi = {10.1016/j.cola.2024.101268}, keywords = {Internet-of-Things,Language symbiosis,Virtual machine,WARDuino,WebAssembly} }

Owner

  • Name: TOPL Lab
  • Login: TOPLLab
  • Kind: organization
  • Email: warduino@ugent.be
  • Location: Ghent University

Theory & Operations of Programming Languages Lab at Ghent University

Citation (CITATION.cff)

cff-version: 1.2.0
message: You can also find a BibTeX in the README.md
title: >-
  WARDuino: An Embedded WebAssembly Virtual Machine
doi: 10.1016/j.cola.2024.101268
authors:
  - family-names: Lauwaerts
    given-names: Tom
    affiliation: Ghent University
  - family-names: Gurdeep Singh
    given-names: Robbert
    affiliation: IMEC
  - family-names: Scholliers
    given-names: Christophe
    affiliation: Ghent University
identifiers:
  - description: Research paper you should be citing
    type: doi
    value: 10.1016/j.cola.2024.101268
preferred-citation:
  authors:
    - family-names: Lauwaerts
      given-names: Tom
      affiliation: Ghent University
    - family-names: Gurdeep Singh
      given-names: Robbert
      affiliation: IMEC
    - family-names: Scholliers
      given-names: Christophe
      affiliation: Ghent University
  title: >-
    WARDuino: An Embedded WebAssembly Virtual Machine
  doi: 10.1016/j.cola.2024.101268
  type: article
  year: 2024
  issn: "2590-1184"
  journal: Journal of Computer Languages
  publisher:
    name: Elsevier
  keywords:
    - Internet-of-Things
    - Language symbiosis
    - Virtual machine
    - WARDuino
    - WebAssembly

GitHub Events

Total
  • Create event: 34
  • Release event: 3
  • Issues event: 28
  • Watch event: 14
  • Delete event: 24
  • Issue comment event: 11
  • Push event: 183
  • Pull request review comment event: 3
  • Pull request event: 41
  • Pull request review event: 15
  • Fork event: 2
Last Year
  • Create event: 34
  • Release event: 3
  • Issues event: 28
  • Watch event: 14
  • Delete event: 24
  • Issue comment event: 11
  • Push event: 183
  • Pull request review comment event: 3
  • Pull request event: 41
  • Pull request review event: 15
  • Fork event: 2

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 17
  • Total pull requests: 8
  • Average time to close issues: over 2 years
  • Average time to close pull requests: about 4 hours
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 0.12
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 16
  • Pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • tolauwae (29)
  • MaartenS11 (4)
  • carllocos (2)
  • louisvangeldrop (1)
  • TAOFOR4 (1)
  • anthonyjclark (1)
Pull Request Authors
  • tolauwae (27)
  • MaartenS11 (18)
  • jay-tux (2)
  • dependabot[bot] (2)
  • Yuxin-Qin (1)
Top Labels
Issue Labels
bug (4) feature (4) refactor (2) major feature (2) chore (1) performance (1)
Pull Request Labels
dependencies (7) bug (6) chore (4) major feature (3) refactor (3) feature (3) javascript (2) performance (2) Experimental (1) tests (1)

Dependencies

examples/assemblyscript/package-lock.json npm
  • assemblyscript 0.17.14 development
  • binaryen 98.0.0-nightly.20201109 development
  • long 4.0.0 development
  • @assemblyscript/loader 0.17.14
examples/assemblyscript/package.json npm
  • assemblyscript ^0.17.14 development
  • @assemblyscript/loader ^0.17.1
requirements.txt pypi
  • GitPython ==3.1.24
  • gitdb ==4.0.9
  • pyparsing ==3.0.6
  • smmap ==5.0.0
  • typing-extensions ==4.0.0
.github/workflows/compile.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v2 composite
  • arduino/compile-sketches v1 composite
  • espressif/esp-idf-ci-action v1 composite
  • jidicula/clang-format-action v3.5.1 composite
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite