6931 changed files with 194612 additions and 65758 deletions
@ -0,0 +1,54 @@ |
|||
# |
|||
# Copyright © 2016-2024 The Thingsboard Authors |
|||
# |
|||
# Licensed under the Apache License, Version 2.0 (the "License"); |
|||
# you may not use this file except in compliance with the License. |
|||
# You may obtain a copy of the License at |
|||
# |
|||
# http://www.apache.org/licenses/LICENSE-2.0 |
|||
# |
|||
# Unless required by applicable law or agreed to in writing, software |
|||
# distributed under the License is distributed on an "AS IS" BASIS, |
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
# See the License for the specific language governing permissions and |
|||
# limitations under the License. |
|||
# |
|||
|
|||
name: License header format |
|||
|
|||
on: |
|||
push: |
|||
branches: |
|||
- 'master' |
|||
- 'develop/3*' |
|||
- 'hotfix/3*' |
|||
|
|||
jobs: |
|||
license-format: |
|||
runs-on: ubuntu-latest |
|||
|
|||
steps: |
|||
- name: Checkout Repository |
|||
uses: actions/checkout@v4 |
|||
|
|||
- name: Set up JDK |
|||
uses: actions/setup-java@v4 |
|||
with: |
|||
distribution: 'corretto' # https://github.com/actions/setup-java?tab=readme-ov-file#supported-distributions |
|||
java-version: '21' |
|||
cache: 'maven' # https://github.com/actions/setup-java?tab=readme-ov-file#caching-sbt-dependencies |
|||
|
|||
- name: License header format |
|||
run: mvn -T 1C license:format |
|||
|
|||
- name: License header format (msa/black-box-tests/) |
|||
run: mvn -T 1C license:format -f msa/black-box-tests/ |
|||
|
|||
- name: Set Git user information |
|||
run: | |
|||
git config user.name "ThingsBoard Bot" |
|||
git config user.email "noreply@thingsboard.io" |
|||
|
|||
- name: Check and push changes |
|||
run: | |
|||
git diff --exit-code || git commit -am "License header format" && git push |
|||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,231 +0,0 @@ |
|||
Here is the list of commands, that can be used to quickly install ThingsBoard Edge on RHEL/CentOS 7/8 and connect to the cloud. |
|||
|
|||
#### Prerequisites |
|||
Before continue to installation execute the following commands in order to install necessary tools: |
|||
|
|||
```bash |
|||
sudo yum install -y nano wget |
|||
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
|||
``` |
|||
|
|||
#### Install Java 11 (OpenJDK) |
|||
ThingsBoard service is running on Java 11. Follow these instructions to install OpenJDK 11: |
|||
|
|||
```bash |
|||
sudo yum install java-11-openjdk |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Please don't forget to configure your operating system to use OpenJDK 11 by default. |
|||
You can configure which version is the default using the following command: |
|||
|
|||
```bash |
|||
sudo update-alternatives --config java |
|||
{:copy-code} |
|||
``` |
|||
|
|||
You can check the installation using the following command: |
|||
|
|||
```bash |
|||
java -version |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Expected command output is: |
|||
|
|||
```text |
|||
openjdk version "11.0.xx" |
|||
OpenJDK Runtime Environment (...) |
|||
OpenJDK 64-Bit Server VM (build ...) |
|||
``` |
|||
|
|||
#### Configure PostgreSQL |
|||
ThingsBoard Edge uses PostgreSQL database as a local storage. |
|||
Instructions listed below will help you to install PostgreSQL. |
|||
|
|||
```bash |
|||
# Update your system |
|||
sudo yum update |
|||
{:copy-code} |
|||
``` |
|||
|
|||
**For CentOS 7:** |
|||
|
|||
```bash |
|||
# Install the repository RPM (for CentOS 7): |
|||
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm |
|||
# Install packages |
|||
sudo yum -y install epel-release yum-utils |
|||
sudo yum-config-manager --enable pgdg12 |
|||
sudo yum install postgresql12-server postgresql12 |
|||
# Initialize your PostgreSQL DB |
|||
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb |
|||
sudo systemctl start postgresql-12 |
|||
# Optional: Configure PostgreSQL to start on boot |
|||
sudo systemctl enable --now postgresql-12 |
|||
|
|||
{:copy-code} |
|||
``` |
|||
|
|||
**For CentOS 8:** |
|||
|
|||
```bash |
|||
# Install the repository RPM (for CentOS 8): |
|||
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm |
|||
# Install packages |
|||
sudo dnf -qy module disable postgresql |
|||
sudo dnf -y install postgresql12 postgresql12-server |
|||
# Initialize your PostgreSQL DB |
|||
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb |
|||
sudo systemctl start postgresql-12 |
|||
# Optional: Configure PostgreSQL to start on boot |
|||
sudo systemctl enable --now postgresql-12 |
|||
|
|||
{:copy-code} |
|||
``` |
|||
|
|||
Once PostgreSQL is installed you may want to create a new user or set the password for the main user. |
|||
The instructions below will help to set the password for main PostgreSQL user: |
|||
|
|||
```text |
|||
sudo su - postgres |
|||
psql |
|||
\password |
|||
\q |
|||
``` |
|||
|
|||
Then, press "Ctrl+D" to return to main user console. |
|||
|
|||
After configuring the password, edit the pg_hba.conf to use MD5 authentication with the postgres user. |
|||
|
|||
Edit pg_hba.conf file: |
|||
|
|||
```bash |
|||
sudo nano /var/lib/pgsql/12/data/pg_hba.conf |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Locate the following lines: |
|||
|
|||
```text |
|||
# IPv4 local connections: |
|||
host all all 127.0.0.1/32 ident |
|||
``` |
|||
|
|||
Replace `ident` with `md5`: |
|||
|
|||
```text |
|||
host all all 127.0.0.1/32 md5 |
|||
``` |
|||
|
|||
Finally, you should restart the PostgreSQL service to initialize the new configuration: |
|||
|
|||
```bash |
|||
sudo systemctl restart postgresql-12.service |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Connect to the database to create ThingsBoard Edge DB: |
|||
|
|||
```bash |
|||
psql -U postgres -d postgres -h 127.0.0.1 -W |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Execute create database statement: |
|||
|
|||
```bash |
|||
CREATE DATABASE tb_edge; |
|||
\q |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### ThingsBoard Edge service installation |
|||
Download installation package: |
|||
|
|||
```bash |
|||
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v${TB_EDGE_VERSION}/tb-edge-${TB_EDGE_VERSION}.rpm |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Go to the download repository and install ThingsBoard Edge service: |
|||
|
|||
```bash |
|||
sudo rpm -Uvh tb-edge-${TB_EDGE_VERSION}.rpm |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Configure ThingsBoard Edge |
|||
To configure ThingsBoard Edge, you can use the following command to automatically update the configuration file with specific values: |
|||
|
|||
```bash |
|||
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf |
|||
export CLOUD_ROUTING_KEY=${CLOUD_ROUTING_KEY} |
|||
export CLOUD_ROUTING_SECRET=${CLOUD_ROUTING_SECRET} |
|||
export CLOUD_RPC_HOST=${BASE_URL} |
|||
export CLOUD_RPC_PORT=${CLOUD_RPC_PORT} |
|||
export CLOUD_RPC_SSL_ENABLED=${CLOUD_RPC_SSL_ENABLED} |
|||
EOL' |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Database Configuration |
|||
In case you changed default PostgreSQL datasource settings (**postgres**/**postgres**) please update the configuration file (**/etc/tb-edge/conf/tb-edge.conf**) with your actual values: |
|||
|
|||
```bash |
|||
sudo nano /etc/tb-edge/conf/tb-edge.conf |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Please update the following lines in your configuration file. Make sure **to replace**: |
|||
- Replace 'postgres' with your actual PostgreSQL username; |
|||
- Replace 'PUT_YOUR_POSTGRESQL_PASSWORD_HERE' with your actual PostgreSQL password. |
|||
|
|||
```bash |
|||
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/tb_edge |
|||
export SPRING_DATASOURCE_USERNAME=postgres |
|||
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Update bind ports |
|||
If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update configuration parameters to avoid port collision between ThingsBoard server and ThingsBoard Edge. |
|||
|
|||
Please execute the following command to update ThingsBoard Edge configuration file (**/etc/tb-edge/conf/tb-edge.conf**): |
|||
|
|||
```bash |
|||
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf |
|||
export HTTP_BIND_PORT=18080 |
|||
export MQTT_BIND_PORT=11883 |
|||
export COAP_BIND_PORT=15683 |
|||
export LWM2M_ENABLED=false |
|||
export SNMP_ENABLED=false |
|||
EOL' |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Make sure that ports above (18080, 11883, 15683) are not used by any other application. |
|||
|
|||
#### Run installation script |
|||
Once ThingsBoard Edge is installed and configured please execute the following install script: |
|||
|
|||
```bash |
|||
sudo /usr/share/tb-edge/bin/install/install.sh |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Restart ThingsBoard Edge service |
|||
|
|||
```bash |
|||
sudo service tb-edge restart |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Open ThingsBoard Edge UI |
|||
|
|||
Once started, you will be able to open **ThingsBoard Edge UI** using the following link http://localhost:8080. |
|||
|
|||
###### NOTE: Edge HTTP bind port update |
|||
|
|||
Use next **ThingsBoard Edge UI** link **http://localhost:18080** if you updated HTTP 8080 bind port to **18080**. |
|||
|
|||
@ -1,105 +0,0 @@ |
|||
Here is the list of commands, that can be used to quickly install ThingsBoard Edge using docker compose and connect to the cloud. |
|||
|
|||
#### Prerequisites |
|||
|
|||
Install <a href="https://docs.docker.com/engine/install/" target="_blank"> Docker CE</a> and <a href="https://docs.docker.com/compose/install/" target="_blank"> Docker Compose</a>. |
|||
|
|||
#### Create data and logs folders |
|||
|
|||
Run following commands, before starting docker container(s), to create folders for storing data and logs. |
|||
These commands additionally will change owner of newly created folders to docker container user. |
|||
To do this (to change user) **chown** command is used, and this command requires *sudo* permissions (command will request password for a *sudo* access): |
|||
|
|||
```bash |
|||
mkdir -p ~/.mytb-edge-data && sudo chown -R 799:799 ~/.mytb-edge-data |
|||
mkdir -p ~/.mytb-edge-logs && sudo chown -R 799:799 ~/.mytb-edge-logs |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Running ThingsBoard Edge as docker service |
|||
|
|||
${LOCALHOST_WARNING} |
|||
|
|||
Create docker compose file for ThingsBoard Edge service: |
|||
|
|||
```bash |
|||
nano docker-compose.yml |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Add the following lines to the yml file: |
|||
|
|||
```bash |
|||
version: '3.0' |
|||
services: |
|||
mytbedge: |
|||
restart: always |
|||
image: "thingsboard/tb-edge:${TB_EDGE_VERSION}" |
|||
ports: |
|||
- "8080:8080" |
|||
- "1883:1883" |
|||
- "5683-5688:5683-5688/udp" |
|||
environment: |
|||
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge |
|||
CLOUD_ROUTING_KEY: ${CLOUD_ROUTING_KEY} |
|||
CLOUD_ROUTING_SECRET: ${CLOUD_ROUTING_SECRET} |
|||
CLOUD_RPC_HOST: ${BASE_URL} |
|||
CLOUD_RPC_PORT: ${CLOUD_RPC_PORT} |
|||
CLOUD_RPC_SSL_ENABLED: ${CLOUD_RPC_SSL_ENABLED} |
|||
volumes: |
|||
- ~/.mytb-edge-data:/data |
|||
- ~/.mytb-edge-logs:/var/log/tb-edge |
|||
postgres: |
|||
restart: always |
|||
image: "postgres:12" |
|||
ports: |
|||
- "5432" |
|||
environment: |
|||
POSTGRES_DB: tb-edge |
|||
POSTGRES_PASSWORD: postgres |
|||
volumes: |
|||
- ~/.mytb-edge-data/db:/var/lib/postgresql/data |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Update bind ports |
|||
If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update docker compose port mapping to avoid port collision between ThingsBoard server and ThingsBoard Edge. |
|||
|
|||
Please update next lines of `docker-compose.yml` file: |
|||
|
|||
```text |
|||
ports: |
|||
- "18080:8080" |
|||
- "11883:1883" |
|||
- "15683-15688:5683-5688/udp" |
|||
``` |
|||
Make sure that ports above (18080, 11883, 15683-15688) are not used by any other application. |
|||
|
|||
#### Start ThingsBoard Edge |
|||
Set the terminal in the directory which contains the `docker-compose.yml` file and execute the following commands to up this docker compose directly: |
|||
|
|||
```bash |
|||
docker compose up -d |
|||
docker compose logs -f mytbedge |
|||
{:copy-code} |
|||
``` |
|||
|
|||
###### NOTE: Docker Compose V2 vs docker-compose (with a hyphen) |
|||
|
|||
ThingsBoard supports Docker Compose V2 (Docker Desktop or Compose plugin) starting from **3.4.2** release, because **docker-compose** as standalone setup is no longer supported by Docker. |
|||
We **strongly** recommend to update to Docker Compose V2 and use it. |
|||
If you still rely on using Docker Compose as docker-compose (with a hyphen), then please execute the following commands to start ThingsBoard Edge: |
|||
|
|||
```bash |
|||
docker-compose up -d |
|||
docker-compose logs -f mytbedge |
|||
``` |
|||
|
|||
#### Open ThingsBoard Edge UI |
|||
|
|||
Once started, you will be able to open **ThingsBoard Edge UI** using the following link http://localhost:8080. |
|||
|
|||
###### NOTE: Edge HTTP bind port update |
|||
|
|||
Use next **ThingsBoard Edge UI** link **http://localhost:18080** if you updated HTTP 8080 bind port to **18080**. |
|||
|
|||
@ -1,3 +0,0 @@ |
|||
###### WARNING NOTE: 'localhost' can not be used as CLOUD_RPC_HOST |
|||
|
|||
Please note that your ThingsBoard base URL is **'localhost'** at the moment. **'localhost'** cannot be used for docker containers - please update **CLOUD_RPC_HOST** environment variable below to the IP address of your machine (*docker **host** machine*). IP address must be `192.168.1.XX` or similar format. In other case - ThingsBoard Edge service, that is running in docker container, will not be able to connect to the cloud. |
|||
@ -1,164 +0,0 @@ |
|||
Here is the list of commands, that can be used to quickly install ThingsBoard Edge on Ubuntu Server and connect to the cloud. |
|||
|
|||
#### Install Java 11 (OpenJDK) |
|||
ThingsBoard service is running on Java 11. Follow these instructions to install OpenJDK 11: |
|||
|
|||
```bash |
|||
sudo apt update |
|||
sudo apt install openjdk-11-jdk |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Please don't forget to configure your operating system to use OpenJDK 11 by default. |
|||
You can configure which version is the default using the following command: |
|||
|
|||
```bash |
|||
sudo update-alternatives --config java |
|||
{:copy-code} |
|||
``` |
|||
|
|||
You can check the installation using the following command: |
|||
|
|||
```bash |
|||
java -version |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Expected command output is: |
|||
|
|||
```text |
|||
openjdk version "11.0.xx" |
|||
OpenJDK Runtime Environment (...) |
|||
OpenJDK 64-Bit Server VM (build ...) |
|||
``` |
|||
|
|||
#### Configure PostgreSQL |
|||
ThingsBoard Edge uses PostgreSQL database as a local storage. |
|||
Instructions listed below will help you to install PostgreSQL. |
|||
|
|||
```bash |
|||
# install **wget** if not already installed: |
|||
sudo apt install -y wget |
|||
|
|||
# import the repository signing key: |
|||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - |
|||
|
|||
# add repository contents to your system: |
|||
RELEASE=$(lsb_release -cs) |
|||
echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list |
|||
|
|||
# install and launch the postgresql service: |
|||
sudo apt update |
|||
sudo apt -y install postgresql-12 |
|||
sudo service postgresql start |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Once PostgreSQL is installed you may want to create a new user or set the password for the main user. |
|||
The instructions below will help to set the password for main PostgreSQL user: |
|||
|
|||
```text |
|||
sudo su - postgres |
|||
psql |
|||
\password |
|||
\q |
|||
``` |
|||
|
|||
Then, press “Ctrl+D” to return to main user console and connect to the database to create ThingsBoard Edge DB: |
|||
|
|||
```text |
|||
psql -U postgres -d postgres -h 127.0.0.1 -W |
|||
CREATE DATABASE tb_edge; |
|||
\q |
|||
``` |
|||
|
|||
#### Thingsboard Edge service installation |
|||
Download installation package: |
|||
|
|||
```bash |
|||
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v${TB_EDGE_VERSION}/tb-edge-${TB_EDGE_VERSION}.deb |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Go to the download repository and install ThingsBoard Edge service: |
|||
|
|||
```bash |
|||
sudo dpkg -i tb-edge-${TB_EDGE_VERSION}.deb |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Configure ThingsBoard Edge |
|||
To configure ThingsBoard Edge, you can use the following command to automatically update the configuration file with specific values: |
|||
|
|||
```bash |
|||
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf |
|||
export CLOUD_ROUTING_KEY=${CLOUD_ROUTING_KEY} |
|||
export CLOUD_ROUTING_SECRET=${CLOUD_ROUTING_SECRET} |
|||
export CLOUD_RPC_HOST=${BASE_URL} |
|||
export CLOUD_RPC_PORT=${CLOUD_RPC_PORT} |
|||
export CLOUD_RPC_SSL_ENABLED=${CLOUD_RPC_SSL_ENABLED} |
|||
EOL' |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Database Configuration |
|||
In case you changed default PostgreSQL datasource settings (**postgres**/**postgres**) please update the configuration file (**/etc/tb-edge/conf/tb-edge.conf**) with your actual values: |
|||
|
|||
```bash |
|||
sudo nano /etc/tb-edge/conf/tb-edge.conf |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Please update the following lines in your configuration file. Make sure **to replace**: |
|||
- Replace 'postgres' with your actual PostgreSQL username; |
|||
- Replace 'PUT_YOUR_POSTGRESQL_PASSWORD_HERE' with your actual PostgreSQL password. |
|||
|
|||
```bash |
|||
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/tb_edge |
|||
export SPRING_DATASOURCE_USERNAME=postgres |
|||
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Update bind ports |
|||
If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update configuration parameters to avoid port collision between ThingsBoard server and ThingsBoard Edge. |
|||
|
|||
Please execute the following command to update ThingsBoard Edge configuration file (**/etc/tb-edge/conf/tb-edge.conf**): |
|||
|
|||
```bash |
|||
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf |
|||
export HTTP_BIND_PORT=18080 |
|||
export MQTT_BIND_PORT=11883 |
|||
export COAP_BIND_PORT=15683 |
|||
export LWM2M_ENABLED=false |
|||
export SNMP_ENABLED=false |
|||
EOL' |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Make sure that ports above (18080, 11883, 15683) are not used by any other application. |
|||
|
|||
#### Run installation script |
|||
|
|||
Once ThingsBoard Edge is installed and configured please execute the following install script: |
|||
|
|||
```bash |
|||
sudo /usr/share/tb-edge/bin/install/install.sh |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Restart ThingsBoard Edge service |
|||
|
|||
```bash |
|||
sudo service tb-edge restart |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Open ThingsBoard Edge UI |
|||
|
|||
Once started, you will be able to open **ThingsBoard Edge UI** using the following link http://localhost:8080. |
|||
|
|||
###### NOTE: Edge HTTP bind port update |
|||
|
|||
Use next **ThingsBoard Edge UI** link **http://localhost:18080** if you updated HTTP 8080 bind port to **18080**. |
|||
|
|||
@ -0,0 +1,231 @@ |
|||
Here is the list of commands, that can be used to quickly install ThingsBoard Edge on RHEL/CentOS 7/8 and connect to the server. |
|||
|
|||
#### Prerequisites |
|||
Before continue to installation execute the following commands in order to install necessary tools: |
|||
|
|||
```bash |
|||
sudo yum install -y nano wget |
|||
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
|||
``` |
|||
|
|||
#### Install Java 11 (OpenJDK) |
|||
ThingsBoard service is running on Java 11. Follow these instructions to install OpenJDK 11: |
|||
|
|||
```bash |
|||
sudo yum install java-11-openjdk |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Please don't forget to configure your operating system to use OpenJDK 11 by default. |
|||
You can configure which version is the default using the following command: |
|||
|
|||
```bash |
|||
sudo update-alternatives --config java |
|||
{:copy-code} |
|||
``` |
|||
|
|||
You can check the installation using the following command: |
|||
|
|||
```bash |
|||
java -version |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Expected command output is: |
|||
|
|||
```text |
|||
openjdk version "11.0.xx" |
|||
OpenJDK Runtime Environment (...) |
|||
OpenJDK 64-Bit Server VM (build ...) |
|||
``` |
|||
|
|||
#### Configure PostgreSQL |
|||
ThingsBoard Edge uses PostgreSQL database as a local storage. |
|||
Instructions listed below will help you to install PostgreSQL. |
|||
|
|||
```bash |
|||
# Update your system |
|||
sudo yum update |
|||
{:copy-code} |
|||
``` |
|||
|
|||
**For CentOS 7:** |
|||
|
|||
```bash |
|||
# Install the repository RPM (for CentOS 7): |
|||
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm |
|||
# Install packages |
|||
sudo yum -y install epel-release yum-utils |
|||
sudo yum-config-manager --enable pgdg15 |
|||
sudo yum install postgresql15-server postgresql15 |
|||
# Initialize your PostgreSQL DB |
|||
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb |
|||
sudo systemctl start postgresql-15 |
|||
# Optional: Configure PostgreSQL to start on boot |
|||
sudo systemctl enable --now postgresql-15 |
|||
|
|||
{:copy-code} |
|||
``` |
|||
|
|||
**For CentOS 8:** |
|||
|
|||
```bash |
|||
# Install the repository RPM (for CentOS 8): |
|||
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm |
|||
# Install packages |
|||
sudo dnf -qy module disable postgresql |
|||
sudo dnf -y install postgresql15 postgresql15-server |
|||
# Initialize your PostgreSQL DB |
|||
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb |
|||
sudo systemctl start postgresql-15 |
|||
# Optional: Configure PostgreSQL to start on boot |
|||
sudo systemctl enable --now postgresql-15 |
|||
|
|||
{:copy-code} |
|||
``` |
|||
|
|||
Once PostgreSQL is installed you may want to create a new user or set the password for the main user. |
|||
The instructions below will help to set the password for main PostgreSQL user: |
|||
|
|||
```text |
|||
sudo su - postgres |
|||
psql |
|||
\password |
|||
\q |
|||
``` |
|||
|
|||
Then, press "Ctrl+D" to return to main user console. |
|||
|
|||
After configuring the password, edit the pg_hba.conf to use MD5 authentication with the postgres user. |
|||
|
|||
Edit pg_hba.conf file: |
|||
|
|||
```bash |
|||
sudo nano /var/lib/pgsql/15/data/pg_hba.conf |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Locate the following lines: |
|||
|
|||
```text |
|||
# IPv4 local connections: |
|||
host all all 127.0.0.1/32 ident |
|||
``` |
|||
|
|||
Replace `ident` with `md5`: |
|||
|
|||
```text |
|||
host all all 127.0.0.1/32 md5 |
|||
``` |
|||
|
|||
Finally, you should restart the PostgreSQL service to initialize the new configuration: |
|||
|
|||
```bash |
|||
sudo systemctl restart postgresql-15.service |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Connect to the database to create ThingsBoard Edge DB: |
|||
|
|||
```bash |
|||
psql -U postgres -d postgres -h 127.0.0.1 -W |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Execute create database statement: |
|||
|
|||
```bash |
|||
CREATE DATABASE tb_edge; |
|||
\q |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### ThingsBoard Edge service installation |
|||
Download installation package: |
|||
|
|||
```bash |
|||
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v${TB_EDGE_VERSION}/tb-edge-${TB_EDGE_VERSION}.rpm |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Go to the download repository and install ThingsBoard Edge service: |
|||
|
|||
```bash |
|||
sudo rpm -Uvh tb-edge-${TB_EDGE_VERSION}.rpm |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Configure ThingsBoard Edge |
|||
To configure ThingsBoard Edge, you can use the following command to automatically update the configuration file with specific values: |
|||
|
|||
```bash |
|||
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf |
|||
export CLOUD_ROUTING_KEY=${CLOUD_ROUTING_KEY} |
|||
export CLOUD_ROUTING_SECRET=${CLOUD_ROUTING_SECRET} |
|||
export CLOUD_RPC_HOST=${BASE_URL} |
|||
export CLOUD_RPC_PORT=${CLOUD_RPC_PORT} |
|||
export CLOUD_RPC_SSL_ENABLED=${CLOUD_RPC_SSL_ENABLED} |
|||
EOL' |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Database Configuration |
|||
In case you changed default PostgreSQL datasource settings (**postgres**/**postgres**) please update the configuration file (**/etc/tb-edge/conf/tb-edge.conf**) with your actual values: |
|||
|
|||
```bash |
|||
sudo nano /etc/tb-edge/conf/tb-edge.conf |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Please update the following lines in your configuration file. Make sure **to replace**: |
|||
- Replace 'postgres' with your actual PostgreSQL username; |
|||
- Replace 'PUT_YOUR_POSTGRESQL_PASSWORD_HERE' with your actual PostgreSQL password. |
|||
|
|||
```bash |
|||
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/tb_edge |
|||
export SPRING_DATASOURCE_USERNAME=postgres |
|||
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Update bind ports |
|||
If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update configuration parameters to avoid port collision between ThingsBoard server and ThingsBoard Edge. |
|||
|
|||
Please execute the following command to update ThingsBoard Edge configuration file (**/etc/tb-edge/conf/tb-edge.conf**): |
|||
|
|||
```bash |
|||
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf |
|||
export HTTP_BIND_PORT=18080 |
|||
export MQTT_BIND_PORT=11883 |
|||
export COAP_BIND_PORT=15683 |
|||
export LWM2M_ENABLED=false |
|||
export SNMP_ENABLED=false |
|||
EOL' |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Make sure that ports above (18080, 11883, 15683) are not used by any other application. |
|||
|
|||
#### Run installation script |
|||
Once ThingsBoard Edge is installed and configured please execute the following install script: |
|||
|
|||
```bash |
|||
sudo /usr/share/tb-edge/bin/install/install.sh |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Restart ThingsBoard Edge service |
|||
|
|||
```bash |
|||
sudo service tb-edge restart |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Open ThingsBoard Edge UI |
|||
|
|||
Once started, you will be able to open **ThingsBoard Edge UI** using the following link http://localhost:8080. |
|||
|
|||
###### NOTE: Edge HTTP bind port update |
|||
|
|||
Use next **ThingsBoard Edge UI** link **http://localhost:18080** if you updated HTTP 8080 bind port to **18080**. |
|||
|
|||
@ -0,0 +1,100 @@ |
|||
Here is the list of commands, that can be used to quickly install ThingsBoard Edge using docker compose and connect to the server. |
|||
|
|||
#### Prerequisites |
|||
|
|||
Install <a href="https://docs.docker.com/engine/install/" target="_blank"> Docker CE</a> and <a href="https://docs.docker.com/compose/install/" target="_blank"> Docker Compose</a>. |
|||
|
|||
#### Running ThingsBoard Edge as docker service |
|||
|
|||
Create docker compose file for ThingsBoard Edge service: |
|||
|
|||
```bash |
|||
nano docker-compose.yml |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Add the following lines to the yml file: |
|||
|
|||
```bash |
|||
version: '3.8' |
|||
services: |
|||
mytbedge: |
|||
restart: always |
|||
image: "thingsboard/tb-edge:${TB_EDGE_VERSION}" |
|||
ports: |
|||
- "8080:8080" |
|||
- "1883:1883" |
|||
- "5683-5688:5683-5688/udp" |
|||
environment: |
|||
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge |
|||
CLOUD_ROUTING_KEY: ${CLOUD_ROUTING_KEY} |
|||
CLOUD_ROUTING_SECRET: ${CLOUD_ROUTING_SECRET} |
|||
CLOUD_RPC_HOST: ${BASE_URL} |
|||
CLOUD_RPC_PORT: ${CLOUD_RPC_PORT} |
|||
CLOUD_RPC_SSL_ENABLED: ${CLOUD_RPC_SSL_ENABLED} |
|||
volumes: |
|||
- tb-edge-data:/data |
|||
- tb-edge-logs:/var/log/tb-edge |
|||
${EXTRA_HOSTS} |
|||
postgres: |
|||
restart: always |
|||
image: "postgres:15" |
|||
ports: |
|||
- "5432" |
|||
environment: |
|||
POSTGRES_DB: tb-edge |
|||
POSTGRES_PASSWORD: postgres |
|||
volumes: |
|||
- tb-edge-postgres-data:/var/lib/postgresql/data |
|||
|
|||
volumes: |
|||
tb-edge-data: |
|||
name: tb-edge-data |
|||
tb-edge-logs: |
|||
name: tb-edge-logs |
|||
tb-edge-postgres-data: |
|||
name: tb-edge-postgres-data |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Update bind ports |
|||
If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update docker compose port mapping to avoid port collision between ThingsBoard server and ThingsBoard Edge. |
|||
|
|||
Please update next lines of `docker-compose.yml` file: |
|||
|
|||
```text |
|||
ports: |
|||
- "18080:8080" |
|||
- "11883:1883" |
|||
- "15683-15688:5683-5688/udp" |
|||
``` |
|||
Make sure that ports above (18080, 11883, 15683-15688) are not used by any other application. |
|||
|
|||
#### Start ThingsBoard Edge |
|||
Set the terminal in the directory which contains the `docker-compose.yml` file and execute the following commands to up this docker compose directly: |
|||
|
|||
```bash |
|||
docker compose up -d |
|||
docker compose logs -f mytbedge |
|||
{:copy-code} |
|||
``` |
|||
|
|||
###### NOTE: Docker Compose V2 vs docker-compose (with a hyphen) |
|||
|
|||
ThingsBoard supports Docker Compose V2 (Docker Desktop or Compose plugin) starting from **3.4.2** release, because **docker-compose** as standalone setup is no longer supported by Docker. |
|||
We **strongly** recommend to update to Docker Compose V2 and use it. |
|||
If you still rely on using Docker Compose as docker-compose (with a hyphen), then please execute the following commands to start ThingsBoard Edge: |
|||
|
|||
```bash |
|||
docker-compose up -d |
|||
docker-compose logs -f mytbedge |
|||
``` |
|||
|
|||
#### Open ThingsBoard Edge UI |
|||
|
|||
Once started, you will be able to open **ThingsBoard Edge UI** using the following link http://localhost:8080. |
|||
|
|||
###### NOTE: Edge HTTP bind port update |
|||
|
|||
Use next **ThingsBoard Edge UI** link **http://localhost:18080** if you updated HTTP 8080 bind port to **18080**. |
|||
|
|||
@ -0,0 +1,164 @@ |
|||
Here is the list of commands, that can be used to quickly install ThingsBoard Edge on Ubuntu Server and connect to the server. |
|||
|
|||
#### Install Java 11 (OpenJDK) |
|||
ThingsBoard service is running on Java 11. Follow these instructions to install OpenJDK 11: |
|||
|
|||
```bash |
|||
sudo apt update |
|||
sudo apt install openjdk-11-jdk |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Please don't forget to configure your operating system to use OpenJDK 11 by default. |
|||
You can configure which version is the default using the following command: |
|||
|
|||
```bash |
|||
sudo update-alternatives --config java |
|||
{:copy-code} |
|||
``` |
|||
|
|||
You can check the installation using the following command: |
|||
|
|||
```bash |
|||
java -version |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Expected command output is: |
|||
|
|||
```text |
|||
openjdk version "11.0.xx" |
|||
OpenJDK Runtime Environment (...) |
|||
OpenJDK 64-Bit Server VM (build ...) |
|||
``` |
|||
|
|||
#### Configure PostgreSQL |
|||
ThingsBoard Edge uses PostgreSQL database as a local storage. |
|||
Instructions listed below will help you to install PostgreSQL. |
|||
|
|||
```bash |
|||
# install **wget** if not already installed: |
|||
sudo apt install -y wget |
|||
|
|||
# import the repository signing key: |
|||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - |
|||
|
|||
# add repository contents to your system: |
|||
RELEASE=$(lsb_release -cs) |
|||
echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list |
|||
|
|||
# install and launch the postgresql service: |
|||
sudo apt update |
|||
sudo apt -y install postgresql-15 |
|||
sudo service postgresql start |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Once PostgreSQL is installed you may want to create a new user or set the password for the main user. |
|||
The instructions below will help to set the password for main PostgreSQL user: |
|||
|
|||
```text |
|||
sudo su - postgres |
|||
psql |
|||
\password |
|||
\q |
|||
``` |
|||
|
|||
Then, press “Ctrl+D” to return to main user console and connect to the database to create ThingsBoard Edge DB: |
|||
|
|||
```text |
|||
psql -U postgres -d postgres -h 127.0.0.1 -W |
|||
CREATE DATABASE tb_edge; |
|||
\q |
|||
``` |
|||
|
|||
#### Thingsboard Edge service installation |
|||
Download installation package: |
|||
|
|||
```bash |
|||
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v${TB_EDGE_VERSION}/tb-edge-${TB_EDGE_VERSION}.deb |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Go to the download repository and install ThingsBoard Edge service: |
|||
|
|||
```bash |
|||
sudo dpkg -i tb-edge-${TB_EDGE_VERSION}.deb |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Configure ThingsBoard Edge |
|||
To configure ThingsBoard Edge, you can use the following command to automatically update the configuration file with specific values: |
|||
|
|||
```bash |
|||
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf |
|||
export CLOUD_ROUTING_KEY=${CLOUD_ROUTING_KEY} |
|||
export CLOUD_ROUTING_SECRET=${CLOUD_ROUTING_SECRET} |
|||
export CLOUD_RPC_HOST=${BASE_URL} |
|||
export CLOUD_RPC_PORT=${CLOUD_RPC_PORT} |
|||
export CLOUD_RPC_SSL_ENABLED=${CLOUD_RPC_SSL_ENABLED} |
|||
EOL' |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Database Configuration |
|||
In case you changed default PostgreSQL datasource settings (**postgres**/**postgres**) please update the configuration file (**/etc/tb-edge/conf/tb-edge.conf**) with your actual values: |
|||
|
|||
```bash |
|||
sudo nano /etc/tb-edge/conf/tb-edge.conf |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Please update the following lines in your configuration file. Make sure **to replace**: |
|||
- Replace 'postgres' with your actual PostgreSQL username; |
|||
- Replace 'PUT_YOUR_POSTGRESQL_PASSWORD_HERE' with your actual PostgreSQL password. |
|||
|
|||
```bash |
|||
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/tb_edge |
|||
export SPRING_DATASOURCE_USERNAME=postgres |
|||
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### [Optional] Update bind ports |
|||
If ThingsBoard Edge is going to be running on the same machine where ThingsBoard server (cloud) is running, you'll need to update configuration parameters to avoid port collision between ThingsBoard server and ThingsBoard Edge. |
|||
|
|||
Please execute the following command to update ThingsBoard Edge configuration file (**/etc/tb-edge/conf/tb-edge.conf**): |
|||
|
|||
```bash |
|||
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf |
|||
export HTTP_BIND_PORT=18080 |
|||
export MQTT_BIND_PORT=11883 |
|||
export COAP_BIND_PORT=15683 |
|||
export LWM2M_ENABLED=false |
|||
export SNMP_ENABLED=false |
|||
EOL' |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Make sure that ports above (18080, 11883, 15683) are not used by any other application. |
|||
|
|||
#### Run installation script |
|||
|
|||
Once ThingsBoard Edge is installed and configured please execute the following install script: |
|||
|
|||
```bash |
|||
sudo /usr/share/tb-edge/bin/install/install.sh |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Restart ThingsBoard Edge service |
|||
|
|||
```bash |
|||
sudo service tb-edge restart |
|||
{:copy-code} |
|||
``` |
|||
|
|||
#### Open ThingsBoard Edge UI |
|||
|
|||
Once started, you will be able to open **ThingsBoard Edge UI** using the following link http://localhost:8080. |
|||
|
|||
###### NOTE: Edge HTTP bind port update |
|||
|
|||
Use next **ThingsBoard Edge UI** link **http://localhost:18080** if you updated HTTP 8080 bind port to **18080**. |
|||
|
|||
@ -0,0 +1,15 @@ |
|||
#### Upgrading to ${TB_EDGE_VERSION}EDGE |
|||
|
|||
**ThingsBoard Edge package download:** |
|||
```bash |
|||
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v${TB_EDGE_TAG}/tb-edge-${TB_EDGE_TAG}.rpm |
|||
{:copy-code} |
|||
``` |
|||
##### ThingsBoard Edge service upgrade |
|||
|
|||
Install package: |
|||
```bash |
|||
sudo rpm -Uvh tb-edge-${TB_EDGE_TAG}.rpm |
|||
{:copy-code} |
|||
``` |
|||
${UPGRADE_DB} |
|||
@ -0,0 +1,10 @@ |
|||
#### Upgrading to ${TB_EDGE_VERSION} |
|||
|
|||
Execute the following command to pull **${TB_EDGE_VERSION}** image: |
|||
|
|||
```bash |
|||
docker pull thingsboard/tb-edge:${TB_EDGE_VERSION} |
|||
{:copy-code} |
|||
``` |
|||
|
|||
${UPGRADE_DB} |
|||
@ -0,0 +1,23 @@ |
|||
Modify ‘main’ docker compose (`docker-compose.yml`) file for ThingsBoard Edge and update version of the image: |
|||
```bash |
|||
nano docker-compose.yml |
|||
{:copy-code} |
|||
``` |
|||
|
|||
```text |
|||
version: '3.8' |
|||
services: |
|||
mytbedge: |
|||
restart: always |
|||
image: "thingsboard/tb-edge:${TB_EDGE_VERSION}" |
|||
... |
|||
``` |
|||
|
|||
Make sure your image is the set to **tb-edge-${TB_EDGE_VERSION}**. |
|||
Execute the following commands to up this docker compose directly: |
|||
|
|||
```bash |
|||
docker compose up -d |
|||
docker compose logs -f mytbedge |
|||
{:copy-code} |
|||
``` |
|||
@ -0,0 +1,61 @@ |
|||
Create docker compose file for ThingsBoard Edge upgrade process: |
|||
|
|||
```bash |
|||
> docker-compose-upgrade.yml && nano docker-compose-upgrade.yml |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Add the following lines to the yml file: |
|||
|
|||
```bash |
|||
version: '3.8' |
|||
services: |
|||
mytbedge: |
|||
restart: on-failure |
|||
image: "thingsboard/tb-edge:${TB_EDGE_VERSION}" |
|||
environment: |
|||
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge |
|||
volumes: |
|||
- tb-edge-data:/data |
|||
- tb-edge-logs:/var/log/tb-edge |
|||
entrypoint: upgrade-tb-edge.sh |
|||
postgres: |
|||
restart: always |
|||
image: "postgres:15" |
|||
ports: |
|||
- "5432" |
|||
environment: |
|||
POSTGRES_DB: tb-edge |
|||
POSTGRES_PASSWORD: postgres |
|||
volumes: |
|||
- tb-edge-postgres-data:/var/lib/postgresql/data |
|||
|
|||
volumes: |
|||
tb-edge-data: |
|||
name: tb-edge-data |
|||
tb-edge-logs: |
|||
name: tb-edge-logs |
|||
tb-edge-postgres-data: |
|||
name: tb-edge-postgres-data |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Execute the following command to start upgrade process: |
|||
|
|||
```bash |
|||
docker compose -f docker-compose-upgrade.yml up |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Once upgrade process successfully completed, exit from the docker-compose shell by this combination: |
|||
|
|||
```text |
|||
Ctrl + C |
|||
``` |
|||
|
|||
Execute the following command to stop TB Edge upgrade container: |
|||
|
|||
```bash |
|||
docker compose -f docker-compose-upgrade.yml stop |
|||
{:copy-code} |
|||
``` |
|||
@ -0,0 +1,95 @@ |
|||
Here is the list of commands, that can be used to quickly upgrade ThingsBoard Edge on Docker (Linux or MacOS). |
|||
|
|||
#### Prepare for upgrading ThingsBoard Edge |
|||
Set the terminal in the directory which contains the `docker-compose.yml` file and execute the following command |
|||
to stop and remove currently running TB Edge container: |
|||
|
|||
```bash |
|||
docker compose stop |
|||
docker compose rm mytbedge |
|||
{:copy-code} |
|||
``` |
|||
|
|||
**OPTIONAL:** If you still rely on Docker Compose as docker-compose (with a hyphen) here is the list of the above commands: |
|||
```text |
|||
docker-compose stop |
|||
docker-compose rm mytbedge |
|||
``` |
|||
|
|||
##### Migrating Data from Docker Bind Mount Folders to Docker Volumes |
|||
Starting with the **3.6.2** release, the ThingsBoard team has transitioned from using Docker bind mount folders to Docker volumes. |
|||
This change aims to enhance security and efficiency in storing data for Docker containers and to mitigate permission issues across various environments. |
|||
|
|||
To migrate from Docker bind mounts to Docker volumes, please execute the following commands: |
|||
|
|||
```bash |
|||
docker run --rm -v tb-edge-data:/volume -v ~/.mytb-edge-data:/backup busybox sh -c "cp -a /backup/. /volume" |
|||
docker run --rm -v tb-edge-logs:/volume -v ~/.mytb-edge-logs:/backup busybox sh -c "cp -a /backup/. /volume" |
|||
docker run --rm -v tb-edge-postgres-data:/volume -v ~/.mytb-edge-data/db:/backup busybox sh -c "cp -a /backup/. /volume" |
|||
{:copy-code} |
|||
``` |
|||
|
|||
After completing the data migration to the newly created Docker volumes, you'll need to update the volume mounts in your Docker Compose configuration. |
|||
Modify the `docker-compose.yml` file for ThingsBoard Edge to update the volume settings. |
|||
|
|||
First, please update docker compose file version. Find next snippet: |
|||
```text |
|||
version: '3.0' |
|||
... |
|||
``` |
|||
|
|||
And replace it with: |
|||
```text |
|||
version: '3.8' |
|||
... |
|||
``` |
|||
|
|||
Then update volume mounts. Locate the following snippet: |
|||
```text |
|||
volumes: |
|||
- ~/.mytb-edge-data:/data |
|||
- ~/.mytb-edge-logs:/var/log/tb-edge |
|||
... |
|||
``` |
|||
|
|||
And replace it with: |
|||
```text |
|||
volumes: |
|||
- tb-edge-data:/data |
|||
- tb-edge-logs:/var/log/tb-edge |
|||
... |
|||
``` |
|||
|
|||
Apply a similar update for the PostgreSQL service. Find the section: |
|||
```text |
|||
volumes: |
|||
- ~/.mytb-edge-data/db:/var/lib/postgresql/data |
|||
... |
|||
``` |
|||
|
|||
And replace it with: |
|||
```text |
|||
volumes: |
|||
- tb-edge-postgres-data:/var/lib/postgresql/data |
|||
... |
|||
``` |
|||
|
|||
Finally, please add next volumes section at the end of the file: |
|||
```text |
|||
... |
|||
volumes: |
|||
tb-edge-data: |
|||
name: tb-edge-data |
|||
tb-edge-logs: |
|||
name: tb-edge-logs |
|||
tb-edge-postgres-data: |
|||
name: tb-edge-postgres-data |
|||
``` |
|||
|
|||
##### Backup Database |
|||
Make a copy of the database volume before upgrading: |
|||
|
|||
```bash |
|||
docker run --rm -v tb-edge-postgres-data:/source -v tb-edge-postgres-data-backup:/backup busybox sh -c "cp -a /source/. /backup" |
|||
{:copy-code} |
|||
``` |
|||
@ -0,0 +1,6 @@ |
|||
Start the service |
|||
|
|||
```bash |
|||
sudo systemctl tb-edge start |
|||
{:copy-code} |
|||
``` |
|||
@ -0,0 +1,15 @@ |
|||
#### Upgrading to ${TB_EDGE_VERSION}EDGE |
|||
|
|||
**ThingsBoard Edge package download:** |
|||
```bash |
|||
wget https://github.com/thingsboard/thingsboard-edge/releases/download/v${TB_EDGE_TAG}/tb-edge-${TB_EDGE_TAG}.deb |
|||
{:copy-code} |
|||
``` |
|||
##### ThingsBoard Edge service upgrade |
|||
|
|||
Install package: |
|||
```bash |
|||
sudo dpkg -i tb-edge-${TB_EDGE_TAG}.deb |
|||
{:copy-code} |
|||
``` |
|||
${UPGRADE_DB} |
|||
@ -0,0 +1,8 @@ |
|||
**NOTE**: Package installer may ask you to merge your tb-edge configuration. It is preferred to use **merge option** to make sure that all your previous parameters will not be overwritten. |
|||
|
|||
Execute regular upgrade script: |
|||
|
|||
```bash |
|||
sudo /usr/share/tb-edge/bin/install/upgrade.sh --fromVersion=${FROM_TB_EDGE_VERSION} |
|||
{:copy-code} |
|||
``` |
|||
@ -0,0 +1,36 @@ |
|||
Here is the list of commands, that can be used to quickly upgrade ThingsBoard Edge on ${OS} |
|||
|
|||
#### Prepare for upgrading ThingsBoard Edge |
|||
|
|||
Stop ThingsBoard Edge service: |
|||
|
|||
```bash |
|||
sudo systemctl stop tb-edge |
|||
{:copy-code} |
|||
``` |
|||
|
|||
##### Backup Database |
|||
Make a backup of the database before upgrading. **Make sure you have enough space to place a backup of the database.** |
|||
|
|||
Check database size: |
|||
|
|||
```bash |
|||
sudo -u postgres psql -c "SELECT pg_size_pretty( pg_database_size('tb_edge') );" |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Check free space: |
|||
|
|||
```bash |
|||
df -h / |
|||
{:copy-code} |
|||
``` |
|||
|
|||
If there is enough free space - make a backup: |
|||
|
|||
```bash |
|||
sudo -Hiu postgres pg_dump tb_edge > tb_edge.sql.bak |
|||
{:copy-code} |
|||
``` |
|||
|
|||
Check backup file created successfully. |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,29 @@ |
|||
{ |
|||
"fqn": "charts.bars", |
|||
"name": "Bars", |
|||
"deprecated": true, |
|||
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAAA8FBMVEUhlvNMr1Bqamp5eXl7e3t8fHx9fX1+fn5/f3+AgICCgoKDg4OEhISGhoaHh4eKioqMjIyNjY2Ojo6QkJCRkZGSkpKWlpaXl5ebm5udnZ2enp6goKChoaGkpKSnp6epqamsrKyurq6xsbGzs7O1tbW2tra3t7e4uLi7u7u9vb3BwcHCwsLDw8PGxsbKysrNzc3Ozs7R0dHS0tLT09PZ2dna2trc3Nzd3d3e3t7g4ODh4eHj4+Pk5OTm5ubn5+fo6Ojp6enu7u7w8PDz8/P0Qzb09PT29vb39/f5+fn6+vr7+/v8/Pz9/f3+/v7/wQf///+dc+aLAAAAAWJLR0RPbmZBSQAAAcFJREFUeNrt3ds2AgEYhuHsaSOZbAvZi0r2YYjCJOW7/7txZhkcDNbM6h/vdwfPmlX/ybtmEorJErGCeJLadz3rkKPpZamaLTp925DHdFvSpKelU9uQ/cLKhtcdk7YqtiHruevtojch7ZZtQ0o1dcdfRqXNqm1IbVU3OaVamm/YhvQW5zIXOknnC5JUt7qEpE5fUv/5HVePy2UHAgQIECBAgAABAgQIECBxgrwGHBAgQIAAAQIECBAgQIAAAQIECJC/QRIBN0iQ+66voDMLuRp2fQWdVUhvNun6CjqrkJ0Dx/UVdEYhzXzfcX0FnVFIrlSZ2mx/LOiMQuqHh6k972NBZ/fv13G/KeiCQkIu4358EL8UdBafSGwuOxAgQIAAAQIECJDYQB4CDggQIECAAAECBAgQIECAAAECBAgQIECA/BrSufn0DjqjkEZmLXkWaUEXEmThXMeFSAu68H4j5b1IC7rQILfZTqQFXViQ1nRTL1EWdCFBnmYuJUVZ0IUEWR1xHKcXZUEXFDLwBR2XHQgQIECAAAEC5H9ChgIOCBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgxiBmv+L6Bl9pkxYph15gAAAAAElFTkSuQmCC", |
|||
"description": "Displays latest values of the attributes or time-series data for multiple entities as separate bars.", |
|||
"descriptor": { |
|||
"type": "latest", |
|||
"sizeX": 7, |
|||
"sizeY": 5, |
|||
"resources": [ |
|||
{ |
|||
"url": "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.min.js" |
|||
} |
|||
], |
|||
"templateHtml": "<canvas id=\"barChart\"></canvas>\n", |
|||
"templateCss": "", |
|||
"controllerScript": "self.onInit = function() {\n $scope = self.ctx.$scope;\n utils = $scope.$injector.get(self.ctx.servicesMap.get('utils'));\n settings = utils.deepClone(self.ctx.settings) || {};\n settings.showTooltip = utils.defaultValue(settings.showTooltip, true);\n \n Chart.defaults.global.tooltips.enabled = settings.showTooltip;\n \n var barData = {\n labels: [],\n datasets: []\n };\n \n for (var i = 0; i < self.ctx.datasources.length; i++) {\n var datasource = self.ctx.datasources[i];\n for (var d = 0; d < datasource.dataKeys.length; d++) {\n var dataKey = datasource.dataKeys[d];\n var units = dataKey.units && dataKey.units.length ? dataKey.units : self.ctx.units;\n units = units ? (' (' + units + ')') : '';\n var dataset = {\n label: dataKey.label + units,\n data: [0],\n backgroundColor: [dataKey.color],\n borderColor: [dataKey.color],\n borderWidth: 1\n }\n barData.datasets.push(dataset);\n }\n }\n\n var ctx = $('#barChart', self.ctx.$container);\n self.ctx.chart = new Chart(ctx, {\n type: 'bar',\n data: barData,\n options: {\n responsive: false,\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n \n self.onResize();\n}\n\nself.onDataUpdated = function() {\n var c = 0;\n for (var i = 0; i < self.ctx.chart.data.datasets.length; i++) {\n var dataset = self.ctx.chart.data.datasets[i];\n var cellData = self.ctx.data[i]; \n if (cellData.data.length > 0) {\n var decimals;\n if (typeof cellData.dataKey.decimals !== 'undefined' \n && cellData.dataKey.decimals !== null ) {\n decimals = cellData.dataKey.decimals; \n } else {\n decimals = self.ctx.decimals;\n }\n var tvPair = cellData.data[cellData.data.length - 1];\n var value = self.ctx.utils.formatValue(tvPair[1], decimals);\n dataset.data[0] = parseFloat(value);\n }\n }\n self.ctx.chart.update();\n}\n\nself.onResize = function() {\n self.ctx.chart.resize();\n}\n\nself.onDestroy = function() {\n self.ctx.chart.destroy();\n self.ctx.chart = null;\n}\n", |
|||
"settingsSchema": "", |
|||
"dataKeySettingsSchema": "{}\n", |
|||
"settingsDirective": "tb-chart-widget-settings", |
|||
"defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"First\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = (prevValue-50) + Math.random() * 2 - 1;\\nif (value < 0) {\\n\\tvalue = 0;\\n} else if (value > 100) {\\n\\tvalue = 100;\\n}\\nreturn value+50;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Second\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.545701115289893,\"funcBody\":\"var value = (prevValue-20) + Math.random() * 2 - 1;\\nif (value < 0) {\\n\\tvalue = 0;\\n} else if (value > 100) {\\n\\tvalue = 100;\\n}\\nreturn value+20;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Third\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.2592906835158064,\"funcBody\":\"var value = (prevValue-40) + Math.random() * 2 - 1;\\nif (value < 0) {\\n\\tvalue = 0;\\n} else if (value > 100) {\\n\\tvalue = 100;\\n}\\nreturn value+40;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Fourth\",\"color\":\"#ffc107\",\"settings\":{},\"_hash\":0.12880275585455747,\"funcBody\":\"var value = (prevValue-50) + Math.random() * 2 - 1;\\nif (value < 0) {\\n\\tvalue = 0;\\n} else if (value > 100) {\\n\\tvalue = 100;\\n}\\nreturn value+50;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{},\"title\":\"Bars\"}" |
|||
}, |
|||
"externalId": null, |
|||
"tags": [ |
|||
"bar", |
|||
"bar chart" |
|||
] |
|||
} |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,32 @@ |
|||
{ |
|||
"fqn": "horizontal_individual_allergy_index_iai_card", |
|||
"name": "Horizontal individual allergy index (IAI) card", |
|||
"deprecated": false, |
|||
"image": "tb-image:SUFJLXZhbHVlLWNhcmQtaG9yaXpvbnRhbC5zdmc=:SUFJLXZhbHVlLWNhcmQtaG9yaXpvbnRhbC5zdmc=;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMTYwIiBmaWxsPSJub25lIj48cmVjdCB3aWR0aD0iMjAwIiBoZWlnaHQ9IjU2IiB5PSI1MiIgZmlsbD0iI2ZmZiIgcng9IjQiLz48cmVjdCB3aWR0aD0iMTk5IiBoZWlnaHQ9IjU1IiB4PSIuNSIgeT0iNTIuNSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utb3BhY2l0eT0iLjEyIiByeD0iMy41Ii8+PGcgZmlsdGVyPSJ1cmwoI2EpIj48cmVjdCB3aWR0aD0iMTg0IiBoZWlnaHQ9IjQwIiB4PSI4IiB5PSI2MCIgZmlsbD0iI2ZmZiIgZmlsbC1vcGFjaXR5PSIuNzYiIHJ4PSI0Ii8+PHBhdGggZmlsbD0iIzgwQzQyQyIgZD0iTTMwLjQgODAuNzVhMi41IDIuNSAwIDAgMC0yLjUtMi41Yy0uNTMgMC0xLjAyLjE2LTEuNC40NHYtLjE5YTIuNSAyLjUgMCAwIDAtNSAwdi4xOWMtLjM4LS4yOC0uODctLjQ0LTEuNC0uNDRhMi41IDIuNSAwIDAgMC0yLjUgMi41YzAgLjk5LjU5IDEuODUgMS40MyAyLjI1YTIuNDkxIDIuNDkxIDAgMCAwLS42OTggNC4wMTggMi41IDIuNSAwIDAgMCAxLjc2OC43MzJjLjUzIDAgMS4wMi0uMTcgMS40LS40NHYuMTlhMi41IDIuNSAwIDAgMCA1IDB2LS4xOWMuMzguMjcuODcuNDQgMS40LjQ0YTIuNSAyLjUgMCAwIDAgMi41LTIuNWMwLTEtLjU5LTEuODUtMS40My0yLjI1Ljg0LS40IDEuNDMtMS4yNiAxLjQzLTIuMjVaTTI0IDg1LjVhMi41IDIuNSAwIDEgMSAwLTUgMi41IDIuNSAwIDAgMSAwIDVaTTIzIDc0YzAtLjU1LjQ1LTEgMS0xczEgLjQ1IDEgMS0uNDUgMS0xIDEtMS0uNDUtMS0xWm0tNCAyYzAtLjU1LjQ1LTEgMS0xczEgLjQ1IDEgMS0uNDUgMS0xIDEtMS0uNDUtMS0xWm0tMi0yYy0uNTUgMC0xLS40NS0xLTFzLjQ1LTEgMS0xIDEgLjQ1IDEgMS0uNDUgMS0xIDFabTMtM2MwLS41NS40NS0xIDEtMXMxIC40NSAxIDEtLjQ1IDEtMSAxLTEtLjQ1LTEtMVptNiAwYzAtLjU1LjQ1LTEgMS0xczEgLjQ1IDEgMS0uNDUgMS0xIDEtMS0uNDUtMS0xWm02IDJjMCAuNTUtLjQ1IDEtMSAxcy0xLS40NS0xLTEgLjQ1LTEgMS0xIDEgLjQ1IDEgMVptLTQgMmMuNTUgMCAxIC40NSAxIDFzLS40NSAxLTEgMS0xLS40NS0xLTEgLjQ1LTEgMS0xWiIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjg3IiBkPSJNNDEuODQ0IDc1LjA0N1Y4NWgtMS43MTZ2LTkuOTUzaDEuNzE2Wm02LjM4MiAxLjMyNkw0NS4yNTIgODVoLTEuNzk4bDMuNzQ2LTkuOTUzaDEuMTQ5bC0uMTIzIDEuMzI2Wk01MC43MTQgODVsLTIuOTgtOC42MjctLjEzLTEuMzI2aDEuMTU1TDUyLjUxOSA4NWgtMS44MDVabS0uMTQ0LTMuNjkxdjEuMzZoLTUuNDE0di0xLjM2aDUuNDE0Wm01LjE0NS02LjI2MlY4NWgtMS43MTZ2LTkuOTUzaDEuNzE2WiIvPjxwYXRoIGZpbGw9IiM4MEM0MkMiIGQ9Im0xNzUuNTQ1IDgwLjM4OS0xLjg3NS0uNDYuNzcxLTcuMTQ4aDcuNjY2djEuOTkyaC01LjcxMmwtLjM5MSAzLjQ4N2MuMjIxLS4xMy41MjctLjI1Ny45MTgtLjM4MWE0LjIyIDQuMjIgMCAwIDEgMS4zMzgtLjE5NWMuNjcgMCAxLjI2OS4xMSAxLjc5Ny4zMzIuNTMzLjIxNS45ODYuNTMgMS4zNTcuOTQ3LjM3MS40MS42NTQuOTExLjg1IDEuNTA0LjE5NS41ODYuMjkzIDEuMjQ2LjI5MyAxLjk4MmE1LjY5IDUuNjkgMCAwIDEtLjI5MyAxLjg0NiA0LjMwNiA0LjMwNiAwIDAgMS0uODYgMS41MTQgMy45NSAzLjk1IDAgMCAxLTEuNDU1IDEuMDI1Yy0uNTc5LjI0LTEuMjY2LjM2MS0yLjA2LjM2MWE1Ljc0NCA1Ljc0NCAwIDAgMS0xLjcwOS0uMjU0IDQuNjQyIDQuNjQyIDAgMCAxLTEuNDU1LS43NzEgMy45MzggMy45MzggMCAwIDEtMS4wMzYtMS4yN2MtLjI2LS41MDctLjQxLTEuMDktLjQ0OS0xLjc0OGgyLjMwNWMuMDU5LjQ2My4xODUuODU2LjM4MSAxLjE4Mi4yMDIuMzE5LjQ2OS41NjMuODAxLjczMi4zMzIuMTcuNzE2LjI1NCAxLjE1Mi4yNTQuMzk3IDAgLjczOS0uMDY4IDEuMDI1LS4yMDUuMjg3LS4xNDMuNTI0LS4zNDUuNzEzLS42MDVhMi43IDIuNyAwIDAgMCAuNDMtLjkzOCA0LjUxIDQuNTEgMCAwIDAgLjE0Ni0xLjE5MWMwLS40MTctLjA1NS0uNzk4LS4xNjYtMS4xNDNhMi40NzggMi40NzggMCAwIDAtLjQ3OC0uODk4IDIuMDUzIDIuMDUzIDAgMCAwLS43OTEtLjU4NiAyLjY3MiAyLjY3MiAwIDAgMC0xLjEwNC0uMjE1Yy0uNTYgMC0uOTg5LjA4MS0xLjI4OS4yNDRhNC4wNDMgNC4wNDMgMCAwIDAtLjgyLjYwNloiLz48L2c+PGRlZnM+PGZpbHRlciBpZD0iYSIgd2lkdGg9IjE5NiIgaGVpZ2h0PSI1MiIgeD0iMiIgeT0iNTQiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUdhdXNzaWFuQmx1ciBpbj0iQmFja2dyb3VuZEltYWdlRml4IiBzdGREZXZpYXRpb249IjMiLz48ZmVDb21wb3NpdGUgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9ImluIiByZXN1bHQ9ImVmZmVjdDFfYmFja2dyb3VuZEJsdXJfMTA0OV8zMjcxIi8+PGZlQmxlbmQgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9iYWNrZ3JvdW5kQmx1cl8xMDQ5XzMyNzEiIHJlc3VsdD0ic2hhcGUiLz48L2ZpbHRlcj48L2RlZnM+PC9zdmc+", |
|||
"description": "Indicates the concentration of airborne allergens, including pollen and mold spores, which can trigger allergic reactions in sensitive individuals.", |
|||
"descriptor": { |
|||
"type": "latest", |
|||
"sizeX": 5, |
|||
"sizeY": 1, |
|||
"resources": [], |
|||
"templateHtml": "<tb-value-card-widget \n [ctx]=\"ctx\"\n [widgetTitlePanel]=\"widgetTitlePanel\">\n</tb-value-card-widget>", |
|||
"templateCss": "", |
|||
"controllerScript": "self.onInit = function() {\n self.ctx.$scope.valueCardWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.valueCardWidget.onDataUpdated();\n};\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n horizontal: true,\n previewWidth: '420px',\n previewHeight: '90px',\n embedTitlePanel: true,\n defaultDataKeysFunction: function() {\n return [{ name: 'IAI_level', label: 'IAI', type: 'timeseries' }];\n }\n };\n};\n\nself.onDestroy = function() {\n};\n", |
|||
"settingsSchema": "", |
|||
"dataKeySettingsSchema": "", |
|||
"settingsDirective": "tb-value-card-widget-settings", |
|||
"hasBasicMode": true, |
|||
"basicModeDirective": "tb-value-card-basic-config", |
|||
"defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"IAI\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.2392660816082064,\"funcBody\":\"var value = prevValue + Math.random() * 10 - 5;\\nif (value < 0) {\\n\\tvalue = 0;\\n} else if (value > 12) {\\n\\tvalue = 12;\\n}\\nreturn value;\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":false,\"backgroundColor\":\"rgba(0, 0, 0, 0)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"labelPosition\":\"top\",\"layout\":\"horizontal\",\"showLabel\":true,\"labelFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\"},\"labelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"colorFunction\":\"var temperature = value;\\nif (typeof temperature !== undefined) {\\n var percent = (temperature + 60)/120 * 100;\\n return tinycolor.mix('blue', 'red', percent).toHexString();\\n}\\nreturn 'blue';\"},\"showIcon\":true,\"iconSize\":40,\"iconSizeUnit\":\"px\",\"icon\":\"mdi:flower-pollen\",\"iconColor\":{\"type\":\"range\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"rangeList\":[{\"from\":0,\"to\":2,\"color\":\"#3FA71A\"},{\"from\":2,\"to\":6,\"color\":\"#80C32C\"},{\"from\":6,\"to\":9,\"color\":\"#F36900\"},{\"from\":9,\"to\":null,\"color\":\"#D81838\"}],\"colorFunction\":\"var temperature = value;\\nif (typeof temperature !== undefined) {\\n var percent = (temperature + 60)/120 * 100;\\n return tinycolor.mix('blue', 'red', percent).toHexString();\\n}\\nreturn 'blue';\"},\"valueFont\":{\"size\":36,\"sizeUnit\":\"px\",\"family\":\"Roboto\",\"weight\":\"500\",\"style\":\"normal\"},\"valueColor\":{\"type\":\"range\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"rangeList\":[{\"from\":0,\"to\":2,\"color\":\"#3FA71A\"},{\"from\":2,\"to\":6,\"color\":\"#80C32C\"},{\"from\":6,\"to\":9,\"color\":\"#F36900\"},{\"from\":9,\"to\":null,\"color\":\"#D81838\"}],\"colorFunction\":\"var temperature = value;\\nif (typeof temperature !== undefined) {\\n var percent = (temperature + 60)/120 * 100;\\n return tinycolor.mix('blue', 'red', percent).toHexString();\\n}\\nreturn 'blue';\"},\"showDate\":true,\"dateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"dateFont\":{\"family\":\"Roboto\",\"size\":12,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\"},\"dateColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.38)\",\"colorFunction\":\"var temperature = value;\\nif (typeof temperature !== undefined) {\\n var percent = (temperature + 60)/120 * 100;\\n return tinycolor.mix('blue', 'red', percent).toHexString();\\n}\\nreturn 'blue';\"},\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}},\"autoScale\":true},\"title\":\"IAI\",\"dropShadow\":true,\"enableFullscreen\":false,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"units\":null,\"decimals\":0,\"useDashboardTimewindow\":true,\"showLegend\":false,\"widgetStyle\":{},\"actions\":{},\"configMode\":\"basic\",\"displayTimewindow\":true,\"margin\":\"0px\",\"borderRadius\":\"0px\",\"widgetCss\":\"\",\"pageSize\":1024,\"noDataDisplayMessage\":\"\",\"showTitleIcon\":false,\"titleTooltip\":\"\",\"titleFont\":{\"size\":12,\"sizeUnit\":\"px\",\"family\":null,\"weight\":null,\"style\":null,\"lineHeight\":\"1.6\"},\"titleIcon\":\"\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"14px\",\"timewindowStyle\":{\"showIcon\":true,\"iconSize\":\"14px\",\"icon\":\"query_builder\",\"iconPosition\":\"left\",\"font\":{\"size\":12,\"sizeUnit\":\"px\",\"family\":null,\"weight\":null,\"style\":null,\"lineHeight\":\"1\"},\"color\":null}}" |
|||
}, |
|||
"externalId": null, |
|||
"tags": [ |
|||
"weather", |
|||
"environment", |
|||
"air", |
|||
"aqi", |
|||
"pollution", |
|||
"emission", |
|||
"smog" |
|||
] |
|||
} |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue