IoT device abstraction with Eclipse Vorto
Discover Eclipse Vorto, an open-source Internet of Things project that helps compile and manage abstract device descriptions. In this article, Alexander Edelmann explains how to use Vorto to manage and effortlessly integrate IoT devices.
Eclipse Vorto is an open source project that aims to help compile and manage abstract device descriptions (information models). What’s special about this project is that it’s not an attempt to prescribe any one standard that encompasses all existing technologies. Instead, Eclipse Vorto takes a completely technology-independent approach – and this could eventually make it easier to implement standards.
To achieve interoperability for devices in the IoT, device manufactures and platform operators have to take into account all the various communication protocols, hardware environments, and programming languages, as well as their idiosyncrasies. Eclipse Vorto addresses these issues. What are known as information models provide an abstract description of device properties and functions. These information models can then be managed and made available through the Vorto Repository. This means, device manufacturers can release information models for users to download; they can then use code generators to create platform-specific source code – so they can integrate their devices far more easily.
All you need to get started, is to install the Vorto Toolset Plugins from Eclipse Marketplace. Once installed, you can switch to the Vorto perspective where you have the option to either create a new Information Model or browse through existing information models in the Eclipse Vorto Repository.
In this simple example, we are going to describe a grove light sensor and use the Vorto Code Generation Infrastructure to generate source code for thisus description in order to visualize sensor data in an AngularJS web interface.
Step 1: Create a new Vorto Demo Project by clicking on the + icon and then create a new Information Model ‘GroveLightSensor’. The functionality of the light sensor is already described as a functionblock and can be looked up in the Model Repository. Just drag and drop the functionblock onto the Information Model. This will download the model to your local workspace.
Step 2: Now that you have described the grove sensor, you can share it with the Vorto Repository where users can find it and integrate it into their IoT platform based on your information model using platform – specific code generators. Let’s do that and integrate the grove sensor by building a tiny web application that is able to display the grove sensor value. To save us some development time, we can use the existing Web UI Code Generator provided by Vorto to implement this use case. Just right-click on the Grove Light Sensor information model, choose Generate Code → Web UI Generator.
Run the generated application from your Eclipse IDE and open the following URL in your browser:
Voila, the UI is fairly simple but keep in mind, that we just spent a couple of seconds “implementing” this. Take a look at the Vorto tutorial that walks you through some additional steps by consuming MQTT data for your device and bind the device values to the web application UI elements.
This post was originally published in the March 2017 issue of the Eclipse Newsletter: Internet of all the Things
For more information and articles check out the Eclipse Newsletter.