PowerWire.eu

Independent IBM i, AIX and Linux news and tech tips for Europe and beyond

  • Home
  • News
  • Technical Articles
    • IBM i
    • AIX
    • Linux
    • VIOS
  • Subscribe
  • About Us
  • Contact Us
  • Advertise with PowerWire.eu

Node-red on i – 5733OPS not required

August 6, 2019 by David Shears Leave a Comment

Inspired by Andy Youens series of articles on Node and Open Source on IBMi,  I decided to try setting up Node-red on one of my servers. I’ve also got to give credit to a post on the IBM developer site: https://developer.ibm.com/tutorials/i-running-node-red/

The main difference is that where the walk-through uses licensed program 5733OPS I decided to jump in the deep end and try to do without it, ACS has set me up with node.js and the general open source environment so how hard could this be?

One of the main differences to get used to is the folder locations, where the guide points you to:
/QOpenSys/QIBM/ProdData/OPS/NodeX/bin

You’ll now end up in (for example):
/QOpenSys/pkgs/lib/NodeX/bin

When you get to using bcrypt to create a hashed password you’ll also want to point at the alternate location as well.

Another little trick, maybe one that makes perfect sense to those of you more used to IBM i SSH environments, is to make sure you have your path set correctly. Credit to Profound for this tip:

PATH=/QOpenSys/pkgs/bin:$PATH

export PATH

Makes it a lot easier to run the npm command to install node-red, also handy in the script that I’ve taken from the developer article to handle the batch submission of the node-red instance starting:

#!/usr/bin/sh
PATH=/QOpenSys/pkgs/bin:$PATH
export PATH
cd /QOpenSys/pkgs/lib/nodejs10/bin
node-red                         

Not sure I care to admit quite how long I spent banging my head against the wall before I found that article, I was trying to download new nodes and update them and getting nowhere fast.

Once I had this installed and setup I figured I’ll double down on learning new tricks and make use of the IBM Cloud Translator, I have a French customer and je ne comprends pas Francais 🙂

To do this I’ve taken advantage of the node-red-node-watson package that you can download through the “Manage Palette” option:

 

I’ve setup two different flows, one purely for translating their emails to me and another for translating my response back. Just to try and be clever I’m also translating IBMs translation back into English to see if my text still means the same, with mixed results occasionally. In this example my input text is “The order is now unlocked”:

Using these nodes is also really handy for a first-timer like me, in that all of the detailed stuff is in the background and you can just plug & play:

So there you have it, using the knowledge already out there and tweaking it a little to my use-case you have a new convert to node.js on the platform. Sure experts in the field can correct me / point out much simpler ways I could’ve done this, but I figure failing is part of the learning experience!

Filed Under: IBM i, Technical Articles Tagged With: IBM i, IBM Power Systems

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Free monthly newsletter signup

News

A screen a story – Not our problem anymore

Last week I ran into an issue, which did teach me something new about the command WRKPRB. After checking a … [Read More...]

Raspberry Pi and Machine Learning

In my last article, I demonstrated how I used Machine Learning on the Raspberry Pi to determine if a … [Read More...]

Shield Advanced Solutions – new Messaging and Monitoring solutions

September 2022 – Toronto As Shield Advanced Solutions celebrates the significant milestone, 25 years of … [Read More...]

More articles from this section

Quick Links

  • Advertise
  • Subscribe

Follow Us…

  • Email
  • LinkedIn
  • Twitter

Search This Website

Copyright © 2023 · Cue Communications · All Rights Reserved

Log in