Table of Content
Thingsboard, a leading open-source IoT platform, enables rapid development, management, and scaling of IoT projects. It is highly scalable, fault-tolerant, robust, efficient, customizable, and durable IoT platform. Thingsboard provided default pre-configured live demo instance for quick testing. Thingsboard IoT gateway integrates devices connected to third-party and legacy systems. In this blog, let us discuss about installing and setting up Thingsboard IoT gateway on Windows and performing testing with Thingsboard live demo instance.
- Install Java: https://www.java.com/en/download/help/download_options.xml
- Download TB Gateway: https://github.com/thingsboard/thingsboard-gateway/releases/download/v1.2.1/tb-gateway-windows-1.2.1.zip
- Thingsboard Live Demo: https://demo.thingsboard.io/signup
- Thingsboard Local Installation: Version 1.1 or greater is required
Note: To know more about installing Thingsboard locally, refer our previous blog on Thingsboard Installation on Windows.
Installing Java 8
Install Java 8 on Windows machine. If already installed, check the version of Java by using the below command:
Installing TB Gateway
To install TB Gateway, perform the following:
- Double-click on the downloaded tb-gateway configuration file that is a pre-archived file. You can view a list of files in the tb-gateway folder as shown in the below diagram:
- Click Windows Start button.
- Search cmd and press “Ctrl + Shift + Enter” keys to open Administrator command prompt.
- Go to tb-gateway folder directory and enter the below command to install TB Gateway: C:\tb-gateway>install.bat
Provisioning IoT Gateway
In this section, let us discuss about provisioning the Gateway by using Live Demo instance. To connect IoT Gateway to Thingsboard server, gateway credentials are required. Let us consider access token credentials for simple and better understanding. To provision the gateway, perform the following:
- Create a tenant administrator account.
- Log in to Thingsboard.
- On the left pane, click Device option as shown in the below diagram:
- Name the device.
- Enable “Is gateway” option as shown in the below diagram:
- On successfully creating the device, open the device card.
- Click “COPY ACCESS TOKEN” button to copy your access token as it is needed during configuration process.
Configuring IoT Gateway
To configure IoT gateway, perform the following steps:
- Open tb-gateway configuration folder as shown in the below diagram:
- Open tb-gateway.yml file.
- Change gateway.connection.host property to Thingsboard host (Use “demo.thingsboard.io” as live demo instance is used).
- Change gateway. security. accessToken property to newly created device token that was copied during IoT gateway provisioning. The tb-gateway.yml file configuration setup looks similar to the below diagram:
- On completing edit, save the file and close it.
Launching IoT Gateway
To launch IoT Gateway, perform the following:
- Open the administrator command prompt.
- Execute the below command to start the tb-gateway process:
net start tb-gateway
Stop – net stop tb-gateway
Start – net start tb-gateway
IoT Gateway Statistics
To view the IoT gateway statistics, perform the following:
- On successfully starting the tb-gateway, go to open your device.
- Click “LATEST TELEMETRY“.
- Check “devicesOnline, attributesUploaded, and telemetryUploaded” Keys.
- Ensure that values of all the keys are 0 as shown in the below diagram to confirm successful connection of IoT gateway with Thingsboard server.
In this blog, we discussed about installing and configuring Thingsboard IoT gateway with proper commands. In our next blog, let us discuss about connecting IoT gateway extension with external communication protocol broker, and mapping JSON with custom protocol message mappers and so on.
Getting Started Thingsboard: https://thingsboard.io/docs/getting-started-guides/helloworld