It is possible to execute any ThingsBoard Integration remotely from main ThingsBoard Edge instance.
This guide contains step-by-step instructions how to launch ThingsBoard integration remotely.
For example, we will launch HTTP integration and push data over remote HTTP integration to ThingsBoard Edge.
We assume you already have a ThingsBoard Edge instance up and running, and connected to the Server.
ThingsBoard Server configuration steps
Converter and Integration templates are created on the Server, so please log in as Tenant administrator to the Server instance.
Step 1. Create Uplink Converter
Before creating the Integration template, you need to create an Uplink converter template in Converters templates page.
Uplink is necessary in order to convert the incoming data from the device into the required format for displaying them in ThingsBoard Edge.
Click on the ‘plus’ and on ‘Create new converter’. To view the events, enable Debug.
In the function decoder field, specify a script to parse and transform data.
While Debug mode is very useful for development and troubleshooting, leaving it enabled in production mode can significantly increase the disk space used by the database since all the debug data is stored there. It is highly recommended turning the Debug mode off after debugging is complete.
Now that the Uplink converter template has been created, it is possible to create an integration.
Step 3. Save Remote Integration credentials.
Let’s copy-paste the integration key and secret from the integration details, we’ll use them later during Remote integration installation steps.
Step 4. Assign Integration to Edge.
Once converter and integration templates are created, we can assign Integration template to Edge.
Because we are using placeholder ${{remoteHttpIntegrationUrl}} in the integration configuration, we need to add attribute remoteHttpIntegrationUrl to edge first.
You need to provide IP address and port of your HTTP remote integration as remoteHttpIntegrationUrl attribute.
By default, remote HTTP integration uses 8082 port.
We are going to use the same port in the demo, and IP address is going to be set as IP of the machine where remote integration service is going to be started.
Once attribute added, we are ready to assign integration and verify that it’s added.
1. Open Instances menu page. 2. Click on My New Edge.
1. Click Attributes tab. 2. Click ("+") icon to add new attribute.
1. Enter remoteHttpIntegrationUrl attribute. 2. Set the remote value for your HTTP integration http://IP:port. 3. Click Add button.
Open Instances menu page.
Click Manage edge integrations.
Click ("+") icon.
1. Select the target integration. 2. Click Assign button.
Open Edge instance. 1. Open the Integrations menu page 2. Click on HTTP Demo Remote. 3. Check that placeholder is substituted with the value of the attribute.
Remote integration installation steps
Choose your platform and install
One can install ThingsBoard Integration via Docker, Debian or RPM packages.
Please use one of the next steps.
Execute the following command to run the integration:
1
2
3
4
docker run -it-v ~/.tb-pe-http-integration-logs:/var/log/tb-http-integration \-e"RPC_HOST=EDGE_IP_OR_HOST_ADDRESS"-e"RPC_PORT=9090"\-e"INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY"-e"INTEGRATION_SECRET=YOUR_SECRET"\--name my-tb-pe-http-integration --restart always thingsboard/tb-pe-http-integration:3.8.1PE
Where:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-v ~/.tb-pe-http-integration-logs:/var/log/tb-http-integration - mounts the host’s dir ~/.tb-pe-http-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-http-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-http-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
Execute the following command to run the integration:
1
2
3
4
docker run -it-v ~/.tb-pe-mqtt-integration-logs:/var/log/tb-mqtt-integration \-e"RPC_HOST=EDGE_IP_OR_HOST_ADDRESS"-e"RPC_PORT=9090"\-e"INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY"-e"INTEGRATION_SECRET=YOUR_SECRET"\--name my-tb-pe-mqtt-integration --restart always thingsboard/tb-pe-mqtt-integration:3.8.1PE
Where:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-v ~/.tb-pe-mqtt-integration-logs:/var/log/tb-mqtt-integration - mounts the host’s dir ~/.tb-pe-mqtt-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-mqtt-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-mqtt-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
Execute the following command to run the integration:
1
2
3
4
docker run -it-v ~/.tb-pe-opc-ua-integration-logs:/var/log/tb-opc-ua-integration \-e"RPC_HOST=EDGE_IP_OR_HOST_ADDRESS"-e"RPC_PORT=9090"\-e"INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY"-e"INTEGRATION_SECRET=YOUR_SECRET"\--name my-tb-pe-opc-ua-integration --restart always thingsboard/tb-pe-opc-ua-integration:3.8.1PE
Where:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-v ~/.tb-pe-opc-ua-integration-logs:/var/log/tb-opc-ua-integration - mounts the host’s dir ~/.tb-pe-opc-ua-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-opc-ua-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-opc-ua-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-p 10560:10560 - connect local port 10560 to exposed internal 10560 port for the integration. If the exposed port is UDP, add /udp at the end, e.g. -p 11560:11560/udp
-v ~/.tb-pe-tcp-udp-integration-logs:/var/log/tb-tcp-udp-integration - mounts the host’s dir ~/.tb-pe-tcp-udp-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-tcp-udp-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-tcp-udp-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-p 5683:5683/udp - connect local udp port 5683 to exposed internal 5683 udp port for the integration.
-v ~/.tb-pe-coap-integration-logs:/var/log/tb-coap-integration - mounts the host’s dir ~/.tb-pe-coap-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-coap-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-coap-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
1
docker attach tb-pe-coap-integration
To stop the container:
1
docker stop tb-pe-coap-integration
To start the container:
1
docker start tb-pe-coap-integration
Advanced configuration
See configuration yml file below for a list of possible configuration parameters, corresponding environment variables and their default values.
For example, default client id of the integration, that is used in integration debug messages is “remote” and can be altered by setting “RPC_CLIENT_ID” environment variable.
server:
# Server bind address
address: "${HTTP_BIND_ADDRESS:0.0.0.0}"# Server bind port
port: "${HTTP_BIND_PORT:8082}"
integration:
routingKey: "${INTEGRATION_ROUTING_KEY:PUT_YOUR_ROUTING_KEY_HERE}"
secret: "${INTEGRATION_SECRET:PUT_YOUR_SECRET_HERE}"# Allows connection to the localhost resources. For example, local MQTT broker, etc.
allow_local_network_hosts: "${INTEGRATION_ALLOW_LOCAL_NETWORK_HOSTS:true}"
statistics:
# Enable/disable integration statistics
enabled: "${INTEGRATION_STATISTICS_ENABLED:true}"# Send statistics interval. Dfault value is once per hour
persist_frequency: "${INTEGRATION_STATISTICS_PERSIST_FREQUENCY:3600000}"
storage:
# Location of the folder to store data files
data_folder_path: "${INTEGRATION_STORAGE_DATA_FOLDER_PATH:./}"# Max amount of data files to maintain
max_file_count: "${INTEGRATION_STORAGE_MAX_FILE_COUNT:100}"# Max records per data file
max_records_per_file: "${INTEGRATION_STORAGE_MAX_RECORDS_PER_FILE:30}"# Max records between persistence of data file
max_records_between_fsync: "${INTEGRATION_STORAGE_MAX_RECORDS_BETWEEN_FSYNC:100}"# Size of the upload chunk
max_read_records_count: "${INTEGRATION_STORAGE_MAX_READ_RECORDS_COUNT:50}"# Sleep interval while no new records
no_read_records_sleep: "${INTEGRATION_STORAGE_NO_READ_RECORDS_SLEEP:1000}"
executors:
# Size of the thread pool to handle incoming messages and tasks
thread_pool_size: "${EXECUTORS_SIZE:1}"# Timeout to reconnect to ThingsBoard
reconnect_timeout: "${EXECUTORS_RECONNECT_TIMEOUT:3000}"# in milliseconds
rpc:
# Host of the ThingsBoard server
host: "${RPC_HOST:thingsboard.cloud}"# Port of the ThingsBoard server
port: "${RPC_PORT:9090}"# No reply timeouttimeout: "${RPC_TIMEOUT:5}"# Timeout in seconds for channel termination# ID of the RPC client
client_id: "${RPC_CLIENT_ID:remote}"
ssl:
# SSL enabled/disabled
enabled: "${RPC_SSL_ENABLED:false}"# SSL certificate
cert: "${RPC_SSL_CERT:roots.pem}"
js:
evaluator: "${JS_EVALUATOR:local}"# Built-in JVM JavaScript environment propertieslocal:
# Use Sandboxed (secured) JVM JavaScript environment
use_js_sandbox: "${USE_LOCAL_JS_SANDBOX:true}"# Specify thread pool size for JavaScript sandbox resource monitor
monitor_thread_pool_size: "${LOCAL_JS_SANDBOX_MONITOR_THREAD_POOL_SIZE:4}"# Maximum CPU time in milliseconds allowed for script execution
max_cpu_time: "${LOCAL_JS_SANDBOX_MAX_CPU_TIME:5000}"# Maximum allowed JavaScript execution errors before JavaScript will be blacklisted
max_errors: "${LOCAL_JS_SANDBOX_MAX_ERRORS:3}"
service:
type: "${TB_SERVICE_TYPE:tb-integration}"
Troubleshooting
NOTE If you observe errors related to DNS issues, for example
1
127.0.1.1:53: cannot unmarshal DNS message
You may configure your system to use Google public DNS servers.
See corresponding Linux and Mac OS instructions.
Windows users should use docker managed volume for remote integration logs.
Create docker volume (for ex. tb-http-integration-logs) before executing docker run command:
Open “Docker Quickstart Terminal”. Execute the following command to create docker volume:
1
docker volume create tb-pe-http-integration-logs
Execute the following command to run this docker directly:
1
2
3
4
docker run -it-v tb-pe-http-integration-logs:/var/log/tb-http-integration `-e"RPC_HOST=EDGE_IP_OR_HOST_ADDRESS"-e"RPC_PORT=9090"`-e"INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY"-e"INTEGRATION_SECRET=YOUR_SECRET"`--name my-tb-pe-http-integration --restart always thingsboard/tb-pe-http-integration:3.8.1PE
Where:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-v tb-pe-http-integration-logs:/var/log/tb-http-integration - mounts the host’s dir ~/.tb-pe-http-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-http-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-http-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
1
docker attach tb-pe-http-integration
To stop the container:
1
docker stop tb-pe-http-integration
To start the container:
1
docker start tb-pe-http-integration
Windows users should use docker managed volume for remote integration logs.
Create docker volume (for ex. tb-mqtt-integration-logs) before executing docker run command:
Open “Docker Quickstart Terminal”. Execute the following command to create docker volume:
1
docker volume create tb-pe-mqtt-integration-logs
Execute the following command to run this docker directly:
1
2
3
4
docker run -it-v tb-pe-mqtt-integration-logs:/var/log/tb-mqtt-integration `-e"RPC_HOST=EDGE_IP_OR_HOST_ADDRESS"-e"RPC_PORT=9090"`-e"INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY"-e"INTEGRATION_SECRET=YOUR_SECRET"`--name my-tb-pe-mqtt-integration --restart always thingsboard/tb-pe-mqtt-integration:3.8.1PE
Where:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-v tb-pe-mqtt-integration-logs:/var/log/tb-mqtt-integration - mounts the host’s dir ~/.tb-pe-mqtt-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-mqtt-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-mqtt-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
1
docker attach tb-pe-mqtt-integration
To stop the container:
1
docker stop tb-pe-mqtt-integration
To start the container:
1
docker start tb-pe-mqtt-integration
Windows users should use docker managed volume for remote integration logs.
Create docker volume (for ex. tb-opc-ua-integration-logs) before executing docker run command:
Open “Docker Quickstart Terminal”. Execute the following command to create docker volume:
Execute the following command to run this docker directly:
1
2
3
4
docker run -it-v tb-pe-opc-ua-integration-logs:/var/log/tb-opc-ua-integration `-e"RPC_HOST=EDGE_IP_OR_HOST_ADDRESS"-e"RPC_PORT=9090"`-e"INTEGRATION_ROUTING_KEY=YOUR_ROUTING_KEY"-e"INTEGRATION_SECRET=YOUR_SECRET"`--name my-tb-pe-opc-ua-integration --restart always thingsboard/tb-pe-opc-ua-integration:3.8.1PE
Where:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-v tb-pe-opc-ua-integration-logs:/var/log/tb-opc-ua-integration - mounts the host’s dir ~/.tb-pe-opc-ua-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-opc-ua-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-opc-ua-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
1
docker attach tb-pe-opc-ua-integration
To stop the container:
1
docker stop tb-pe-opc-ua-integration
To start the container:
1
docker start tb-pe-opc-ua-integration
Windows users should use docker managed volume for remote integration logs.
Create docker volume (for ex. tb-tcp-udp-integration-logs) before executing docker run command:
Open “Docker Quickstart Terminal”. Execute the following command to create docker volume:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-p 10560:10560 - connect local port 10560 to exposed internal 10560 port for the integration
-v tb-pe-tcp-udp-integration-logs:/var/log/tb-tcp-udp-integration - mounts the host’s dir ~/.tb-pe-tcp-udp-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-tcp-udp-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-tcp-udp-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
1
docker attach tb-pe-tcp-udp-integration
To stop the container:
1
docker stop tb-pe-tcp-udp-integration
To start the container:
1
docker start tb-pe-tcp-udp-integration
Windows users should use docker managed volume for remote integration logs.
Create docker volume (for ex. tb-coap-integration-logs) before executing docker run command:
Open “Docker Quickstart Terminal”. Execute the following command to create docker volume:
1
docker volume create tb-pe-coap-integration-logs
Execute the following command to run this docker directly:
EDGE_IP_OR_HOST_ADDRESS - is the host name or IP address of your ThingsBoard Edge;
9090 - is the integrations port of your ThingsBoard Edge. It is configured in tb-edge.yml using INTEGRATIONS_RPC_PORT env variable;
YOUR_ROUTING_KEY - placeholder for your integration routing key obtained on Step 3;
YOUR_SECRET - placeholder for your integration secret obtained on Step 3;
docker run - run this container;
-it - attach a terminal session with current ThingsBoard remote integration process output;
-p 5683:5683/udp - connect local udp port 5683 to exposed internal 5683 udp port for the integration.
-v tb-pe-coap-integration-logs:/var/log/tb-coap-integration - mounts the host’s dir ~/.tb-pe-coap-integration-logs to ThingsBoard remote integration logs directory;
--name tb-pe-coap-integration - friendly local name of this machine;
--restart always - automatically start ThingsBoard Integration in case of system reboot and restart in case of failure.;
After executing this command you can open logs which are located here ~/.tb-pe-coap-integration-logs.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
You can detach from session terminal with Ctrl-p+Ctrl-q - the container will keep running in the background.
Reattaching, stop and start commands
To reattach to the terminal (to see ThingsBoard remote integration logs) run:
1
docker attach tb-pe-coap-integration
To stop the container:
1
docker stop tb-pe-coap-integration
To start the container:
1
docker start tb-pe-coap-integration
Advanced configuration
See configuration yml file below for a list of possible configuration parameters, corresponding environment variables and their default values.
For example, default client id of the integration, that is used in integration debug messages is “remote” and can be altered by setting “RPC_CLIENT_ID” environment variable.
server:
# Server bind address
address: "${HTTP_BIND_ADDRESS:0.0.0.0}"# Server bind port
port: "${HTTP_BIND_PORT:8082}"
integration:
routingKey: "${INTEGRATION_ROUTING_KEY:PUT_YOUR_ROUTING_KEY_HERE}"
secret: "${INTEGRATION_SECRET:PUT_YOUR_SECRET_HERE}"# Allows connection to the localhost resources. For example, local MQTT broker, etc.
allow_local_network_hosts: "${INTEGRATION_ALLOW_LOCAL_NETWORK_HOSTS:true}"
statistics:
# Enable/disable integration statistics
enabled: "${INTEGRATION_STATISTICS_ENABLED:true}"# Send statistics interval. Dfault value is once per hour
persist_frequency: "${INTEGRATION_STATISTICS_PERSIST_FREQUENCY:3600000}"
storage:
# Location of the folder to store data files
data_folder_path: "${INTEGRATION_STORAGE_DATA_FOLDER_PATH:./}"# Max amount of data files to maintain
max_file_count: "${INTEGRATION_STORAGE_MAX_FILE_COUNT:100}"# Max records per data file
max_records_per_file: "${INTEGRATION_STORAGE_MAX_RECORDS_PER_FILE:30}"# Max records between persistence of data file
max_records_between_fsync: "${INTEGRATION_STORAGE_MAX_RECORDS_BETWEEN_FSYNC:100}"# Size of the upload chunk
max_read_records_count: "${INTEGRATION_STORAGE_MAX_READ_RECORDS_COUNT:50}"# Sleep interval while no new records
no_read_records_sleep: "${INTEGRATION_STORAGE_NO_READ_RECORDS_SLEEP:1000}"
executors:
# Size of the thread pool to handle incoming messages and tasks
thread_pool_size: "${EXECUTORS_SIZE:1}"# Timeout to reconnect to ThingsBoard
reconnect_timeout: "${EXECUTORS_RECONNECT_TIMEOUT:3000}"# in milliseconds
rpc:
# Host of the ThingsBoard server
host: "${RPC_HOST:thingsboard.cloud}"# Port of the ThingsBoard server
port: "${RPC_PORT:9090}"# No reply timeouttimeout: "${RPC_TIMEOUT:5}"# Timeout in seconds for channel termination# ID of the RPC client
client_id: "${RPC_CLIENT_ID:remote}"
ssl:
# SSL enabled/disabled
enabled: "${RPC_SSL_ENABLED:false}"# SSL certificate
cert: "${RPC_SSL_CERT:roots.pem}"
js:
evaluator: "${JS_EVALUATOR:local}"# Built-in JVM JavaScript environment propertieslocal:
# Use Sandboxed (secured) JVM JavaScript environment
use_js_sandbox: "${USE_LOCAL_JS_SANDBOX:true}"# Specify thread pool size for JavaScript sandbox resource monitor
monitor_thread_pool_size: "${LOCAL_JS_SANDBOX_MONITOR_THREAD_POOL_SIZE:4}"# Maximum CPU time in milliseconds allowed for script execution
max_cpu_time: "${LOCAL_JS_SANDBOX_MAX_CPU_TIME:5000}"# Maximum allowed JavaScript execution errors before JavaScript will be blacklisted
max_errors: "${LOCAL_JS_SANDBOX_MAX_ERRORS:3}"
service:
type: "${TB_SERVICE_TYPE:tb-integration}"
Troubleshooting
NOTE If you observe errors related to DNS issues, for example
ThingsBoard service is running on Java 17. Follow this instructions to install OpenJDK 17:
1
2
sudo apt update
sudo apt install openjdk-17-jdk
Please don’t forget to configure your operating system to use OpenJDK 17 by default.
You can configure which version is the default using the following command:
1
sudo update-alternatives --config java
You can check the installation using the following command:
1
java -version
Expected command output is:
1
2
3
openjdk version "17.x.xx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (...)
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-http-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-http-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-mqtt-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-mqtt-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-opc-ua-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-opc-ua-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-tcp-udp-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-tcp-udp-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-coap-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-coap-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
CentOS/RHEL Server
Install Java 17 (OpenJDK)
ThingsBoard service is running on Java 17. Follow this instructions to install OpenJDK 17:
1
sudo dnf install java-17-openjdk
Please don’t forget to configure your operating system to use OpenJDK 17 by default.
You can configure which version is the default using the following command:
1
sudo update-alternatives --config java
You can check the installation using the following command:
1
java -version
Expected command output is:
1
2
3
openjdk version "17.x.xx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (build ...)
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-http-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-http-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-mqtt-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-mqtt-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-opc-ua-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-opc-ua-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-tcp-udp-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-tcp-udp-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:# export RPC_HOST=thingsboard.cloud# export RPC_PORT=9090# export INTEGRATION_ROUTING_KEY=YOUR_INTEGRATION_KEY# export INTEGRATION_SECRET=YOUR_INTEGRATION_SECRET
and put your configuration parameters. Please don’t forget to uncomment the export statement. See example below:
1
2
3
4
5
# UNCOMMENT NEXT LINES AND PUT YOUR CONNECTION PARAMETERS:export RPC_HOST=192.168.1.1 # YOUR EDGE INSTANCE IP ADDRESSexport RPC_PORT=9090
export INTEGRATION_ROUTING_KEY=b75**************************34d
export INTEGRATION_SECRET=vna**************mik
Execute the following command to start ThingsBoard integration:
1
sudo service tb-coap-integration start
Advanced configuration
Once can lookup additional configuration parameters inside the yml configuration file.
Open the file for editing using the following command:
After executing this command you can open logs which are located here /var/log/tb-coap-integration/.
You should see some INFO log messages with your latest Integration configuration that arrived from the server.
Remote HTTP integration validation
To send an uplink message, you need HTTP endpoint URL from the integration.
Let’s log in to ThingsBoard Edge and go to the Integrations page.
Find your HTTP integration and click on it. There you can find the HTTP endpoint URL. Click on the icon to copy the url.
Important! Please make sure that your machine is able to access machine where remote HTTP integration is running, and port 8082 is not blocked by any firewall rules.
Use this command to send the message. Replace $DEVICE_NAME and $YOUR_HTTP_ENDPOINT_URL with corresponding values.
The created device with data can be seen in the section Device groups -> All on the Edge:
Remote integration configuration
Remote integration configuration is done via ThingsBoard UI and there is no specific steps.
Explore guides and video tutorials related to specific integrations:
Please review the log files. Their location is specific to the platform and installation package you have used and is mentioned in the installation steps.
Next steps
Getting started guide - Provide quick overview of main ThingsBoard Edge features. Designed to be completed in 15-30 minutes:
Installation guides - Learn how to setup ThingsBoard Edge on various available operating systems and connect to ThingsBoard CE server.