Skip to content

Commit 309f8a0

Browse files
authored
Merge pull request #99 from bonitoo-io/feat/change_v2_port
feat: changing default v2 port 9999->8086
2 parents c8bea2d + 9c8019c commit 309f8a0

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Supported devices: ESP8266 (2.7+) and ESP32 (1.0.3+).
3232
## Basic code for InfluxDB 2
3333
Using client is very easy. After [seting up InfluxDB 2 server](https://v2.docs.influxdata.com/v2.0/get-started), first define connection parameters and a client instance:
3434
```cpp
35-
// InfluxDB 2 server url, e.g. http://192.168.1.48:9999 (Use: InfluxDB UI -> Load Data -> Client Libraries)
35+
// InfluxDB 2 server url, e.g. http://192.168.1.48:8086 (Use: InfluxDB UI -> Load Data -> Client Libraries)
3636
#define INFLUXDB_URL "influxdb-url"
3737
// InfluxDB 2 server or cloud API authentication token (Use: InfluxDB UI -> Load Data -> Tokens -> <select token>)
3838
#define INFLUXDB_TOKEN "token"
@@ -477,7 +477,7 @@ Complete source code is available in [QueryAggregated example](examples/QueryAgg
477477

478478
// connect to WiFi
479479

480-
Influxdb influx(INFLUXDB_HOST); // port defaults to 8086, use 9999 for v2
480+
Influxdb influx(INFLUXDB_HOST); // port defaults to 8086
481481
// or to use a custom port
482482
Influxdb influx(INFLUXDB_HOST, INFLUXDB_PORT);
483483

@@ -491,7 +491,7 @@ influx.setVersion(2);
491491
influx.setOrg("myOrganization");
492492
influx.setBucket("myBucket");
493493
influx.setToken("myToken");
494-
influx.setPort(9999);
494+
influx.setPort(8086);
495495
```
496496
497497
### Sending a single measurement

examples/BasicWrite/BasicWrite.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ ESP8266WiFiMulti wifiMulti;
2525
// WiFi password
2626
#define WIFI_PASSWORD "password"
2727
// InfluxDB server url. Don't use localhost, always server name or ip address.
28-
// For InfluxDB 2 e.g. http://192.168.1.48:9999 (Use: InfluxDB UI -> Load Data -> Client Libraries),
29-
// For InfluxDB 1 e.g. http://192.168.1.48:8086
28+
// E.g. http://192.168.1.48:8086 (In InfluxDB 2 UI -> Load Data -> Client Libraries),
3029
#define INFLUXDB_URL "influxdb-url"
3130
// InfluxDB 2 server or cloud API authentication token (Use: InfluxDB UI -> Load Data -> Tokens -> <select token>)
3231
#define INFLUXDB_TOKEN "toked-id"

examples/QueryAggregated/QueryAggregated.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ESP8266WiFiMulti wifiMulti;
3535
// InfluxDB 1.8+ (v2 compatibility API) use form user:password, eg. admin:adminpass
3636
#define INFLUXDB_TOKEN "server token"
3737
// InfluxDB v2 organization name or id (Use: InfluxDB UI -> Settings -> Profile -> <name under tile> )
38-
// InfluxDB 1.8+ (v2 compatibility API) leave empty
38+
// InfluxDB 1.8+ (v2 compatibility API) use any non empty string
3939
#define INFLUXDB_ORG "org name/id"
4040
// InfluxDB v2 bucket name (Use: InfluxDB UI -> Load Data -> Buckets)
4141
// InfluxDB 1.8+ (v2 compatibility API) use database name

examples/QueryTable/QueryTable.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ESP8266WiFiMulti wifiMulti;
3535
// InfluxDB 1.8+ (v2 compatibility API) use form user:password, eg. admin:adminpass
3636
#define INFLUXDB_TOKEN "server token"
3737
// InfluxDB v2 organization name or id (Use: InfluxDB UI -> Settings -> Profile -> <name under tile> )
38-
// InfluxDB 1.8+ (v2 compatibility API) leave empty
38+
// InfluxDB 1.8+ (v2 compatibility API) use any non empty string
3939
#define INFLUXDB_ORG "org name/id"
4040
// InfluxDB v2 bucket name (Use: InfluxDB UI -> Load Data -> Buckets)
4141
// InfluxDB 1.8+ (v2 compatibility API) use database name

src/InfluxDbClient.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ class InfluxDBClient {
6767
// db - database name where to store or read data
6868
InfluxDBClient(const char *serverUrl, const char *db);
6969
// Creates InfluxDBClient instance for unsecured connection
70-
// serverUrl - url of the InfluxDB 2 server (e.g. http://localhost:9999)
70+
// serverUrl - url of the InfluxDB 2 server (e.g. http://localhost:8086)
7171
// org - name of the organization, which bucket belongs to
7272
// bucket - name of the bucket to write data into
7373
// authToken - InfluxDB 2 authorization token
7474
InfluxDBClient(const char *serverUrl, const char *org, const char *bucket, const char *authToken);
7575
// Creates InfluxDBClient instance for secured connection
76-
// serverUrl - url of the InfluxDB 2 server (e.g. https://localhost:9999)
76+
// serverUrl - url of the InfluxDB 2 server (e.g. https://localhost:8086)
7777
// org - name of the organization, which bucket belongs to
7878
// bucket - name of the bucket to write data into
7979
// authToken - InfluxDB 2 authorization token
@@ -104,7 +104,7 @@ class InfluxDBClient {
104104
// client.setHTTPOptions(HTTPOptions().httpReadTimeout(20000)).
105105
void setHTTPOptions(const HTTPOptions &httpOptions);
106106
// Sets connection parameters for InfluxDB 2
107-
// serverUrl - url of the InfluxDB 2 server (e.g. https//localhost:9999)
107+
// serverUrl - url of the InfluxDB 2 server (e.g. https//localhost:8086)
108108
// org - name of the organization, which bucket belongs to
109109
// bucket - name of the bucket to write data into
110110
// authToken - InfluxDB 2 authorization token

0 commit comments

Comments
 (0)