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.
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 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.
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.
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.
The Hello World example includes the following components shown in Figure 2:
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 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:
- 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.
- 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.
- 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.
Figure 3: Home and settings page
Figure 4: : Discover page that contains active sensor list
Figure 5: Creation, deletion and listing service requests on Describe page
Figure 6: Visualizing observation values as line graphs
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.
Does TSMatch provide automatic discovery? Yes, TSMatch can discover IoT devices automatically.
What communication is used in TSMatch? MQTT is used to communicate between TSMatch, the IoT devices, and the UI.
What language is used in TSMatch? TSMatch is written in TypeScript