• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Wire IoT Up To IBM i With Node-RED

    July 6, 2020 Alex Woodie

    The Internet of Things (IoT) brings a new way to think about our digital world. From sensors on a manufacturing line to Twitter messages from the other side of the world, the IoT brings it all together. And with Node-RED, a low-code framework that is available on IBM i, wiring up these data flows into useful applications is surprisingly easy.

    Created by IBM, Node-RED is a Node.JS-based framework for developing event-driven data applications, or “flows,” that deliver a data payload in the form of the JavaScript Object Notation (JSON) data standard, from a source to a destination. Node-RED flows are assembled in a Web browser in a drag-and-drop manner using a variety of pre-built data inputs and outputs, or “nodes.” With a few more clicks, the apps are deployed into a Node.JS runtime, including on IBM i.

    The availability of a wide range of pre-built and open source nodes is part of what makes IoT application development so fast on Node-RED. Among the 2,200 nodes available are ones for specific hardware devices, such a Siemens programmable logic controller (PLC) or the Slack API. A node has been available for Db2 for i since 2017, enabling Node-RED developers to tap into the richness of SQL on the IBM i platform.

    There’s a wide range of possible applications that can be developed on Node-RED. A developer could string together input from a Twitter node, wire it up to an IBM Watson sentiment analysis algorithm, and then have an email automatically generated to inform her sales team when unhappy customers are ranting on social media. It can be used to help with password resets in a help desk setting; to populate dashboards with real-time information of energy generation; to warn a system administrator when DASD capacity on the IBM i server reaches 90 percent capacity; to give a trucking company CEO where his fleet is; or to stream video of unruly mobs converging in city streets to a precinct captain.

    One of Node-RED’s biggest fans on IBM i is (not surprisingly) is Jesse Gorzinski. IBM’s business architect for open source recently recorded a presentation on Node-RED for COMMON’s iNSIGHT virtual event, where he delved into the framework, discussed how it works, and provided examples of real-world Node-RED deployments, and explored some possibilities for others to try.

    “If you think about a lot of the software development that happens today, it’s really about connecting pieces, connecting things,” Gorzinksi said. “Maybe you want a Slack message connected to some sensor device. Maybe you want an API connected to the database. Maybe you want some social media post connected to some user action on a web form.”

    Node-RED provides a drag-and-drop development for creating lightweight Node.js applications that deliver JSON data flows across the IoT.

    It’s not that hard to build these sorts of applications, particularly in Node.JS, which is an increasingly rich developer ecosystem with many open source samples to choose from. According to Gorzinksi, there are more than 1 million Node.JS modules available in NPM, the Node.js Package Manager that is used to publish and install Node.JS code and applications.

    “But what we found was a lot of people are still spending time doing non-valued added activities,” he continued. “With Node-RED, it’s really easy to develop these things without worrying so much about the inertia and the implementation behind talking to all of these various things.”

    Node-RED’s biggest benefit is that it brings a simple low-code approach to developing IoT applications, Gorzinski says. However, it’s important to note that Node-RED is not a “no-code” environment. Users will be expected to exercise their JavaScript skills to create custom business logic for their Node-RED data flows.

    “You still are going to write some JavaScript code,” he said. “But you’re going to write a lot less than if you were to open a blank JavaScript file and start coding away.”

    Most of the development process for Node-RED involves dragging and dropping various nodes onto the palette, which defines the data flow. Developers have a range of node types to choose from. Those common types are input and output nodes, which define the beginning and end (or ends) of the data flows. Additionally, there are a host of other function nodes for other operations.

    Db2 for i is supported as a “node” within the Node-RED development environment, and supported as a runtime for deployed Node-RED applications.

    There are many pre-built nodes that developers can use available from the www.npmjs.com website, including custom nodes from industrial firms like Siemens and Hitachi and nodes that capture data from various applications. There are nodes for grabbing data off Raspberry Pi devices; for generating speedometers and other graphical elements for dashboards; for Amazon Alexa; and even for reading data from RFID chips.

    If a developer makes an error in configuring her nodes and flows, the Node-RED development environment will flash a red triangle to let her know something is not quite right. Developers can get documentation for a node by simplifying hovering her mouse of the node. Deployment is handled by the click of a button, and there are options for deploying only changed portions of a palette or the whole thing (as a single palette may contain multiple flows). Since all the data is stored as a big JSON document, exporting these flows is as simple as copying and pasting text into a JSON file.

    One of the cooler use cases for Node-RED shared by Gorzinski was configuring an AI chatbot to help with password resets. This application, which the IBM France team created in just two hours, utilized Watson’s natural language processing (NLP) capability to determine the concern that users presented in a Slack channel. “It’s able to ameliorate and fix a lot of common problems. That’s able to free up the human helpdesk workers to do more productive things,” he said.

    Node-RED may not be widely used on IBM i, but it’s starting to gain some traction. According to Gorzinski, the Db2 for IBM i node has been downloaded from the NPM over 7,000 times since it became available in 2017. Several vendors are beginning to use it in their applications, too.

    Open source has been a boon for productivity on IBM i, and provided IBM i developers with the abundance of creativity and capability that developers on other platforms are enjoying. With Node-RED, IBM i developers can take their creations to new heights by wiring them up to participate in the broad IoT ecosystem. That makes it worth checking out, according to Gorzinski.

    “When I was first introduced to Node-RED and this concept, I thought, well this seems really simple,” he said. “This does not seem too powerful to me. How much can you really do manipulating JSON and passing it down a flow?

    “But the answer is actually quite a lot, because all the work is actually done inside those nodes,” he continued. “And again, what Node-RED is allowing me to do as Node.js programmer is focus on the solution rather than focusing on wiring together the code to make all of this happen.”

    RELATED STORIES

    More Open Source Databases Coming To IBM i

    What’s New In Open Source With The Latest TRs

    Open Source Is the Future, So Where Does IBM i Fit In?

    PASE Versus ILE: Which Is Best For Open Source?

    RPM And Yum Are A Big Deal For IBM i. Here’s Why

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: API, DASD, DB2 for i, IBM i, Internet of Things, IoT, JavaScript, JavaScript Object Notation, JSON, natural language processing, NLP, Node-RED, Node.js, PLC, programmable logic controller, RFID

    Sponsored by
    Raz-Lee Security

    With COVID-19 wreaking havoc, cybercriminals are taking advantage of the global impact that it has had on our families, our businesses and our societies. It is more important now than ever to ensure that IT systems are protected, so that when all of this is behind us, we can get back to business as usual as quickly as possible.

    iSecurity Anti-Ransomware protects organizations against ransomware attacks and other kinds of malware that may access and change business-critical data on your IBM i. It even protects against zero-day attacks. Anti-Viruses can only report on the damage an attack has caused, but not stop it.

    iSecurity Anti-Ransomware has been recently enhanced with a Self-Test feature that allows you to simulate a ransomware attack on your IBM i. The simulated attack is limited to the test folder and cannot harm any other folders or files. This new feature lets organizations see how they are protected against known or unknown ransomware.

    Key Features:

    • Real-time scanning for known and unknown ransomware threats.
    • Blocks and disconnects the intruder.
    • Instantaneously sends alerts to SIEM as well as the offending computer.
    • Self-Test for attack simulation
    • Classification of the attack based on log.
    • Automatic updates with the most current ransomware definitions.

    Contact us at https://www.razlee.com/anti-ransomware

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    IBM i PTF Guide, Volume 22, Number 26 Guru: RDi V9.6, Part 9 – RDi Helps with Refactoring Code into Procedures

    Leave a Reply Cancel reply

TFH Volume: 30 Issue: 40

This Issue Sponsored By

  • Maxava
  • OCEAN TechCon20
  • WorksRight Software
  • Computer Keyes
  • Manta Technologies

Table of Contents

  • The Power S812 Gets Yet Another Stay Of Execution
  • Tapping The Sky For Disaster Recovery
  • Guru: RDi V9.6, Part 9 – RDi Helps with Refactoring Code into Procedures
  • Wire IoT Up To IBM i With Node-RED
  • IBM i PTF Guide, Volume 22, Number 26

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM Mulls Using DataMigrator as Cloud Warehouse Pipeline
  • PowerTech AV Automatically Detects Ransomware Activity
  • Infor Puts CM3 Project On Hold
  • Four Hundred Monitor, June 29
  • IBM i PTF Guide, Volume 24, Number 26
  • Guild Mortgage Takes The 20-Year Option For Modernization
  • IBM i Licensing, Part 3: Can The Hardware Bundle Be Cheaper Than A Smartphone?
  • Guru: The Finer Points of Exit Points
  • Big Blue Tweaks IBM i Pricing Ahead Of Subscription Model
  • We Still Want IBM i On The Impending Power E1050

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2022 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.