You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _includes/docs/user-guide/install/config.md
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -662,6 +662,18 @@ We will list only main configuration parameters below to avoid duplication of th
662
662
<td>604800</td>
663
663
<td>The parameter to specify TTL(Time To Live) value for Debug Events(DEBUG_CONVERTER, DEBUG_INTEGRATION, DEBUG_RULE_NODE, DEBUG_RULE_CHAIN) records. Value set in seconds. 0 - records are never expired. Default value corresponds to one week.</td>
664
664
</tr>
665
+
<tr>
666
+
<td>sql.ttl.rpc.enabled</td>
667
+
<td>SQL_TTL_RPC_ENABLED</td>
668
+
<td>true</td>
669
+
<td>Parameter to enable or disable TTL(Time To Live) for Persistent RPC.</td>
670
+
</tr>
671
+
<tr>
672
+
<td>sql.ttl.rpc.checking_interval</td>
673
+
<td>SQL_RPC_TTL_CHECKING_INTERVAL</td>
674
+
<td>7200000</td>
675
+
<td>Parameter to specify how often TTL(Time To Live) will be checked.</td>
Copy file name to clipboardExpand all lines: _includes/docs/user-guide/rpc.md
+64Lines changed: 64 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,70 @@ This token should belong to either
82
82
83
83
You can use the following [guide](/docs/{{docsPrefix}}reference/rest-api/#rest-api-auth) to get the token.
84
84
85
+
## Persistent RPC
86
+
87
+
Since version 3.3, ThingsBoard provides the new feature: **Persistent RPC**.
88
+
Unlike basic RPC, Persistent RPC has an increased timeout and the command is stored in the database for configurable amount of time.
89
+
Persistent RPC is extremely useful when your device is in power-saving mode.
90
+
Power-saving mode (or PSM) is when the device temporary is turning off to save the battery energy.
91
+
You can set the PSM in the device profile or device configuration. This feature is available for [CoAP](/docs/{{docsPrefix}}reference/coap-api/) and [LWM2M](/docs/{{docsPrefix}}reference/lwm2m-api/) only.
92
+
After you send an RPC request to this device, the request will be saved in the database for the time you configured and the device will receive the request and send the response when it is turned on again.
93
+
In addition, every time you send the Persistent RPC, the response will contain RPC ID. Whenever you need to find a specific RPC and view its states and responses, you can do it with that ID through the database.
94
+
95
+
#### Persistent RPC Configuration
96
+
97
+
To configure parameters for sending a Persistent RPC request, first, you need to edit the ThingsBoard configuration file:
98
+
99
+
```
100
+
sudo nano /etc/thingsboard/conf/thingsboard.conf
101
+
```
102
+
{: .copy-code}
103
+
104
+
Then, add the following lines to the configuration file to add these parameters:
105
+
106
+
```
107
+
export SQL_TTL_RPC_ENABLED=true
108
+
export SQL_RPC_TTL_CHECKING_INTERVAL=7200000
109
+
```
110
+
{: .copy-code}
111
+
112
+
Where:
113
+
114
+
1.**SQL_TTL_RPC_ENABLED** <br>parameter is for configuring whether Persistent RPC data will be removed from the database in case it's outdated.
115
+
116
+
2.**SQL_RPC_TTL_CHECKING_INTERVAL** <br>parameter is for configuring how often Persistent RPC will be checked whether it's outdated. By default, this parameter is set to two hours (in milliseconds).
117
+
118
+
The system administrator can configure the default parameter for the tenants through the Tenant Profile. This is **RPC TTL days configuration** parameter.
119
+
Configuring this parameter will change the number of days when RPC will be deleted from the database. See the screenshot below:
120
+
121
+
{% include images-gallery.html imageCollection="tenant-profile-rpc" %}
122
+
123
+
#### RPC Rule chain events
124
+
125
+
In the Rule chain, you are able to configure events that will be dispatched every time you send an RPC request: RPC queued, RPC delivered, RPC successful, RPC timeout, RPC failed.
{% include images-gallery.html imageCollection="rule-chain" %}
129
+
130
+
#### Persistent RPC States
131
+
132
+
Once you send an RPC, you can observe what exactly happened with the request that you sent in the Rule node events tab.
133
+
RPC states determine steps that happen when you send RPC request. There are five possible states that can occur when the request is sent:
134
+
135
+
**QUEUED** - RPC was saved to the database;
136
+
**DELIVERED** - RPC was delivered to the device (for two-way RPC);
137
+
**SUCCESSFUL** - if RPC is one-way, SUCCESSFUL means that RPC was delivered to the device. If RPC is two-way, SUCCESSFUL means that we've already received response from the device;
138
+
**TIMEOUT** - RPC was not delivered to the device;
139
+
**FAILED** - an error occurred either while sending RPC, or during one of the steps.
140
+
141
+
#### Usage of Persistent RPC
142
+
143
+
To send the Persistent RPC through ThingsBoard, you need to add RPC Debug Terminal widget to your dashboard.
144
+
How to add RPC Debug Terminal and use this widget, you can read [here](/docs/{{docsPrefix}}reference/lwm2m-api/#rpc-commands).
145
+
Then, follow these steps to test the Persistent RPC:
146
+
147
+
{% include images-gallery.html imageCollection="rpc-test" showListImageTitles="true" %}
148
+
85
149
## RPC Rule Nodes
86
150
It is possible to integrate RPC actions into processing workflow. There are 2 Rule Nodes for working with RPC requests.
title: 'Move to the Advanced tab, increase request timeout of RPC and check the box "RPC request persistent" to enable it. Click the orange checkmark icon in the upper corner of the window to apply the changes.'
title: 'Move to the Advanced tab, increase request timeout of RPC and check the box "RPC request persistent" to enable it. Click the orange checkmark icon in the upper corner of the window to apply the changes.'
0 commit comments