Adding Sensors to the IBM i using RPG
While I am currently under-employed due to the COVID Situation, I’ve decided to work on some personal projects and share them. Since this will mean I don’t have an employer’s infrastructure to work on, I’ll need to roll my own. Here’s how I’m going about it.
For my first project, I’m going to interface some sensors to an IBM i.
In my previous life, we had a need to upgrade some old factory-floor equipment to capture some physical measurements (temperature, humidity, pressures, operation cycle counts). New machines with data capture were available but the cost to replace all of the existing machines was prohibitive.
To accomplish this, I used a dandy little controller called an Arduino. The Arduino is really a family of small, inexpensive computers that can be connected to sensors and controls and be used to do all kinds of interesting things.
There are various “flavors” of Arduino. Two of my favorites are the basic ESP-32 and this one with an OLED Screen. These both have WiFi capability and can act as a web server or a web client.
In this project, I will use them as clients to talk to a RESTful API on the IBM i.
The APIs will be written in RPG, using the CGIDEV2 libraries.
For the initial project there will be…
- An Arduino or two with temperature and humidity sensors.
- A DB2 database containing configuration information to be sent to and a place to log data received from the Arduinos.
- An IBMÂ i web service to connect the database to the sensors.
I’ll post some details as I finish up some of the components, along with links to tutorials and other useful things.!
Awesome ! Looking forward to seeing how this progresses !