tobiasschuerg/InfluxDB-Client-for-Arduino

Need example for InfluxDB V1 with user/password auth

Derek-K opened this issue · 2 comments

Proposal:
Coming from a very old version of the library, using the original API connecting to InfluxDB v1. the new library doesn't have an example of how to use USERNAME/PASSWORD without v2 or secure connection (for ESP32 only?)
Need an example for backward compatibility

Current behavior:
Unsure how to add username/password for InfluxDB v1 connection using ESP8266

Desired behavior:
Backward compatibility (e.g. support for the original API)

Alternatives considered:
Example showing how to add username/password for InfluxDB v1 without the use of ESP32

Use case:
Way back before I discovered this library I had written custom code HTTPS connection to my InfluxDB v1 for ESP8266. But since then I like to use this library because it is clean and easy to adapt to other projects (even without SSL on ESP8266 is not an issue for some PoC projects)

@Derek-K, The BasicWrite example shows how to connect to InfluxDB 1 in commented-out parts.
Basically:

  • Declare client
 InfluxDBClient client;
  • Set InfluxDB 1params (e.g. in the setup method)
client.setConnectionParamsV1(INFLUXDB_URL, INFLUXDB_DB_NAME, INFLUXDB_USER, INFLUXDB_PASSWORD);

You can use http or https in the InfluxDB URL: http://my-server:8086

Sorry, my bad, missed line 60 and 61 in the example