Tsmatch Gateway

Overview

TSMatch (Thing to Service Matching) gateway is a software module that enables the automatic and dynamic matching between Things and IoT services or end-user requirements (the end-user requirements are provided through the TSMatch App).

The objective of the TSMatch solution is to ease integration between Things and IoT services via data matching based on service requirements.

TSMatch solution is used in Industrial IoT scenarios in the context of smart facilities, which includes but is not limited to shop floor, commercial buildings, and building offices.

Architecture

TSMatch Gateway Figure 1: TSMatch Gateway

The main components of the TSMatch are as follow:

  • TSMatch Gateway: is a software component that can assess if the request provided by the IoT service or the end-user is possible to deliver using data matching between descriptions of available Things and the request provided by the service or the nd-user.
  • TSMatch Application: is an Android application that provides an interface for users (end-users and IoT service) to specify their requirements.

Configuration

Configuration of TSMatch gateway includes:

  • Integration of IoT devices: IoT devices installed in the facility to monitor desired aspects are expected to be integrated with the TSMatch gateway by using semantic OGC Sensor Things API.
  • Integration with the message Bus: configuration of the TSMatch communication by spfifying the message bus URL, authentication, and topics/queues to be used.
  • User requirement description: TSMatch App is used to collect users requirements regarding aspects to be monitored as well as view matching results and updates/notifications.

Operation

Upon start-up, the TSMatch gateway first discovers Things available in the environments and stores their descriptions. Upon receiving an IoT service or end-user request containing a description of the requirements, TSMatch gateway selects the optimum set of Things capable of responding to the request. If the raw data of the selected set of Things does not directly match the requirements specified in the request, a micro-service that provide base functionalities such as clustering (i.e. clustering based on an area of interest), event triggering (i.e. triggering notification based on a specified threshold) is selected so that the raw data matches the specified requirements. The result of the matching is sent to the TSMatch app. Results of matching could be positive meaning that the requirements can be fulfilled or negative meaning that the currently available Things are unable to answer the user requirements. Finally, the user receives updates and notification about the monitored aspects through the TSMatch App.

Installation

TSMatch is open source and can be downloaded in installed on-premise. TSMatch gatewy uses on Coaty io. Please refers to the Coaty documentation for further details as well as the Coaty license agreement.

HelloWorld

The Hello World example includes the following components shown in Figure 2:

Example architecture Figure 2: Hello world example architecture

  • TSMatch Engine: responsible for the matching process. Environment variables must be set before running it. It can be done in “./TSMatch_Engine/.env” file. This file contains broker and database connection parameters. It can be run either as a docker container or as a standalone nodejs application. To run the application with one of the options, run one of the following code blocks:

TSMatch Engine

  • TSMatch API: responsible for interacting with the TSMatch App. It communicates with App over an MQTT broker (here 2 MQTT broker info can be set the local MQTT broker and an external MQTT broker which could be the message bus from EFPF data spine, to enable data sharing with the platform) and it requires the database connection. Broker and database connection variables as well as some predefined MQTT topics, are passed as an environment variable inside “./TSMatch_API/.env” file. It can be run either as a docker container or as a standalone nodejs application. To run the application, run one of the following code blocks:

TSMatch API

  • IoT Things: The node that collects the IoT data and publishes the observation as well as their description with TSMatch. Depending on the sensor used, the driver must installed to read the observations from the sensor. Broker connection info must be set as an environment variables inside “./thing/.env” file. Follow the commands below to run the IoT Thing.

IoT Things

  • Database and local MQTT broker: used to communicate between the various components and store description data and matching results. For the database, the Official Docker image of PostgeSQL4 is used. It is used to keep a list of active things, sensors, requests and sensors to things matching data. The database container requires a default database name and a username-password pair to initially create a database. This data is supplied as an environment variable in the “./database/.env” file. For the MQTT broker, Mosquitto implementation is used. It requires a username and a password to connect to the broker. A default user is created on initialization of the broker. The broker is implemented inside a docker Alpine image and the default username password is passed as an environment variable inside the “./broker/.env” file. Follow the commands below to run the database and the broker.

Local Message Bus

Local database

  • TSMatch App: used to interact with the rest of the system. It is capable of discovering active sensors, creating and deleting service requests and showing observation values on a line graph. It uses the MQTT broker connection which can be entered on the settings page.

TSMatch APP screenshot 1 Figure 3: Home and settings page

TSMatch APP screenshot 2 Figure 4: : Discover page that contains active sensor list

TSMatch APP screenshot 3 Figure 5: Creation, deletion and listing service requests on Describe page

TSMatch APP screenshot 4 Figure 6: Visualizing observation values as line graphs

FAQ

  1. How can I install TSMatch on-premise? TSMatch can be downloaded and installed locally. TSMatch uses Node package manager for building and running the application.

  2. Does TSMatch provide automatic discovery? Yes, TSMatch can discover IoT devices automatically.

  3. What communication is used in TSMatch? MQTT is used to communicate between TSMatch, the IoT devices, and the UI.

  4. What language is used in TSMatch? TSMatch is written in TypeScript

Previous