WoT-microcontroller-servient is an implementation of W3C Web of Things Servient for embedded systems. This module allows users to: define W3C WoT Thing Descriptions, generate scripting files (sketches) in Embedded-C programming language executable by microcontrollers to expose Things, compile and flash these sketches.
This module provides an Electron-made GUI for WoT-microcontroller-servient project by Daniele Rossi. User can provide all the metadata included in W3C WoT Thing Descriptions via forms on GUI and store them in a JSON Thing Description file. The project can also build a scripting file including the Thing logic. This scripting file is compiled and flashed into a microcontroller. The sketch has .ino extension (like Arduino IDE). This project can also compile the built .ino project and upload to the prototipying board, calling the Servient Builder and showing it to a built-in terminal.
The only supported embedded system is Espressif ESP32 (an extra compatibility support is provided for NodeMCU ESP8266)
This package is only supported by Linux systems.
Linux
- Python v3.6.x
- Nodejs v8.10.0 (tested also with v9.11.2 and v10.21.0)
- npm (tested with version 3.5.x)
- pip3 Python package manager
- A proper C/C++ compiler toolchain, like GCC
- git
- Arduino IDE toolkit (the component used is arduino-cli)
- curl
Install needed software from repos:
sudo apt update && sudo apt upgrade -y
sudo apt install git python3 python3-pip npm nodejs git arduino curl -y
Please note that some Arduino packages are outdated if picked from official distros repositories. We suggest to download and install the latest Arduino-IDE toolkit from the official Arduino website.
Clone the repository:
git clone git@github.com:UniBO-PRISMLab/micro-wot-servient.git
Go into the repository:
cd WoT-microcontroller-servient-GUI
Install the package and all dependencies:
sudo pip3 install .
npm install
Depending of what you need, you have also to provide Arduino libraries (should be installed in default library directory, typically ~/Arduino/libraries
)
It is recomended to install and use the package inside a virtual environment.
The application can be started with the following command:
npm start
With this repository a Dockerfile is provided. This dockerfile generates a new image working with wot.
cd micro-wot-servient #enter in the main project directory
docker build . -t wot
For make it run (change/add devices you want to upload to. In this example /dev/ttyUSB0 is used):
docker run --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --user=$(id -u $USER):$(id -g $USER) --device=/dev/dri:/dev/dri --device=/dev/ttyUSB0 wot
Scripting API
- RESTful API ✔️
Protocol Support
- HTTP ✔️
- WebSocket ✔️
- CoAP ✔️
MediaType Support
- JSON ✔️
- Plain Text ✔️
WoT-microcontroller-servient-GUI is released under the MIT License.