Manage SensorTag on Maximo

Size: px
Start display at page:

Download "Manage SensorTag on Maximo"

Transcription

1 Table of Contents Manage SensorTag on Maximo Overview Ingredients Steps Maximo setup Set up a SensorTag asset on Maximo Set up a device Gateway Connect your device gateway to Maximo Check sensor updates on Maximo Conclusion

2 June 3, 2018 Manage SensorTag on Maximo Connect devices to Maximo Asset Management through gateways using the IBM Watson IoT platform, Raspberry Pi, Node-RED and Maximo REST APIs By Hari Narasimhamurthy, Senior IT Architect and Offering Manager, IBM Watson Internet of Things Keywords: Maximo, MaximoDev, Watson IoT, Node-RED, REST API 1. Overview Skill level: Advanced Texas Instruments (TI) SensorTag CC2650 is a low-power, Bluetooth-enabled smart sensor containing various sensors suitable for Internet of Things (IoT) applications. IBM Maximo Asset Management is an enterprise asset management system that can monitor and manage the full lifecycle of enterprise assets, including facilities, communications, transportation, production and infrastructure. By modeling TI SensorTag as a device that is managed by Maximo Asset Management, we show a recipe for connecting devices to the Maximo application through device gateways using the IBM Watson IoT Platform, Raspberry Pi, Node-RED and Maximo Representational State Transfer (REST) APIs. 2. Ingredients The software and hardware ingredients include: 1. IBM Maximo Asset Management 2. Texas Instruments (TI) Sensor Tag CC Raspberry Pi 4. Node-RED This document is intended for audiences who have a working instance of Maximo Asset Management System available to them. Maximo Asset Management for internal development is available for Docker container through IBM Cloud Registry. To set up a Maximo development instance internal to IBM on Docker containers, contact us. 3. Steps This section presents instructions to connect TI Sensor Tag CC2650 to Maximo Asset Management via a IoT device gateway using Maximo REST APIs, and transfer various sensor data. Maximo has the feature of asset meters, which represent parameters of assets and maintains parameter values. The asset meters are used to define the various sensors. Finally, a Raspberry Pi device is used in this 1

3 recipe as a device gateway that interacts with Sensor Tag via Bluetooth libraries and Node-RED. Finally, Maximo Node-RED OSLC API modules are used to transfer the sensor values to Maximo as asset meter values using OSLC APIs Maximo setup Start your Maximo instance and log in as an administrator Set up a SensorTag asset on Maximo Create an asset on Maximo called SensorTag. a. Create a SensorTag asset on Maximo: i. From the Maximo home screen, select Assets - Assets. ii. Select New Assets from the Common actions menu on the left. iii. Enter Asset Number (CC2650) and description. Save by selecting the Save icon on the top menu. b. Create asset meters for SensorTag asset: i. From the Maximo home screen, select Assets - Meters, then verify that the following meters exist, or create them. A. Meter name: Temperature, Meter type: Continuous B. Meter name: Pressure, Meter type: Gauge C. Meter name: Luxometer, Meter type: Gauge D. Meter name: Humidity, Meter type: Continuous ii. To create them, select New Meter from the Common actions menu on the left. iii. Add these meters and save by selecting the Save icon on the top menu. a. Attach meters to the SensorTag asset: i. From the Asset screen, select the Meters tab and select New Row. ii. Enter a sequence number starting with 1 and enter the four meters created in the previous step one at a time by saving each one and selecting New Row. 2

4 3.2. Set up a device Gateway IoT gateways are peripheral devices that collect sensor information from various devices, perform basic rules and filtering, and collectively load data into the IoT platform or storage. In this case, we use Raspberry Pi 3 as an IoT gateway and TI SensorTag as a device sensor. a. Prepare Raspberry Pi 3: i. Verify Node-RED is installed by running node-red start on a command prompt. If Node- RED isn t installed, install the latest version. ii. Install Bluetooth libraries on the Raspberry Pi. A. $ sudo apt-get install libbluetooth-dev libudev-dev pi-bluetooth B. $ sudo setcap cap_net_raw+eip $(eval readlink -f which node) iii. Install SensorTag node by running these commands on a command prompt. Change directory to ~/.node-red and run these commands: A. $ node-red stop B. $ npm i node-red-node-sensortag iv. Install Maximo nodes by running these commands on a command prompt. Change directory to ~/.node-red and run these commands: A. $ npm I node-red-contrib-ibm-maximo-oslc-api b. Install Maximo Node-RED flow: The Maximo Node-RED flow is designed to read multiple sensor values from the TI SensorTag and create work orders in Maximo when the sensor values cross their respective configured threshold. The threshold values are configurable on the respective trigger nodes. This sample flow is available at i. Download the SensorTag-sampleFlow from the IBM Maximo GitHub project. A. Download or clone the IBM Maximo GitHub project. B. Add the Node-RED SensorTag Maximo flow from the downloaded project into the local Node-RED. ii. Open the contents of the file SensorTag-sampleFlow in a plain text editor, such as Notepad or TextEdit. Copy all the contents of this file to the clipboard (Ctrl-C or Command-C). 3

5 iii. On Node-RED, open a new tab by selecting the + icon. Paste the content of the clipboard into this tab (Ctrl-V or Command-V). iv. Select Deploy to save the flow. a. Configure Maximo Node-RED flow: v. Configure the SensorTag node for your environment: A. Identify the Bluetooth identifier for your SensorTag. B. Edit SensorTag Node-RED node and enter the Bluetooth identifier in the UUID field. C. Select the required sensors, Temperature, Pressure, Gyroscope, and Luminosity at a minimum. D. Enter a name for the Topic (SensorTag). a. Display the TI SensorTag dashboard: vi. Connect the TI SensorTag to the device gateway by pressing the power button. Observe the SensorTag node display connection status. vii. Change sensor values by moving, tossing and covering. viii. On a separate browser tab, open the dashboard by accessing <localhost:1880>/ui and selecting SensorTag tab. Notice changed sensor values on the dashboard Connect your device gateway to Maximo a. Configure a Maximo node for your environment: i. Gather Maximo connection information (URL, user name and password) for your environment. ii. Edit Maximo node - Maximo Connection by selecting the pencil icon. iii. Enter a valid URL, admin user name and password for your Maximo instance. i. Deploy the changes by clicking the Deploy button on the top right. a. Configure the trigger rules for each sensor: ii. Edit Humidity Trigger node and change the rotation value. iii. Edit Pressure Trigger node and change the pressure limit. 4

6 iv. Edit Temperature Trigger node and change the temperature value. v. Edit Luxometer Trigger node and change the light value. vi. Deploy the changes by clicking the Deploy button on the upper right. a. Verify the status of the sensors and triggers on the dashboard: Sensors and triggers values and status can be viewed on the Node-RED dashboard. vii. View Node-RED dashboard and notice the sensor values. To access the Node-RED dashboard, replace the section of the Node-RED url after the port number with /ui Check sensor updates on Maximo a. Log in to Maximo. i. Select Assets - Assets on the left menu. ii. In the Asset field, type your asset name (CC2650) and press Enter to search. iii. Select CC2650 device, select Meters tab, select the corresponding meters and verify that the last reading has been changed. The sensor values are updated every second, So, in order to accurate picture, you may need to stop the Sensor Tag to send updates, and then match the last reading. 5

7 4. Conclusion This recipe showed you how to do a simple integration of a sensor to Maximo Asset Management directly through a device gateway. This pattern can be replicated or enhanced for your collection of devices, complicated devices consisting of many sensors and, in some instances, a section of a factory floor. The data collected from these devices can be used to predict outages, suggest preemptive maintenance and provide alternate options. 6