This guide describes how to install ThingsBoard IoT Gateway on a Raspberry Pi 3 running Raspbian Jessie.
IoT Gateway service is running on Java 8. Oracle Java 8 is already pre-installed on Raspbian. You can check java version using the following command
$ java -version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)
Any Java version higher than or equal to 1.8 is fine.
Download installation package or build it from source.
# Download the package $ wget https://github.com/thingsboard/thingsboard-gateway/releases/download/v184.108.40.206/tb-gateway-1.4.0.deb
# Install gateway as a service $ sudo dpkg -i tb-gateway-1.2.1.deb # Update gateway memory usage and restrict it to 150MB in /etc/tb-gateway/conf/tb-gateway.conf export JAVA_OPTS="$JAVA_OPTS -Dplatform=rpi -Xms150M -Xmx150M"
Congratulations! ThingsBoard IoT Gateway is now installed on your Raspberry as a service.
Let’s configure your gateway before we start it!
Let’s skip extension configuration for now. We need to validate that gateway is able to successfully connect to ThingsBoard server first.
Now let’s start the gateway! Execute the following command to start gateway:
sudo service tb-gateway start
In order to restart the gateway you can execute following commands
sudo service tb-gateway restart
The log files are located in /var/log/tb-gateway folder.
The tb-gateway.log file should contain following line:
YYYY-MM-DD HH:mm:ss,sss [main] INFO o.t.gateway.GatewayApplication - Started GatewayApplication in x.xxx seconds (JVM running for x.xxx)
You can issue the following command in order to check if there are any errors on the backend side:
cat /var/log/tb-gateway/tb-gateway.log | grep ERROR