Skip to content
Stand with Ukraine flag

Step 3. Add a connector

By choosing the type of connector, you determine the specific method of connection you will use to ensure the interaction of your gateway with other systems or devices.

To see how the connector works, you can choose one of the following connectors:

Let’s add an MQTT connector, which will subscribe to some data topics using the demo broker with a built-in data generator and send data to the gateway.

As a demo MQTT broker, we will use a Docker image, that can be installed and run using the following command:

Terminal window
docker run -it -p 1884:1884 thingsboard/tb-gw-mqtt-broker:latest

After running docker image, you can see the following logs in your terminal:

To create a connector with the default configuration, follow these steps:

  1. Click on Connectors configuration button on the right panel.

  2. Click the + Add connector button.

  3. Choose MQTT connector type from the dropdown, fill in the Name field, set the Logging level to INFO, leave the Fill configuration with default values option enabled, and click the Add button.

  4. The connector is created with the default configuration.

  5. Let’s change default 127.0.0.1 host to host.docker.internal. Click on “Connection to broker” tab and change the host to host.docker.internal, and set the port to 1884. Click the “Save” button to apply changes.

Also, you can see the connector logs to make sure that the connector works, for this purpose, follow these steps:

  1. In the General connector tab enable remote logging by turning on the Enable remote logging toggle. Choose DEBUG in the Logging level drop-down menu. Click on the Save button to apply changes.

  2. Click on logs icon to open connector logs page.

  3. You can see the Logs table that consists of Created time, Level and Message columns.

For now, the gateway is ready to process data through the newly created and configured MQTT connector.