Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

IoT Hackathon - CodeStarter @ Red Hat Summit

June 6, 2017
Ishu Verma
Related topics:
Kubernetes
Related products:
Streams for Apache KafkaRed Hat FuseRed Hat OpenShift Container Platform

Share:

    At the Red Hat Summit in Boston earlier this month, one IoT event stood out from the rest - a CodeStarter hackathon that brought together 80+ IoT enthusiasts to learn, tinker, and build an end-to-end IoT solution. The result was a complete IoT application that seamlessly integrates across IT and OT (Operations Technologies).

     

     

    Smart Factory

    The CodeStarter was based on the Industry 4.0 use case of a smart factory:  the physical systems are abstracted in a digital form and interoperate with other systems through open APIs. In addition, the decision-making is decentralized, i.e. moves 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 CodeStarter setup included the following components:

    • Raspberry Pi connected to sensors/actuators to emulate the factory environment.
    • IoT Gateway (Eurotech ReliaGATE 20-26) 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.

    The Raspberry Pi was connected to sensors and actuators, acting as an emulator of a real factory Programmable Logic Controller (PLC).

    For the CodeStarter, the Raspberry Pi was connected to:

    • A water sensor
    • A fan
    • A temperature sensor
    • A LED
    • A buzzer
    • A light sensor

    The intelligence on the edge was provided by the Eurotech ReliaGATE 20-26, a powerful IoT gateway that was running the recently announced Eclipse Kura 3.0, the edge computing platform for IoT, that introduces many new features for the edge computing, like Eclipse Kura Wires, an implementation of visual programming that can be used to simplify the development of solutions on the edge.

    Furthermore, Kura 3.0 introduces a set of changes to simplify the management and the connection to multiple cloud services, including the open source IoT cloud platform Eclipse Kapua.

    Finally, the latest version of Kura introduces a completely new set of APIs to ease the interaction with sensors, actuators and PLCs over fieldbus protocols (e.g. OPC-UA).

    CodeStarter Challenge

    After an initial introduction of the new features and a description of the scenario, the CodeStarter participants were invited to:

    1. Experiment with the complete solution using real IoT hardware.
    2. Try to replicate the completed solution in a virtual environment.
    3. Combine modern app development with IoT.

    Getting to Know Eclipse Kura 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.

    The following components of Kura Wires were used for the CodeStarter:

    Timer: Starts the flow by generating a message that triggers the downstream components.

    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.

    In addition, Kura Wires used the following components of Kura:

    • Drivers: Low-level components responsible for the communication with the sensors and actuators.
    • Assets: Allows interaction with the 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.

    For more information about Kura Wires, you can visit Kura Wires: introduction and references.

    Demo with IoT Hardware

    During the first phase, the participants could experiment with real IoT hardware and see how a Kura Wires graph could control, via OPC-UA, the sensors, and actuators connected to the Raspberry Pi that was acting as an industrial PLC.

    The Kura Wires graph could trigger the fan, light or buzzer per the following conditions:

    • Turn on Fan if temperature >25 C and no water leak detected.
    • Turn on Buzzer in the case of a water leak detection.
    • Turn on LED if light < 200 lux.

    Hackers at Work on a Virtual Environment

    A Virtual Box-based VM image provided all the components needed to build the data flow. To configure and test the setup in the virtual environment, the participants had to:

    1. Start the Eclipse IDE and run the Kura Emulator. A proper Kura application was deployed and started to simulate the sensor data and act as an OPC-UA endpoint.
    2. Configure the Kura cloud service to connect to the Kapua broker.
    3. Configure the Kura driver and Asset to point to the simulated OPC-UA device.
    4. Use Kura Wires to control the actuators and publish the fetched data to the Kapua cloud service.

    The participants implemented the same rules they experienced with real IoT hardware. They had, also, the possibility to earn bonus points by modifying their graphs and adding the following:

    • Store data and publish 1-minute averages.
    • Stop Fan if the light is low.
    • Turn on Buzzer and LED if a water leak is detected.

    Combining Modern App Dev with IoT

    Red Hat OpenShift Container Platform enables developers to rapidly create, modify, and deploy applications on demand. At the CodeStarter, sample apps (Java and JavaScript) were provided to access and display sensor data using IoT services provided by Kapua (running on OpenShift as well). These apps can also trigger the actuators via the Kura API.

    Developers configured, built, and deployed the sample app on OpenShift through the step by step exercise:

    1. Login to OpenShift CLI.
    2. Download sample app code.
    3. Configure the app.
    4. Build and run the app locally.
    5. Deploy the app to OpenShift.
    6. Access the app in the browser.
    7. Edit the app.
    8. Display data visually.

    Developing containerized applications allows developers to write an IoT application once that could be deployed anywhere: from cloud to edge. As containers consist of infrastructure and application components, it allows multiple teams to collaborate on container creation. These containerized applications can be continually integrated and deployed, bringing the benefits of modern app dev practices to IoT.

    Taking the CodeStarter Hackathon Home

    As with any good open source project, all the code and documentation is available on github for anyone to recreate the CodeStarter experience. In order to run the CodeStarter, all you’ll need to do is provision an instance of Kapua cloud service. Setting up Kapua on the OpenShift container platform is fairly straightforward (thanks to Henryk’s instructions).

    Also, at the CodeStarter event, the commercially supported IoT Gateway (Eurotech ReliaGATE 20-26) was used to connect with edge devices but is not a mandatory requirement for the tutorial. Eurotech offers a family of IoT gateways for your IoT projects.

    For businesses looking for commercially supported offerings of the community projects being used at the CodeStarter here is the project-to-product mapping:

    Upstream Project Commercial Product
    CentOS Red Hat Enterprise Linux
    Apache ActiveMQ Red Hat JBoss AMQ
    Apache Camel Red Hat JBoss Fuse
    Eclipse Kura EUROTECH Everyware Software Framework (ESF)
    Eclipse Kapua EUROTECH Everyware Cloud
    OpenShift Origin Red Hat OpenShift Container Platform

    Conclusion

    At the CodeStarter event at Red Hat Summit, participants built an end-to-end IoT solution leveraging the latest IT and OT (Operations Technologies). Based on the Industry 4.0 use case of a smart factory, the CodeStarter setup included Eurotech ReliaGATE 20-26, a powerful IoT gateway running the Eclipse Kura 3.0, the edge computing platform for IoT. Kura provided interaction with sensors, actuators and PLCs over fieldbus protocols (e.g. OPC-UA).

    The participants were able to experiment with the complete solution using real IoT hardware, replicate the completed solution in a virtual environment and finally, use modern app development practices using OpenShift Container Platform.

    For those interested in recreating the CodeStarter experience, all the code and documentation is available on github.

    Though many people were involved, special thanks go to Benjamin Cabé  (Eclipse Foundation) and David Woodard, Matteo Maiero, Marco Carrer (Eurotech) and James Falkner, Chris Custine, David Bericat (Red Hat) for conceptualizing and putting together the event.

    I'd like to thank Matteo Maiero, Software Engineer, Eurotech who helped me with this post.


    Take advantage of your Red Hat Developers membership and download RHEL today at no cost.

    Last updated: February 23, 2024

    Recent Posts

    • How to run a fraud detection AI model on RHEL CVMs

    • How we use software provenance at Red Hat

    • Alternatives to creating bootc images from scratch

    • How to update OpenStack Services on OpenShift

    • How to integrate vLLM inference into your macOS and iOS apps

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue