Skip to content

Commit 409c7b2

Browse files
authored
Merge pull request thingsboard#1320 from samson0v/gateway/general
Gateway/general
2 parents d906cca + b8cf28d commit 409c7b2

File tree

5 files changed

+99
-100
lines changed

5 files changed

+99
-100
lines changed

_includes/templates/iot-gateway/ftp-connector-basic-security-config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
One type of security configuration is basic,
3-
For authorization will be used combination of username/password, provided in this section in config.
2+
One type of security configuration is basic.
3+
For authorization, a combination of username and password provided in this section's config will be used.
44

55

66
|**Parameter**|**Default value**|**Description**|

_includes/templates/iot-gateway/remote-creating-connector-mqtt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ package manager of your operating system:
166166
167167
2.Use the mosquitto_pub command to publish data to a specific MQTT topic. In this case, we'll use the "data/" topic as defined in the configuration:
168168
```bash
169-
mosquitto_pub -h locahost -p 1884 -t data/ -m '{"frequency": 50, "power": 100, "temperature": 25, "humidity": 60}'
169+
mosquitto_pub -h localhost -p 1884 -t data/ -m '{"frequency": 50, "power": 100, "temperature": 25, "humidity": 60}'
170170
```
171171
{:.copy-code}
172172

docs/iot-gateway/config/ftp.md

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ description: FTP protocol support for ThingsBoard IoT Gateway
1010

1111
This guide will help you to get familiar with FTP Connector configuration for ThingsBoard IoT Gateway.
1212
Use [general configuration](/docs/iot-gateway/configuration/) to enable this Connector.
13-
The purpose of this Connector is to connect to external FTP server and get data from files from specific paths.
14-
Connector is also able to push data to FTP server files based on the updates/commands from ThingsBoard.
13+
The purpose of this Connector is to connect to an external FTP server and get data from files from specific paths.
14+
The connector is also able to push data to FTP server files based on the updates/commands from ThingsBoard.
1515

16-
This connector is useful when you have some FTP server in your device or some data in external resource and you would like to push this data to the ThingsBoard.
16+
This connector is useful when you have some FTP server in your device or some data in an external resource and you would like to push this data to the ThingsBoard.
1717

18-
We will describe connector configuration file below.
18+
We will describe the connector configuration file below.
1919

2020
## Connector configuration: ftp.json
2121

22-
Connector configuration is a JSON file that contains information about how to connect to external FTP server, what paths to use when reading data and how to process the data.
23-
Let's review the format of the configuration file using example below.
22+
Connector configuration is a JSON file that contains information about how to connect to an external FTP server, what paths to use when reading data, and how to process the data.
23+
Let's review the format of the configuration file using the example below.
2424

2525
<b>Example of FTP Connector config file.</b>
2626

27-
Example listed below will connect to FTP server in a local network deployed on server with IP 0.0.0.0.
28-
Connector will use basic FTP auth using username and password.
29-
Then, connector will subscribe to a list of paths from mapping section. See more info in a description below.
27+
The example listed below will connect to FTP server in a local network deployed on server with IP 0.0.0.0.
28+
The connector will utilize basic FTP auth using username and password.
29+
Then, connector will subscribe to a list of paths from the mapping section. See more info in the description below.
3030

3131
{% capture ftpConf %}
3232

@@ -101,11 +101,11 @@ Then, connector will subscribe to a list of paths from mapping section. See more
101101

102102
### General section
103103

104-
| **Parameter** | **Default value** | **Description** |
105-
|:-|:-|-
106-
| host | **localhost** | Domain address or ip of the server. |
107-
| port | **21** | Port of the server |
108-
| TLSSupport | **true** | Verify or no TLS support on the server if available. |
104+
| **Parameter** | **Default value** | **Description** |
105+
|:-|:-|--------------------------------------------------------
106+
| host | **localhost** | Domain address or ip of the server. |
107+
| port | **21** | Port of the server. |
108+
| TLSSupport | **true** | Verify whether TLS support is available on the server. |
109109
|---
110110

111111
#### Subsection "security"
@@ -120,42 +120,42 @@ Anonymous<small>No security</small>%,%anonymous%,%templates/iot-gateway/ftp-conn
120120

121121
### Section "paths"
122122

123-
This configuration section contains array of objects with paths that the gateway will try to read after connecting to the server.
124-
Also this section contains settings about processing incoming messages (converter).
123+
This configuration section contains an array of objects with paths that the gateway will try to read after connecting to the server.
124+
Also, this section contains settings for processing incoming messages (converter).
125125

126126
|**Parameter**|**Default value**|**Description**|
127127
|:-|:-|-
128128
| path | **data/log.txt** | Path to file for reading data. |
129129
|---
130130

131-
**Note** Make sure that your file extension is one of the supporting extensions by FTP connector (.txt, .json, .csv)
131+
**Note** Make sure that your file extension is one of the supported extensions by FTP connector (.txt, .json, .csv)
132132

133-
The **path** supports special symbols: '*' to allow to subscribe to multiple paths and files.
134-
Let's look to another example of using **path** parameter:
133+
The **path** supports special symbols, such as '*' to allow subscription to multiple paths and files.
134+
Let's look at another example of using **path** parameter:
135135

136136
|**Example Name**|**Path**|**Comments**|
137137
|:-|:-|:-|-
138138
| Example 1 | data/log.txt | Read data from one file (if it exists) |
139-
| Example 2 | data/*/log.txt | Read all log.txt files from all folders that contained data folder |
140-
| Example 3 | data/\*/\*_log.txt | Read all files that name contain _log.txt from all folders that contained data folder |
141-
| Example 3 | data/\*.\* | Read all files with all supporting extensions that included in data folder |
139+
| Example 2 | data/*/log.txt | Read all log.txt files from all folders that contain data folder |
140+
| Example 3 | data/\*/\*_log.txt | Read all files that name containing _log.txt from all folders that contain data folder |
141+
| Example 3 | data/\*.\* | Read all files with all supported extensions that are included in data folder |
142142
|---
143143

144144
Now let's review another required parameter in path section.
145145

146146
|**Parameter**|**Available value**|**Description**|
147147
|:-|:-|:-|-
148-
| delimiter | , | Symbol that will use to split the data in file |
149-
| readMode | FULL/PARTIAL | If parameter is equal to FULL, file will be reading from the start to the end. If parameter is equal to PARTIAL, file will be read from the line that was reading at the previous time |
150-
| maxFileSize | 5 | The max file size in MB that will be reading (if file size is more than 5 MB, it will be passed) |
151-
| pollPeriod | 60 | The period of time (in seconds) that files in the path will be reading |
148+
| delimiter | , | Symbol that will be used to split the data in the file |
149+
| readMode | FULL/PARTIAL | If parameter is equal to FULL, the file will be read from the start to the end. If parameter is equal to PARTIAL, the file will be read from the line that was previously being read |
150+
| maxFileSize | 5 | The max file size in MB that will be read (if file size is more than 5 MB, it will be skipped) |
151+
| pollPeriod | 60 | The period of time (in seconds) during which files in the path will be read |
152152
| txtFileDataView | TABLE/SLICED | The txtFileDataView parameter is used only for .txt files |
153-
| withSortingFiles | true/false | Is how the found files in path will append to array |
153+
| withSortingFiles | true/false | This is how the found files in path will be appended to the array |
154154
| attributes | | This subsection contains parameters of the incoming message, that will be interpreted as attributes for the device. |
155155
| timeseries | | This subsection contains parameters of the incoming message, that will be interpreted as telemetry for the device. |
156156
|---
157157

158-
Let's look how we can configure this section for different file extensions:
158+
Let's look at how we can configure this section for different file extensions:
159159

160160

161161
1. For .txt with TABLE data view and .csv files
@@ -194,7 +194,7 @@ Let's look how we can configure this section for different file extensions:
194194
]
195195
```
196196

197-
That mean that FTP converter will look for the next file structure:
197+
That means that FTP converter will look for the following file structure:
198198
```txt
199199
temp,hum
200200
1,2
@@ -278,7 +278,7 @@ Let's look how we can configure this section for different file extensions:
278278
}
279279
]
280280
```
281-
4. Combine attributes, telemetry and serverSideRpc section, for example .json file:
281+
4. Combine attributes, telemetry, and serverSideRpc section, for example, in a .json file:
282282
```json
283283
"paths": [
284284
{
@@ -316,19 +316,19 @@ Let's look how we can configure this section for different file extensions:
316316

317317

318318
This configuration section is optional.
319-
ThingsBoard allows to provision device attributes and fetch some of them from the device application. You can treat this as a remote configuration for devices. Your devices are able to request shared attributes from ThingsBoard. See user guide for more details.
319+
ThingsBoard allows the provisioning of device attributes and fetches some of them from the device application. You can treat this as a remote configuration for devices, enabling them to request shared attributes from ThingsBoard. See [user guide](/docs/user-guide/attributes/) for more details.
320320

321-
The “attributeRequests” configuration allows configuring the format of the corresponding attribute data that will be written to the specific files.
321+
The “attributeRequests” configuration allows you to configure the format of the corresponding attribute data that will be written to the specific files.
322322

323-
| **Parameter** | **Default value** | **Description** |
324-
|:-|:-|-
325-
| path | **fol/${attributeKey}/${attributeValue}.txt** | JSON-path expression that uses for finding specific files |
326-
| deviceNameFilter | **.\*** | Regular expression device name filter, uses to determine, which function to execute. |
327-
| writingMode | **OVERRIDE/WRITE** | If writingMode is equal to OVERRIDE, the found files will we overwrite. If writingMode is equal to WRITE, a new data will be appended at the end of found files |
328-
| valueExpression | **,,,,${attributeKey},,,${attributeValue}** | Expression uses for creating the message data that will send to FTP server. In this case ',' has a role as the delimiter and before him, you can insert your data. |
323+
| **Parameter** | **Default value** | **Description** |
324+
|:-|:-|------------------------------------------------------------------------------------------------------------------------------------------------------------------------
325+
| path | **fol/${attributeKey}/${attributeValue}.txt** | JSON-path expression that is used for finding specific files |
326+
| deviceNameFilter | **.\*** | Regular expression device name filter, used to determine, which function to execute. |
327+
| writingMode | **OVERRIDE/WRITE** | If writingMode is equal to OVERRIDE, the found files will be overwritten. If writingMode is equal to WRITE, new data will be appended at the end of the found files. |
328+
| valueExpression | **,,,,${attributeKey},,,${attributeValue}** | Expression is used for creating the message data that will be sent to FTP server. In this case, ',' serves as the delimiter and you can insert your data before it. |
329329
|---
330330

331-
This section in configuration file looks like:
331+
This section in configuration file looks like this:
332332

333333
```json
334334
"attributeUpdates": [
@@ -343,18 +343,18 @@ This section in configuration file looks like:
343343

344344
### Server side RPC commands
345345

346-
ThingsBoard allows sending RPC commands to the device that is connected to ThingsBoard directly or via Gateway.
346+
ThingsBoard allows for sending RPC commands to devices connected directly to ThingsBoard or via Gateway.
347347

348348
Configuration, provided in this section uses for sending RPC requests from ThingsBoard to device.
349349

350-
| **Parameter** | **Default value** | **Description** |
351-
|:-|:-|-
352-
| deviceNameFilter | **.\*** | Regular expression device name filter, uses to determine, which function to execute. |
353-
| methodFilter | **read/write** | Mode for opening file |
354-
| valueExpression | **,,,,${attributeKey},,,${attributeValue}** | JSON-path expression, uses for creating data for sending to FTP server, if methodFilter equal to write. If methodFilter is equal to read, this field will be passing. |
350+
| **Parameter** | **Default value** | **Description** |
351+
|:-|:-|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
352+
| deviceNameFilter | **.\*** | Regular expression device name filter, used to determine, which function to execute. |
353+
| methodFilter | **read/write** | Mode for opening file |
354+
| valueExpression | **,,,,${attributeKey},,,${attributeValue}** | JSON-path expression, is used to create data for sending to FTP server, if methodFilter is equal to write. If methodFilter is equal to read, this field will be passing. |
355355
|---
356356

357-
This section in configuration file looks like:
357+
This section in configuration file looks like this:
358358

359359
```json
360360
"serverSideRpc": [

0 commit comments

Comments
 (0)