How to enable remote shell feature on ThingsBoard IoT Gateway

This guide will help you to enable remote shell feature and control operation system with ThingsBoard IoT Gateway from your ThingsBoard platform instance.
For purpose of this guide, we will use following things:

  1. Instance of ThingsBoard platform (How to install you can read here). For this guide we will use demo.thingsboard.io
  2. Installed and configured ThingsBoard IoT Gateway (How to install you can read here).

    Step 1. Remote shell activation

  • To activate remote shell in ThingsBoard IoT Gateway you should add or change parameter remoteShell to true in the section thingsboard in the general configuration file (tb_gateway.yaml).


{: style=”color:red” } WARNING: This feature can cause security problems for your device, we strongly recommend using it with ssl encryption only and not enabling it if you don’t need it.

  • Restart the gateway with the new configuration.

Example of the thingsboard section in the general configuration file:

  1. thingsboard:
  2. host: demo.thingsboard.io
  3. port: 1883
  4. remoteShell: true
  5. remoteConfiguration: false
  6. security:
  7. accessToken: PUT_YOUR_GW_ACCESS_TOKEN_HERE

Step 2. Create a dashboard to use the remote shell

To use the remote shell we have to use the widget RPC remote shell from Control widget bundle. To do this we use following steps:

  • Open Dashboards tab:

Remote shell - 图1

  • We will add a new dashboard:

Remote shell - 图2

  • Open created dashboard, open edit mode by pencil button and add new widget:

Remote shell - 图3

  • Select widget budle “Control widgets”:

Remote shell - 图4

  • Scroll down and select RPC remote shell widget:

Remote shell - 图5

  • We haven’t specify the entity type for the widget so we will Create a new one:

Remote shell - 图6

  • We have to fill required fields and same the entity. Gateway - is our gateway device:

Remote shell - 图7

  • To prevent TimeoutException, we will increase the default RPC command timeout to 5000 milliseconds in the advanced settings tab and press ADD and check mark icon to save the dashboard:

Remote shell - 图8

  • The connected widget looks like (Connection setups automatically):

Remote shell - 图9

  • Now you can use the shell to control device with the gateway. For example we run ls command to get the list of files and directories in the current directory.

Remote shell - 图10

Next steps

Explore guides related to main ThingsBoard features: