Home Applications IoT Sample

IoT Sample

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
5
1 reviews
0
Awards
214
Views
2
IPM installs
2
1
Details
Releases
Reviews
Issues
Pull requests
Articles
Sample how to use MQTT with InterSystems IRIS MQTT Interoperability adapter

What's new in this version

Initial Release

Gitter
Quality Gate Status
Reliability Rating

iris-iot-sample

This is a sample of InterSystems IRIS Interoperability solution for IoT using MQTT.
It consume a MQTT message and send other MQTT message as response.

Installation: ZPM

  1. Open IRIS Namespace with Interoperability Enabled.
  2. Open Terminal and call:
USER>zpm "install iris-iot-sample"

Installation: Docker

  1. Clone/git pull the repo into any local directory
$ git clone https://github.com/yurimarx/iris-iot-sample.git
  1. Open the terminal in this directory and run:
$ docker-compose build
  1. Run the IRIS container with your project:
$ docker-compose up -d

How to Run the Sample

  1. Open the production and start it.
    It will start observing the MQTT topic /DeviceStatusInputTopic and it will produce responses to MQTT topic /DeviceStatusOutputTopic. See:
Production
  1. Use a MQTT client to send a message and test the production. For this, into your Google Chrome browser access https://chrome.google.com/webstore/detail/mqttbox/kaajoficamnjijhkeomgfljpicifbkaf. It is the Chrome Plugin MQTTBox. Click Add to Chrome and after Add App.
MQTTBox
  1. In your Google Chrome browser access chrome://apps/ and select MQTTBox (if required, click Open Anyway).
Open MQTTBox
  1. Click Create MQTT Client button.
Click Create Client
  1. Configure the MQTT connection with these settings:
  • Client name: Local
  • Protocol: mqtt / tcp
  • Host: localhost:1883
  • Username: admin
  • Password: admin
  • All other settings are the default values
MQTTBox Settings
  1. Configure the MQTT topics to send and receive MQTT messages:
  • Topic to publish: /DeviceStatusInputTopic
  • Topic to subscribe: /DeviceStatusOutputTopic
  • Payload:
{
"deviceId":"Air Conditioner Level 1",
"statusDate":"2023-01-07 14:03:00",
"status": 0
}
MQTTBox Topics Config
  1. Click the button Subscribe to listen messages on the topic /DeviceStatusOutputTopic. Now the UI changes to wait for messages on this topic.
MQTTBox Wait messages
  1. Click the button Publish to send a message to /DeviceStatusInputTopic and see the results produced by IRIS production on /DeviceStatusOutputTopic
MQTTBox Topic results
  1. See the message processing session on IRIS Management Portal Visual Trace
Production Visual Trace
Made with
Install
zpm install iris-iot-sample download archive
Version
1.0.010 Jan, 2023
ObjectScript quality test
Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for HealthHealthShare
First published
10 Jan, 2023
Last checked by moderator
27 Jun, 2023Works