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: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,11 @@
2
2
## Version 3.4.0 (in progres)
3
3
### Features
4
4
-[#89](https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/pull/89) - ESP8266 only - Added Max Fragment Length Negotiation for TLS communicaton to reduce memory allocation. If server supports MFLN, it saves ~15kB. Standalone InfluxDB OSS server doesn't support MFLN, Cloud yes. To leverage MFLN for standalone OSS, a reverse proxy needs to be used.
5
+
-[#91](https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/pull/91) - Improved API for settings of write and HTTP options:
6
+
- Introduced `WriteOptions` to wrap the write related options (write precision, batch-size, etc). It offers fluent style API allowing to change only the required options. `InfluxDBClient` has overloaded `setWriteOptions(const WriteOptions& writeOptions)` method.
7
+
- Introduced `HTTPOptions` to wrap the HTTP related options (e.g. reusing connection). It offers fluent style API allowing to change only the required options. `InfluxDBClient` has `setHTTPOptions(const HTTPOptions& httpOptions)` method.
8
+
- Added possibility to set HTTP response read timeout (part of the `HTTPOptions`).
9
+
- Method `InfluxDBClient::void setWriteOptions(WritePrecision precision, uint16_t batchSize = 1, uint16_t bufferSize = 5, uint16_t flushInterval = 60, bool preserveConnection = true)` is deprecated and it will be removed in the next release.
5
10
6
11
### Documentation
7
12
-[#87](https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/pull/87) - Fixed include file name in the Readme
Copy file name to clipboardExpand all lines: README.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,10 +155,10 @@ If points have no timestamp assigned, InfluxDB assigns timestamp at the time of
155
155
156
156
InfuxDB allows sending timestamp in various precisions - nanoseconds, microseconds, milliseconds or seconds. The milliseconds precision is usually enough for using on Arduino. Maximum avavailable precision is microseconds. Setting to nanosecond will just add zeroes for microseconds fraction.
157
157
158
-
The client has to be configured with time precision. The default settings is not using the timestamp. The `setWriteOptions` functions allow setting various parameters and one of them is __write precision__:
158
+
The client has to be configured with a time precision. The default settings is not using the timestamp, which means server will assign timestamp. The `setWriteOptions` functions allow setting custom `WriteOptions` params and one of them is __write precision__:
159
159
``` cpp
160
160
// Set write precision to milliseconds. Leave other parameters default.
When a write precision is configured, the client will automatically assign current time to the timestamp of each written point, which doesn't have a timestamp assigned.
164
164
@@ -220,21 +220,22 @@ For example, if you would like to see updates (on the dashboard or in processing
220
220
221
221
In case that data should be written in longer periods and gathered data consists of several points batch size should be set to an expected number of points.
222
222
223
-
To set batch size we use [setWriteOptions](#write-options) function, where second parameter controls batch size:
223
+
To set batch size we use `WriteOptions` object and [setWriteOptions](#write-options) function:
The third parameter specifies the buffer size. The recommended size is at least 2 x batch size.
255
+
The recommended size is at least 2 x batch size.
255
256
256
257
State of the buffer can be determined via two functions:
257
258
-`isBufferEmpty()` - Returns true if buffer is empty
@@ -278,15 +279,21 @@ Other functions for dealing with buffer:
278
279
Check [SecureBatchWrite example](examples/SecureBatchWrite/SecureBatchWrite.ino) for example code of buffer handling functions.
279
280
280
281
## Write Options
281
-
Writing points can be controlled via several parameters in `setWriteOptions` function:
282
+
Writing points can be controlled via `WriteOptions`, which is set in `setWriteOptions` function:
282
283
283
284
| Parameter | Default Value | Meaning |
284
285
|-----------|---------------|---------|
285
-
| precision | `WritePrecision::NoTime` | Timestamp precision of written data |
286
+
| writePrecision | `WritePrecision::NoTime` | Timestamp precision of written data |
286
287
| batchSize | `1` | Number of points that will be written to the database at once |
287
288
| bufferSize | `5` | Maximum number of points in buffer. Buffer contains new data that will be written to the database and also data that failed to be written due to network failure or server overloading |
288
289
| flushInterval | `60` | Maximum time(in seconds) data will be held in buffer before are written to the db |
289
-
| preserveConnection | `false` | true if underlying HTTP connection should be kept open |
290
+
291
+
## HTTP Options
292
+
`HTTPOptions` controls some aspects of HTTP communication and they are set via `setHTTPOptions` function:
293
+
| Parameter | Default Value | Meaning |
294
+
|-----------|---------------|---------|
295
+
| reuseConnection | `false` | Whether HTTP connection should be kept open after inital communicaton. Usable for frequent writes/queries. |
296
+
| httpReadTimeout | `5000` | Timeout (ms) for reading server response |
290
297
291
298
## Secure Connection
292
299
Connecting to a secured server requires configuring client to trust the server. This is achieved by providing client with a server certificate, certificate authority certificate or certificate SHA1 fingerprint.
INFLUXDB_CLIENT_DEBUG("[D] Flushing buffer: is oversized %s, is timeout %s, is buffer full %s\n", bufferReachedBatchsize?"true":"false",flushTimeout?"true":"false", isBufferFull()?"true":"false");
0 commit comments