Getting Started ThingsBoard With reComputer R1000
Introduction
ThingsBoard is an open-source IoT platform designed for rapid development, management, and scaling of IoT projects. It offers an out-of-the-box solution for both cloud and on-premises IoT infrastructure, enabling you to provision devices, manage assets, collect and visualize data, and analyze telemetry with ease. In this guide, we will walk through the installation of ThingsBoard Community Edition on a reComputer, providing a robust foundation for your IoT applications.
Prerequisites
Hardware
reComputer R1000 |
---|
Hardware requirements depend on the chosen database and the number of devices connected to the system. To run ThingsBoard with PostgreSQL, you will need at least 4GB of RAM.
Step 1: Install Java 17 (OpenJDK)
ThingsBoard requires Java 17 to run.Open Terminal.
- Update your package index:
sudo apt update
- Install OpenJDK 17:
sudo apt install openjdk-17-jdk
- Configure your system to use OpenJDK 17 by default:
sudo update-alternatives --config java
- Verify the installation:
java -version
Step 2: Install ThingsBoard Service
- Download the ThingsBoard
.deb
package:wget https://github.com/thingsboard/thingsboard/releases/download/v3.8/thingsboard-3.8.deb
- Install ThingsBoard as a service:
sudo dpkg -i thingsboard-3.8.deb
Step 3: Install PostgreSQL Database
Install wget if not already installed:
sudo apt install -y wget
Add the PostgreSQL repository and install the service:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
echo "deb https://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
sudo apt update
sudo apt -y install postgresql
sudo service postgresql startSet the password for the
postgres
user:sudo -u postgres psql
\passwordCreate the ThingsBoard database:
psql -U postgres -d postgres -h 127.0.0.1 -W
CREATE DATABASE thingsboard;
Step 4: Configure ThingsBoard
Open the ThingsBoard configuration file:
sudo nano /etc/thingsboard/conf/thingsboard.conf
Add the following database configuration (replace
PUT_YOUR_POSTGRESQL_PASSWORD_HERE
with the password set for thepostgres
user):# DB Configuration
export DATABASE_TS_TYPE=sql
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/thingsboard
export SPRING_DATASOURCE_USERNAME=postgres
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE
export SQL_POSTGRES_TS_KV_PARTITIONING=MONTHS(Optional) Update memory settings for machines with 4GB of RAM:
export JAVA_OPTS="$JAVA_OPTS -Xms2G -Xmx2G"
Step 5: Run Installation Script
Execute the ThingsBoard installation script:
sudo /usr/share/thingsboard/bin/install/install.sh --loadDemo
The
--loadDemo
option will load demo data such as users, devices, assets, and more.
Step 6: Start ThingsBoard Service
Start the ThingsBoard service:
sudo service thingsboard start
Once started, you can access the ThingsBoard Web UI using the following link:
Default Credentials:
- System Administrator: [email protected] / sysadmin
- Tenant Administrator: [email protected] / tenant
- Customer User: [email protected] / customer
Troubleshooting
If you encounter any issues, check the ThingsBoard logs for errors:
cat /var/log/thingsboard/thingsboard.log | grep ERROR
For additional log files:
/var/log/thingsboard
Tech Support & Product Discussion
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.