tsathishkumar / MySController-rs

Controller for MySensors, exposes WoT APIs for the sensors. It supports OTA firmware updates, and also acts as proxy for all requests.
GNU Affero General Public License v3.0
20 stars 9 forks source link
firmware-management fota gateway mozilla-iot mysensors mysensors-controller ota ota-firmware-updates rust webofthings wot-api

Build Status Download Docker Hub License: AGPL v3

MySController-rs

Started as a project to support OTA for MySensors and proxy for all other requests. Now exposes WebOfThings APIs for MySensors (supporting very few sensors at the moment) and on it's way to be a fully functional API based controller for MySensors. Contributions to support other sensors are welcome.

APIs to manage nodes and firmwares

Run in Postman

All the APIs are available as postman collection and the docs can be found here.

There is also a pending task to add Swagger UI as part of the server .

Screenshots

Integration with Things Gateway

Integration with Things Gateway

This server also acts as a proxy between Gateway and the Controller. Both might be either connected through a serial port or a TCP connection.

Before running the server, set the correct connection type and connection port for Gateway and Controller in conf.toml file.

WoT api's are exposed at https://{host}:8888

To build and run manually:

git clone https://github.com/tsathishkumar/MySController-rs.git
cd MySController-rs
sudo cargo run

If you notice any errors, make sure you have the latest rust toolchain:

rustup default beta

Beta version of toolchain is necessary for features like cargo edition field.

To install and run as a service in a debian/ubuntu flavour machine

Note: If you are using TCP for controller - the port value will be used to create TCP server listening on the specified port. (So it shoud be the address of the machine running MySController, 0.0.0.0 always)

To add the Things in Mozilla IoT Gateway:

  1. Add Web Thing add-on as follows
    Settings -> Add-ons -> Add -> Web Thing
  2. Click on configure on Web Thing add-on and add the myscontroller-rs server url
    http://localhost:8888
  3. Go to Things page and click on + and you should be able to see all the sensors that are available through my-sensors network.

To Contribute

Check out the TODO list, and pick whichever you are interested or raise issues if you have encountered any.