Connecting Products More Intelligently With Eclipse Vorto

Connecting Products More Intelligently With Eclipse Vorto

How To Make Devices Really Smart

More and more devices are getting connected, and their number is constantly growing. From consumer electronics to huge production sites and smart cities – consumers and companies profit alike. Some from more convenience, a higher quality of life, and more security, others from increased efficiency and cost improvement. But how can connected devices communicate across technologies and across platforms? An Open Source project focuses on interoperability and more collaboration.

It would be easy to come up with a myriad of scenarios about what life would be like in a world full of smart connected devices. The reality however is that each vision of smart cities, factories, homes and effectively all smart infrastructures requires a tremendous effort behind the scenes to become possible. Connected devices are already revolutionizing economic activity and our way of life, and by now it is probably more difficult to imagine which devices won’t be connected in the future than to make a list of those that will be. In effect, the Internet of Things (IoT) is no longer mere theory. It’s very much alive and constantly evolving at a pace that poses a vast array of challenges to device manufacturers, to platform vendors, solution developers and consumers alike.

In some respects, however, something seems to be missing for the Internet of Things to come to its full potential. Those who wish for an easy way to integrate all their devices with existing infrastructures, face a variety of industry-specific standards. The technologies to connect devices and manage connected systems are already in place, but all too often they simply lack the ability to interact with different devices and different systems. The Internet of Things falls short when it comes to interoperability and collaboration.

To work together, devices have to be addressed and operated from a common platform or application, but there is more than one platform out there. In effect, device manufacturers and platform vendors need to incorporate a variety of highly diverse communication protocols, hardware environments and programming languages. This does not only sound like an ordeal, it certainly is both time-consuming and expensive.

The industry hasn’t yet defined a higher level standard that would help platform vendors to seamlessly implement different devices from various manufacturers and make them communicate with each other. Not because the industry is too slow, but rather because it is moving forward so fast, and because technology is evolving at such a rapid speed. As a result, providing device descriptions for every different platform out there means a tremendous effort for both, device manufacturers and platform vendors. At the same time, consumers are often forced to rely on devices from a single manufacturer if they want to equip their homes with smart home technologies.

This situation seems less than ideal for everyone, but in the future things could change for the better: By addressing the towering issues of interoperability and collaboration, the IoT project Eclipse Vorto has taken on one of the biggest challenges in IoT development.

HOW ECLIPSE VORTO WORKS

Eclipse Vorto is an Open Source project for creating and managing abstract device descriptions (information models). The project takes an unconventional approach by explicitly breaking away from trying to define a standard that encompasses all existing technologies. Instead, Eclipse Vorto pursues a completely technology independent approach – which could eventually facilitate the development of standards.

Eclipse Vorto addresses the subjects of device abstraction, device description and device integration. It uses so called information models to provide abstract descriptions of device properties and features. The Vorto repository allows managing and sharing these information models. Device manufacturers can publish information models, and developers can then download theses information models. Vorto’s code generators make it possible to generate platform specific source code from the information model. As a result, integrating a device with a specific platform is far easier.

So, how exactly does Eclipse Vorto facilitate dealing with device descriptions on a technical level? Mainly, Eclipse Vorto rests on four pillars: the IoT toolset, a meta model, the code generator infrastructure, and the repository.

IOT TOOLSET

With the IoT toolset includes a DSL editor (DSL: domain specific language) based on Eclipse XText. In addition to the basic features like syntax highlighting, auto completion, content assist, and validation, the IoT toolset includes the Vorto repository, a cloud storage for managing information models. One essential thing about the IoT toolset is the simplicity of its language. While it allows to model all relevant aspects of device interfaces, the language is still easy to read, even for people without a background in software development.

namespace org.eclipse.vorto.example

version 1.0.0

displayname “Location”

description “The location of an object.”

category demo

entity Location {

    mandatory    latitude    as    float     with { MeasurementUnit : LocationUnits.Degree,  readable : true } <MIN -90, MAX 90> “The latitude of the position.”

    mandatory    longitude    as    float    with { MeasurementUnit : LocationUnits.Degree,  readable : true } <MIN -180, MAX 180> “The longitude of the position.”

}

Listing 1: Example for a datatype modelled with Eclipse Vorto. The language’s grammar matches the meta model.

The example in listing 1 shows how Eclipse Vorto provides very compact information on the datatype LOCATION. Humans are able to read the data type, while the grammar makes sure that the information remains machine-parsable. And being machine-parsable allows for translations into other formats. Code generators can easily translate the data into a programming language, a documentation format like markdown, or into the form of a standard.

The Vorto perspective (fig. 1) is optimized for creating and sharing information models: Developers can include artifacts already available in the model repository directly into their own solutions via drag & drop.

Fig. 1: The interface of the Eclipse Vorto IoT toolset with the views for information models, function blocks, and data types.

Fig. 1: The interface of the Eclipse Vorto IoT toolset with the views for information models, function blocks, and data types.

META MODEL

Eclipse Vorto uses information models to create device descriptions The basis for information models is the Vorto meta model (Fig. 2).

Fig. 1: The interface of the Eclipse Vorto IoT toolset with the views for information models, function blocks, and data types.

Fig. 2: The Eclipse Vorto repository offers an overview of all available models.

The Vorto meta model defines the relationship between data types, function blocks and information models, as well as their structure. Technically, the meta model is based on Eclipse EMF, and it makes sure that all models are machine-parsable and thus validatable as well as translatable.

The largest unit of the meta model is the information model (IM), which ultimately represents the device description. The information model contains different reusable units: function blocks (FB), data types (DT), and enumerations (EN).

Data types and enumerations are the model’s smallest units. They represent simple types, for example a spatial position, the state of a door, or an intensity of light. Data types can also reference each other.

Function blocks describe sets of functions. A set of functions may for example be associated with a specific component of the device, like a battery, a light sensor, or a switch. Function blocks have properties (attributes) and patterns of behavior (operations).

The technology independent abstraction of a device creates a quasi-standard: The information model can be translated into various formats, and the specific instances of the model ultimately serve as source for automated code generation – and as a consequence also as the basis for the integration into different platforms.

Code Generator Infrastructure

The code generator infrastructure offers a straightforward way to translate an information model into another format. The infrastructure provides APIs to run through models and transfer data in an easy and convenient way by using templates. The templates are based on Eclipse XTend and allow to generate output in different formats, be it in the form of code or a documentation format.

Code generators can be addressed directly from the IoT toolset, but they can also be run as micro services addressed via the repository and REST. A code generator micro service can be advantageous in scenarios in which code has to be generated at runtime.

Repository

The Vorto repository is the place to store, manage, and roll out device descriptions from a central location. The repository’s web interface (Fig. 3) offers the option to search for models, to download them, or to translate them into a different format.

Fig. 3: Eclipse Vorto repository provides an overview of all available models.

Fig. 3: Eclipse Vorto repository provides an overview of all available models.

Additionally, users can add comments to the model. This option simplifies discussions about the model and makes communication about possible improvements a lot easier. The latest version of the Vorto repository is hosted at Eclipse. This way, the repository serves as a foundation for creating an ecosystem surrounding device descriptions.

The repository provides all functionality needed for seamless integration into existing infrastructure via a REST API [VortoRAPI].

It’s also possible to host code generators within the infrastructure [VortoGen]. Various example templates are available: for web applications, for provisioning of data with a CoAP server based on Eclipse Californium, or simply for the model’s translation into Java code in the form of POJO classes.

Who is Vorto for?

The components described above represent a toolbox for various scenarios in the field of IoT development. We’ll take a closer look at three audiences who can greatly benefit from Eclipse Vorto.

Device Manufacturers

Eclipse Vorto helps device manufactures simplify the integration of their devices into existing infrastructures. A common example: customers using a smart home infrastructure by one vendor who may want to integrate a device by another vendor.

Traditionally, device manufactures support the integration of their devices by providing documentation of their devices’ technical specifications, often as a PDF or in the form of another common documentation format.

With Eclipse Vorto, manufacturers can create a technology independent information model describing the device in detail. In this form, device specifications can be translated into a documentation format, but also into source code. This makes integration into the target platform much easier. Examples for target platforms are smart-home solutions like Eclipse SmartHome, but also solutions for Industry 4.0 platforms of other domains.

By using a technology independent information model, device manufacturers no longer have to provide implementations for all possible target platforms. Instead, manufacturers can publish technology independent information models in the Vorto repositories. Users can then use code generators to translate the information model into artefacts for their target platform.

IoT platform and application vendors

Customers in the IoT environment often want to combine various devices and therefore various communication protocols. To make interoperability actually happen, platforms need to be able to represent those different devices and their specifications.

So far, integrating devices means a considerable effort for platform developers. Vorto code generators address this issue by drastically reducing the time needed to represent new devices. Code generators can generate the source code needed for integration from a manufacturer’s devices description, often entirely, but at least partially. Platform developers may have to invest some time to implement code generators, but in the long run the effort will most likely pay off, especially with the growing variety of IoT devices in mind. Once implemented, code generators makes device integration much faster.

Standardization Organizations

Data models play an important role for standardization. Often word processing software is used to specify such models. Working with text documents means that making changes to the model later on is likely to produce errors. Errors result in more effort going into fixing what went wrong. Every additional conversion of a specification results in additional implementations – and more development effort. Eclipse Vorto provides the opportunity to reduce such cost factors.

Once a model has been specified in Eclipse Vorto, a review document can be generated and opened for discussion. Developers can comment the model and discuss changes using the Vorto repository. The results directly enter the Vorto model, and eventually, a review document can be generated. This process can be repeated as often as needed until the data model is approved. By then, implementation requires no more effort than pushing a button.

How to use Eclipse Vorto – Defining an Information Model for a Power Meter

The three scenarios described only represent some aspects of the advantages Eclipse Vorto has to offer for IoT development. This short tutorial illustrates the workflow for defining an information model. The scenario shows a possible workflow for device manufacturers who want to describe a specific device with a technology independent information model.

Step 1

1.1 Install the Vorto IDE for Device Manufacturers. The complete development environment including example projects is available as a Yatta Eclipse Profile.

1.2 After the installation is complete, go to the Vorto perspective. It shows some example projects, which have already been imported. The Vorto perspective also provides views for the different model artifacts, like data types, function blocks and information models.

The view “Information Models” contains an information model called “MyPowerMeter”
(Fig. 4). It describes the device for the power meter.

Fig. 4: Eclipse Vorto Perspective with views for different model artifacts.

Fig. 4: Eclipse Vorto Perspective with views for different model artifacts.

Step 2

Klick on “MyPowerMeter” to open the information model.

The information model editor opens (Fig. 5). The first lines contain basic information on the “MyPowerMeter” information model, for example version, display name, and a description. The following lines define the function blocks which are being used.

Fig. 5: Information model editor for “MyPowerMeter”.

Fig. 5: Information model editor for “MyPowerMeter”.

Step 3

Hold CTRL and click on “Voltage”. The function block editor opens (fig.6).

When you hover your mouse over “Voltage”, “Voltage” becomes underlined. You can jump to the corresponding model unit directly.

Similar to the information model, the first lines show basic information about the function blocks and the data types being used. Function blocks can also define operations available for the selected function block. In this example, you can run the operation “update()” for the function block “Voltage”.

Fig. 6: Function block editor for “Voltage”.

Fig. 6: Function block editor for “Voltage”.

Step 4

Hold CTRL and click “VoltageUnit” to jump to the corresponding data type (fig. 7).

The voltage unit is modelled with the available values “V” and “kV”.

Fig. 7: Data type editor for “VoltageUnit”.

Fig. 7: Data type editor for “VoltageUnit”.

Step 5

Experiment with the information model, its function blocks and data types.

If you want to activate the content assist function, press CTRL + SPACE. You will receive information on which input is possible at your current cursor position.

While you are editing, live validation makes sure that the model artifacts stay syntactically correct and machine readable.

Step 6

6.1 When you are happy with you changes, you can publish your information model in the Vorto repository.

6.2 Right-cick on the “MyPowerMeter” information model to open the context menu.

6.3 Select “Share” to publish your information model.

After publication, others can access your information model and provide their own solutions based on your model – for example a code generator for a specific platform.

If you’d like to learn more about code generators, have a look at the Vorto documentation for further assistance. 

To take a look at the example project from the tutorial, you can install the Yatta Eclipse Profile Vorto IDE for Solution Developers.

The future of the Internet of Things

With its flexible approach, Eclipse Vorto will simplify and accelerate the development of Iot applications and multi-vendor solutions. As a platform, Eclipse Vorto reduces development costs – with a high degree of interoperability, by harmonizing APIs in the field of device abstraction, as well as by supporting collaboration between IoT players.

Deploying the IoT toolset for different use cases is easy, thanks to Yatta Profiles, which is also a solution from the Eclipse ecosystem. In the future, device manufacturers, platform vendors and standardization organizations can use Eclipse Vorto’s approach to approach important challenges in IoT development.

Dr. Olaf Weinmann
Dr. Olaf Weinmann works at Bosch Software Innovations. In his role as project lead and senior expert he is responsible for the open source project Eclipse Vorto, which was initiated by Bosch Software Innovations in 2014. He studied mathematics and information technology at the University of Konstanz and holds a PhD in mathematics.
Dr. Andreas Scharf
Dr. Andreas Scharf is a software engineer at Yatta Solutions and serves as an expert for user interfaces for Profiles for Eclipse. Additionally, he is actively engaged in the Eclipse community as a committer. He studies information technology and received his PhD from the University of Kassel.

This article was originally published in German as: Produkte intelligenter vernetzen mit Eclipse Vorto. So werden Geräte wirklich smart. JavaSPEKTRUM, 04/2016, 8-12.

Read the original in German (PDF).