Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Web of things servers for microcontrollers #14
This is to track proposals for implementing open source Web of Things servers for microcontrollers. I would expect these to be separate GitHub projects, but to share a common test framework.
The idea is to create resource constrained servers that can run on microcontrollers for use as IoT devices directly connected to sensors or actuators, or as gateways to IoT technologies such as Bluetooth or ZigBee. It would make sense to start from existing open source servers. Some questions to be addressed include
A resource constrained IoT device may just support a fixed set of "things" without any dependencies on other "things", for example a temperature and humidity sensor such as the DHT11, or a switch that operates a light. This allows for a really stripped down Web of Things server, where the logic of the things it hosts is coded in the same language as the server, e.g. C.
A more powerful device may support a scripting language and allow scripts for things to be uploaded to it subject to appropriate security mechanisms. One possibility would be a server written in C + Lua. Such a device may also play a role in discovery, and allow things with dependencies on other things that are hosted on other devices.
If you are starting such a project please post a response to this issue telling us about your project and including a link to it.
SCXML is a W3C standard for Statecharts, a visual modeling language for safety-critical embedded systems.
I am working on an SCXML orchestration server for microcontrollers, code-named "MicroSMaaS". This work is based on the State Machines as a Service protocol (SMaaS), and the SCXMLD orchestration server. SMaaS provides an HTTP and REST-based protocol for interacting with state machines over a network, and SCXMLD provides a reference server implementation of SMaaS.
The SMaaS protocol may also be adapted to use a more lightweight protocol, such as CoAP instead of HTTP.
When a constrained IoT device may just support a fixed set of "things" without any dependencies on other "things", and consider time-series style sensors (providing data streams) for example temperature and humidity sensor.
There is a use case that have been used in one of my WoT open source projects. This could be summarized in the following architectural pattern.
This architecture is trying to give a general purpose framework for very constrained devices to stream series data over WebSocket to user clients. In general, a constrained device doesn't need to contain a built-in WebSocket/HTTP server. The architecture is also a proposal for multiple connections of user clients. Whe a constrained device has a builtin-in WebSocket server and used as a data server, it may not be able to accept and serve too many connections because of it has less memory or other limited hardware resources.
To send the data over the Internet, IoT devices should use the url below to establish a connection with the server.
You must specify an object name and your hostname. For example:
To receive data from the server, the frontend should use the url below to establish a connection with the server.
Also, you need to specify the object name and hostname. For example:
In the perspective view of a virtual object, the object has two significant resources, send and viewer. send is to send device data to WebSocket broker server.
I would like to contribute a draft implementation to the separated GitHub projects of this issue.
Web Sockets may be impractical on microcontrollers with limited memory. MQTT is a popular pub-sub protocol using TCP for constrained devices and can be used to stream sensor readings to a server in the cloud. CoAP can be likened to HTTP but using UDP, and there is work on a pub-sub mechanism, see:
Another approach is to use a hub server that sits behind the firewall+NAT and relays the sensor stream to the cloud. The hub could, for instance, have drivers for IoT protocols like Bluetooth or ZigBee. We're looking for volunteers to help with writing such drivers for common classes of devices for which there are well defined profiles. The hub could be based on the NodeJS server in this project or the Go (lang) based server we plan to start as another sister project.