A new feature, Wires, was introduced with the Eclipse Kura v3.0.0 release. Wires is a Dataflow Programming model aimed to reduce the application development time by visually composing your application business logic through directed graphs. These directed graphs leverage reusable building blocks, known as Assets and Components, allowing developers to easily connect blocks together, creating a logical flow of data. The inspiration for Wires was born from the numerous complexities associated with Industrial IoT (Industry 4.0). By creating reusable Assets that frequently appear in Industry 4.0 applications, developers can quickly prototype solutions with Wires without the need of repetitive coding efforts.
Along with a reliable, easy to use framework on the device side, a complete Industry 4.0 solution also needs a solid back-end system to address the data integration and device management requirements. To this end, Eclipse Kapua, open source modular IoT cloud platform focused on managing and integrating devices and their data, was released earlier this year.
To highlight this complete end-to-end Industry 4.0 solution, Eurotech and Red Hat teamed up earlier this year to host a CodeStarter event based on a typical Industry 4.0 scenario. The below walkthrough explains all the pieces needed to reproduce the demo and try it yourself!
Smart Factory Scenario
The scenario is based on the Industry 4.0 use case of a smart factory: the machines on the plant floor physical systems are abstracted in a digital form and interoperate with other systems through open APIs.In addition, the decision-making is decentralized; it is moved closer to the edge and is automated through pre-defined rules. The ability to make decisions at the edge allows urgent problems to be solved in near real time, resulting in factory equipment & personnel safety and improved efficiency.
The simulated Industry 4.0 solution, we will use the following components:
- Raspberry Pi connected to sensors/actuators to emulate a machine on a factory floor.
- IoT Gateway (Raspberry Pi or similar) to provide intelligence on the edge.
- IoT Cloud Integration Platform (Eclipse Kapua) to manage gateways, devices, and their data.
- OpenShift Container Platform as the foundation where IoT services and business applications run (optional).
- The Raspberry Pi was connected to sensors and actuators, acting as an emulator of a real factory Programmable Logic Controller (PLC).
The Raspberry Pi simulating the machine in the factory acts as Programmable Logic Controller (PLC) with the following sensors connected:
- A water sensor
- A fan
- A temperature sensor
- A LED
- A buzzer
- A light sensor
More on Wires
Eclipse Kura Wires is a visual programming tool for creating data flow built on top of the usual Kura Java/OSGi stack. It eases application development by allowing the developer to express the application logic as a directed graph, without the need to interact with the underlying Java code and device complexities. In this way, the developer, interacting with simple nodes and connections, can easily prototype a solution working at a high level of abstraction and without sacrificing flexibility.
Wire Graph for Smart Factory
The following components of Wires were used for the demo:
- Drivers: Low-level components responsible for the communication with the sensors and actuators.
- Timer: Starts the flow by generating a message that triggers the downstream components.
- Assets: Allows interaction with the field devices through channels. A channel is a logical entity to specify what should be transferred to/from the driver. It makes the device available for on-demand read/writes via Java APIs or via the cloud through REST calls and MQTT.
- Publisher Receives a message and publishes its content to the cloud platform.
- DB Store Stores the received data in a DB table. Has rules for data cleanup and retention.
- DB Filter Uses a SQL query to filter DB stored messages.
- Logger Logs the received data in the Eclipse Kura log. Used for debugging purposes.
The above components were wired together into the following graph in order to periodically acquire data from the simulated machine through an OPC-UA Asset, store and analyze the data in a local DB instance, and finally publish the data to a remote cloud server via MQTT.
For a step by step guide on how to set this up yourself, please visit the following article:
https://developers.redhat.com/blog/2017/06/06/iot-hackathon-codestarter-red-hat-summit/
For more information about Wires, you can visit
Kura Wires: introduction and references.
Deploying Kapua
Eclipse Kapua can be deployed in numerous ways. Since Kapua is released as separate services running in Docker containers, it can be run on your local machine. Please refer to the
Kapua documentation for getting it up and running quickly with Docker. For a more robust, managed option, Eclipse Kapua is easily deployed using Red Hat OpenShift. Red Hat OpenShift Container Platform enables developers to rapidly create, modify, and deploy applications on demand.
See
this post for more information on running Kapua on OpenShift.
Walk Before You Run
If all the gateway and sensor talk felt like too much of a barrier to get started, dont worry, this entire demo can be done virtually! Since both Eclipse Kura and Eclipse Kapua can easily be run on your local development machine, all we need is a virtual OPC-UA server to mimic the above scenario. Luckily, just such a server exists in
this GitHub repo. The same GitHub repo also contains other useful information pertaining the physical hardware, if interested. Documentation on running Eclipse Kura on your local development machine can be found on the
Eclipse Kura documentation site.
Conclusion
This post was intended to get developers excited about developing their own smart factory,
Industry 4.0 solution. This has never been easier thanks to open source platforms
like Eclipse Kura and Eclipse Kapua. Lowering the barrier of entry to get started with such
complex systems is a great way to make Industry 4.0 a reality today!
References
https://developers.redhat.com/blog/2017/06/06/iot-hackathon-codestarter-red-hat-summit/
https://www.eclipse.org/kura/
https://www.eclipse.org/kapua/
https://esf.eurotech.com/
https://www.eurotech.com/en/products/devices/iot+gateways
https://www.eurotech.com/en/products/software+services/everyware+cloud+m2m+platform