ESP32/ESP8266: Send BME280 Sensor Readings to InfluxDB

In this guide, you’ll learn how to send BME280 sensor readings to InfluxDB using the ESP32 or ESP8266 boards. InfluxDB is a time series database. Each record on the database is associated with a timestamp, which makes it ideal for datalogging IoT and Home Automation projects. InfluxDB also provides dashboard tools to visualize data in different formats like charts, gauges, histograms, etc.

ESP32 ESP8266 NodeMCU Send BME280 Sensor Readings to InfluxDB

By the end of this tutorial, you’ll be able to build a dashboard as shown below to display all your sensor readings over time.

ESP32 ESP8266 Sensor Readings Dashboard InfluxDB

To get started with InfluxDB, read one of the following guides:

What is InfluxDB?

influxdb what it is

InfluxDB is an open-source high-performance time series database (TSDB) that can store large amounts of data per second. Each data point you submit to the database is associated with a particular timestamp. So, it is ideal for IoT datalogging projects like storing data from your weather station sensors.

You can run InfluxDB in InfluxDB Cloud, or locally on your laptop or Raspberry Pi.

Why use InfluxDB Cloud? It’s a fast, elastic, serverless real-time monitoring platform, dashboarding engine, analytics service and event and metrics processor.”

https://www.influxdata.com/products/influxdb-cloud/

For a more in-depth introduction to InfluxDB, check the following tutorials before proceeding:

  • ESP32: Getting Started with InfluxDB
  • ESP8266: Getting Started with InfluxDB

Creating an InfluxDB Account

If you don’t have an InfluxDB account, follow the next steps. If you already have an account, you can skip to the next section.

If you want to run InfluxDB locally on a Raspberry Pi, follow the next tutorial first: Install InfluxDB 2 on Raspberry Pi. Then, proceed to the Loading Data in InfluxDB section.

1) Go to https://cloud2.influxdata.com/signup and create an InfluxDB account.

Creating an InfluxDB Account

2) Select where you want to save your data. I selected the Google Cloud option, but you can select one of the other options. Select the region, it should be the closest to your location. Then, enter something on the Company Name field, and agree to the terms before proceeding.

InfluxDB select provider

3) Select the InfluxDB plan. For this example, we’ll be using the Free plan. For most of our IoT projects, the Free plan works just fine.

InfluxDB select plan

4) After selecting the plan, you’ll be redirected to the Getting Started page.

InfluxDB Getting Started Page

Loading Data in InfluxDB

5) Click on LOAD YOUR DATA. To go to that menu, you can also click on the icon with an up-arrow and then on Sources.

6) Scroll down until you find the Arduino option under the Client Libraries section.

InfluxDB Load Data Arduino Client

The page that opens allows you to create buckets, and it also shows some sample code to interface the ESP8266 or ESP32 boards with InfluxDB.

InfluxDB Load Data Arduino

Creating an InfluxDB Bucket

7) You can use the default bucket, or create a new bucket. We’ll create a new one. Click on + Create Bucket to create a new bucket for this example. You can change the settings by default, or you can customize them.

Creating an InfluxDB Bucket

In InfluDB, a bucket is named location where the time series data is stored. All buckets have a retention period—it defines the duration of time that a bucket retains data. Points with timestamps older than the retention period are dropped. With the free cloud plan, you can save data for up to 30 days.

Getting InfluxDB URL

8) Get your InfluxDB URL* and other details you’ll need later. Scroll down to the Initialize the Client snippet. Then, copy the INFLUXDB_URL, INFLUX_DB_ORG, and INFLUX_DB_BUCKET.

InfluxDB Initialize Arduino Client

* if you’re running InfluxDB locally on a Raspberry Pi, the URL will be the Raspberry Pi IP address on port 8086. For example 192.168.1.106:8086.

Generate an API Token

Now, you need to generate an API token so that your devices can write and/or read to your bucket. If you already have an API token from a previous project, you can use it.

9) Select the up-arrow icon and click on API Tokens.

InfluxDB API Tokens Menu

10) Click on + Generate API Token > All Access API Token.

InfluxDB Generate All Access API Token

11) Give a description that identifies that API token.

InfluxDB Generate API Token

12) A new window with your API token will show up. Copy the API Token to a safe place because you’ll need it later. You won’t be able to see the API token again!

InfluxDB API Token Generator

At this moment, you should have saved the following:

  • InfluxDB Server URL
  • InfluxDB Organization
  • InfluxDB Bucket Name
  • API Token

ESP32/ESP8266 Send Sensor Readings to InfluxDB

In this section, we’ll program the ESP32 and ESP8266 boards to send BME280 temperature, humidity, and pressure readings to InfluxDB.

Parts Required

For this project, you need the following parts*:

* you can also test the project with random values instead of sensor readings, or you can use any other sensor you’re familiar with.

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Schematic Diagram

In this tutorial, we’ll send BME280 sensor readings to InfluxDB. So, you need to wire the BME280 sensor to your board. Follow one of the next schematic diagrams.

ESP32 with BME280

We’re going to use I2C communication with the BME280 sensor module. Wire the sensor to the default ESP32 SCL (GPIO 22) and SDA (GPIO 21) pins, as shown in the following schematic diagram.

ESP32 BME280 Sensor Temperature Humidity Pressure Wiring Diagram Circuit

Not familiar with the BME280 with the ESP32? Read this tutorial: ESP32 with BME280 Sensor using Arduino IDE (Pressure, Temperature, Humidity).

ESP8266 with BME280

We’re going to use I2C communication with the BME280 sensor module. For that, wire the sensor to the ESP8266 SDA (GPIO 4) and SCL (GPIO 5) pins, as shown in the following schematic diagram.

ESP8266 NodeMCU BME280 Sensor Temperature Humidity Pressure Wiring Diagram Circuit

Not familiar with the BME280 with the ESP8266? Read this tutorial: ESP8266 with BME280 using Arduino IDE (Pressure, Temperature, Humidity).

Installing Libraries

For this project, you need to install the following libraries:

Installation – Arduino IDE

If you’re using Arduino IDE, follow the next steps to install the library.

  1. Go to Sketch Include Library > Manage Libraries
  2. Search for InfluxDB and install the ESP8266 Influxdb library by Tobias Shürg.
Install InfluxDB Library Arduino IDE

Note: we are using ESP8266 Boards version 3.0.1 and ESP32 Boards version 2.0.1 Check your boards’ version in Tools > Board > Boards Manager. Then, search for ESP8266 or ESP32 and upgrade to one of those versions. (I found some issues with the newest 3.0.2 and 2.0.2 versions)

  1. Follow the same instructions to install the Adafruit BME280 Library and Adafruit Unified Sensor Library.

Installation – VS Code

If you’re using VS Code with the PlatformIO extension, start by creating an Arduino project for your ESP32 or ESP8266 board.

Then, click on the PIO Home icon and then select the Libraries tab. Search for “influxdb“. Select the ESP8266 Influxdb by Tobias Schürg.

Install InfluxDB library VS Code

Follow the same procedure for the Adafruit BME280 library and Adafruit Unified Sensor library.

Your plaformio.ini file should look as follows (we also added a line to change the Serial Monitor baud rate to 115200).

monitor_speed = 115200
lib_deps = 
	tobiasschuerg/ESP8266 [email protected]^3.12.0
	adafruit/Adafruit BME280 [email protected]^2.2.2
	adafruit/Adafruit Unified [email protected]^1.1.5

Send Sensor Readings to InfluxDB—Code

Copy the following code to the Arduino IDE or to the main.cpp file if you’re using VS Code with the PlatformIO extension. The code is compatible with both the ESP32 and ESP8266 boards.

This code is based on this library example. We made a few modifications to include the BME280 sensor readings.

/*
  Rui Santos
  Complete project details at our blog: https://RandomNerdTutorials.com/
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/
// Based on this library example: https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/blob/master/examples/SecureBatchWrite/SecureBatchWrite.ino

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#if defined(ESP32)
  #include <WiFiMulti.h>
  WiFiMulti wifiMulti;
  #define DEVICE "ESP32"
#elif defined(ESP8266)
  #include <ESP8266WiFiMulti.h>
  ESP8266WiFiMulti wifiMulti;
  #define DEVICE "ESP8266"
  #define WIFI_AUTH_OPEN ENC_TYPE_NONE
#endif

#include <InfluxDbClient.h>
#include <InfluxDbCloud.h>

// WiFi AP SSID
#define WIFI_SSID "REPLACE_WITH_YOUR_SSID"
// WiFi password
#define WIFI_PASSWORD "REPLACE_WITH_YOUR_PASSWORD"
// InfluxDB v2 server url, e.g. https://eu-central-1-1.aws.cloud2.influxdata.com (Use: InfluxDB UI -> Load Data -> Client Libraries)
#define INFLUXDB_URL "REPLACE_WITH_YOUR_DATABASE_URL"
// InfluxDB v2 server or cloud API authentication token (Use: InfluxDB UI -> Load Data -> Tokens -> <select token>)
#define INFLUXDB_TOKEN "REPLACE_WITH_YOUR_TOKEN"
// InfluxDB v2 organization id (Use: InfluxDB UI -> Settings -> Profile -> <name under tile> )
#define INFLUXDB_ORG "REPLACE_WITH_YOUR_ORG"
// InfluxDB v2 bucket name (Use: InfluxDB UI -> Load Data -> Buckets)
#define INFLUXDB_BUCKET "SENSOR"
// Set timezone string according to https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
// Examples:
//  Pacific Time:   "PST8PDT"
//  Eastern:        "EST5EDT"
//  Japanesse:      "JST-9"
//  Central Europe: "CET-1CEST,M3.5.0,M10.5.0/3"
#define TZ_INFO "WET0WEST,M3.5.0/1,M10.5.0"

// InfluxDB client instance with preconfigured InfluxCloud certificate
InfluxDBClient client(INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN, InfluxDbCloud2CACert);
// InfluxDB client instance without preconfigured InfluxCloud certificate for insecure connection 
//InfluxDBClient client(INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN);

// Data point
Point sensorReadings("measurements");

//BME280
Adafruit_BME280 bme; // I2C

float temperature;
float humidity;
float pressure;

// Initialize BME280
void initBME(){
  if (!bme.begin(0x76)) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }
}

void setup() {
  Serial.begin(115200);

  // Setup wifi
  WiFi.mode(WIFI_STA);
  wifiMulti.addAP(WIFI_SSID, WIFI_PASSWORD);

  Serial.print("Connecting to wifi");
  while (wifiMulti.run() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println();
  
  //Init BME280 sensor
  initBME();
  
  // Add tags
  sensorReadings.addTag("device", DEVICE);
  sensorReadings.addTag("location", "office");
  sensorReadings.addTag("sensor", "bme280");

  // Accurate time is necessary for certificate validation and writing in batches
  // For the fastest time sync find NTP servers in your area: https://www.pool.ntp.org/zone/
  // Syncing progress and the time will be printed to Serial.
  timeSync(TZ_INFO, "pool.ntp.org", "time.nis.gov");

  // Check server connection
  if (client.validateConnection()) {
    Serial.print("Connected to InfluxDB: ");
    Serial.println(client.getServerUrl());
  } else {
    Serial.print("InfluxDB connection failed: ");
    Serial.println(client.getLastErrorMessage());
  }
}

void loop() {
  // Get latest sensor readings
  temperature = bme.readTemperature();
  humidity = bme.readHumidity();
  pressure = bme.readPressure()/100.0F;

  // Add readings as fields to point
  sensorReadings.addField("temperature", temperature);
  sensorReadings.addField("humidity", humidity);
  sensorReadings.addField("pressure", pressure);

  // Print what are we exactly writing
  Serial.print("Writing: ");
  Serial.println(client.pointToLineProtocol(sensorReadings));
  
  // Write point into buffer
  client.writePoint(sensorReadings);

  // Clear fields for next usage. Tags remain the same.
  sensorReadings.clearFields();

  // If no Wifi signal, try to reconnect it
  if (wifiMulti.run() != WL_CONNECTED) {
    Serial.println("Wifi connection lost");
  }

  // Wait 10s
  Serial.println("Wait 10s");
  delay(10000);
}

View raw code

Before uploading the code to your board, you need to insert your network credentials, the database URL, token, organization, and bucket name. Also, don’t forget to insert your timezone. Check this document to search for your timezone in the right format.

How the Code Works

Start by including the required libraries and setting the DEVICE name accordingly to the selected board (ESP32 or ESP8266).

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#if defined(ESP32)
  #include <WiFiMulti.h>
  WiFiMulti wifiMulti;
  #define DEVICE "ESP32"
#elif defined(ESP8266)
  #include <ESP8266WiFiMulti.h>
  ESP8266WiFiMulti wifiMulti;
  #define DEVICE "ESP8266"
  #define WIFI_AUTH_OPEN ENC_TYPE_NONE
#endif

#include <InfluxDbClient.h>
#include <InfluxDbCloud.h>

Insert your network credentials on the following variables so that the ESP32 or ESP8266 boards can connect to the internet using your local network.

// WiFi AP SSID
#define WIFI_SSID "REPLACE_WITH_YOUR_SSID"
// WiFi password
#define WIFI_PASSWORD "REPLACE_WITH_YOUR_PASSWORD"

Insert the InfluxDB server URL on the following lines—the one you’ve gotten in this step:

// InfluxDB v2 server url, e.g. https://eu-central-1-1.aws.cloud2.influxdata.com (Use: InfluxDB UI -> Load Data -> Client Libraries)
#define INFLUXDB_URL "REPLACE_WITH_YOUR_INFLUXDB_URL"

Note: if you’re running InfluxDB locally on a Raspberry Pi, the URL will be the Raspberry Pi IP address on port 8086. For example 192.168.1.106:8086.

Insert your InfluxDB token—saved in this step:

#define INFLUXDB_TOKEN "REPLACE_WITH_YOUR_INFLUXDB_TOKEN"

Add your InfluxDB organization name—check this step.

#define INFLUXDB_ORG "REPLACE_WITH_YOUR_INFLUXXDB_ORGANIZATION_ID"

Finally, add your InfluxDB bucket name:

#define INFLUXDB_BUCKET "REPLACE_WITH_YOUR_BUCKET_NAME"

Setting your Timezone

You must set your timezone accordingly to these instructions. The easiest way is to check this table and copy your timezone from there. In my case, it’s Lisbon timezone:

#define TZ_INFO "WET0WEST,M3.5.0/1,M10.5.0"

InfluxDB Client

Now that you have all the required settings, you can create an InfluxDBClient instance. We’re creating a secure client that uses a preconfigured certificate—learn more about secure connection.

InfluxDBClient client(INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN, InfluxDbCloud2CACert);

Point

Then, we create a Point instance called sensorReadings. The point will be called measurements on the database. Later in the code, we can refer to that point (sensorReadings) to add tags and fields.

Point sensorReadings("measurements");

Note: A set of data in a database row is known as point. Each point has a measurement, a tag set, a field key, a field value, and a timestamp.

BME280 Variables

Create an Adafruit_BME280 instance called bme on the default ESP I2C pins.

Adafruit_BME280 bme; // I2C

Create variables to save the temperature, humidity, and pressure readings.

float temperature;
float humidity;
float pressure;

initBME() function

The initBME() function initializes the BME280 sensor. We’ll call it later in the setup() to initialize the sensor.

// Initialize BME280
void initBME(){
  if (!bme.begin(0x76)) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }
}

setup()

In the setup(), initialize the Serial Monitor for debugging purposes.

Serial.begin(115200);

Initialize Wi-Fi.

// Setup wifi
WiFi.mode(WIFI_STA);
wifiMulti.addAP(WIFI_SSID, WIFI_PASSWORD);

Serial.print("Connecting to wifi");
while (wifiMulti.run() != WL_CONNECTED) {
  Serial.print(".");
  delay(500);
}
Serial.println();

Call the initBME() function to initialize the BME280 sensor.

//Init BME280 sensor
initBME();

Add tags to your data using addTag(). We’re adding the device name, the name of the sensor, and the location of the sensor. You may add other tags that might be useful for your specific project.

sensorReadings.addTag("device", DEVICE);
sensorReadings.addTag("location", "office");
sensorReadings.addTag("sensor", "bme280");

Synchronize time, which is necessary for certificate validation.

timeSync(TZ_INFO, "pool.ntp.org", "time.nis.gov");

Check the connection to the InfluxDB server and print any error messages in case the connection fails:

// Check server connection
if (client.validateConnection()) {
  Serial.print("Connected to InfluxDB: ");
  Serial.println(client.getServerUrl());
} else {
  Serial.print("InfluxDB connection failed: ");
  Serial.println(client.getLastErrorMessage());
}

loop()

In the loop(), we’ll send the sensor readings to InfluxDB every 10 seconds.

We get temperature, humidity, and pressure readings:

temperature = bme.readTemperature();
humidity = bme.readHumidity();
pressure = bme.readPressure()/100.0F;

And we add those readings as fields to our point (database data row).

// Add readings as fields to point
sensorReadings.addField("temperature", temperature);
sensorReadings.addField("humidity", humidity);
sensorReadings.addField("pressure", pressure);

Print in the Serial Monitor what we’re writing to the point:

Serial.println(client.pointToLineProtocol(sensorReadings));

Finally, to actually add the point to the database, we use the writePoint() method on the InfluxDBClient object and pass as argument the point we want to add: client.writePoint(sensorReadings).

client.writePoint(sensorReadings);

Clear the fields to be ready for usage in the next loop.

sensorReadings.clearFields();

New data is written to the database every 10 seconds.

Serial.println("Wait 10s");
delay(10000);

Demonstration—Visualizing your Data

After inserting all the required settings on the code, you can upload it to your ESP32/ESP8266 board. If you get any error during compilation, check the following:

  • check that you have an ESP32/ESP8266 board selected in Tools > Board.
  • Check your ESP32/ESP8266 boards installation version in Tools > Board > Boards Manager > ESP8266 or ESP32. Select version 3.0.1 for ESP8266 or version 2.01 for ESP32 if you’re getting issues with other versions.

After uploading the code to your board, open the Serial Monitor at a baud rate of 115200. Press the ESP on-board RESET button to restart the board. It should print something similar on the Serial Monitor:

ESP Send BME280 Sensor Readings to InfluxDB

Now, go to your InfludDB account and go to the Data Explorer by clicking on the corresponding icon.

InfluxDB data explorer menu

Now, you can visualize your data. Start by selecting the bucket you want. Then, we need to add filters to select our data. Select the measurement under the _measurement field, the device and the location. Then, you can select the temperature, humidity, or pressure values. You can also select all readings if you want to plot them all on the same chart.

After making the query, click on the SUBMIT button. This will display your data in your chosen format. In the upper left corner, you can select different ways to visualize the data. You can also click on the CUSTOMIZE button to change the color of the series.

ESP32 ESP8266 Data Explorer InfluxDB

You can create a dashboard to show multiple data visualizations in different formats (gauges, histogram, single stat, etc.) or different data on the same page. For example, multiple charts to show temperature, humidity, and pressure, and boxes to show the current measurements.

Creating a Dashboard

Click on the dashboard icon and then on Create Dashboard > New dashboard.

InfluxDB - Create Dashboard

Add a cell. Make the query to get your data and select the visualization you want. Give a name to the cell, for example, Office Temperature(ESP32). You can also click on the Customize button to customize the graph (we suggest selecting different colors for temperature, humidity, and pressure). Finally, click on the icon in the top right corner to add the visualization as a cell to your dashboard.

InfluxDB ESP Temperature Dashboard cell

Repeat the same process for the other readings (humidity, and pressure). You can also add a single stat to show the current values of each reading.

I have the ESP32 and ESP8266 running the same code simultaneously, so I created a dashboard that shows the readings of each board.

ESP32 ESP8266 Sensor Readings Dashboard InfluxDB

You can move your cells to different positions and organize the dashboard in a way that makes sense for you. You can also customize the way the data is refreshed and how many data points you want to see (up to the past 30 days).

Wrapping Up

In this tutorial, you learned how to send multiple sensor readings to InfluxDB. InfluxDB adds a timestamp to all data rows (point).

As an example, we used a BME280 sensor, but you can easily modify the example to use any other sensor or add more sensors. You can also run this example on multiple boards to monitor the temperature, humidity, and pressure in different places—don’t forget to add different tags to identify the places or the boards.

We hope you found this tutorial useful. What other projects would you like to see using InfluxDB? Let us know in the comments section.

Learn more about the ESP32 and ESP8266 with our resources:

Thanks for reading.



Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server communication protocols DOWNLOAD »

Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server communication protocols DOWNLOAD »


Enjoyed this project? Stay updated by subscribing our newsletter!

14 thoughts on “ESP32/ESP8266: Send BME280 Sensor Readings to InfluxDB”

  1. Nice tutorial. One question, when using a free Influxdb account it says that we get 30 days of storage, does that mean that we will only have 30 days of records? i.e. readings only for the last 30 days?

    Reply
  2. Nice tutorial. Having not tried it yet, I’m curious if you are able to use a web browser to see the dashboards, or is it necessary to log in? If not is there a way?
    Thanks

    Reply
  3. Very Nice Tutorial.
    Is there a way to change/update or overwrite previously entered entry in the influxdb database.?

    Thanks

    Reply
    • Hi.
      As it is a time series database, each entry is associated with a specific timestamp. So, I don’t think you can overwrite data.
      Regards,
      Sara

      Reply
  4. Hi, I’m happy to see this new project and that you revised it, because of the slight imperfections related to the free plan with Cloud InfluxDB.

    So, when running InfluxDB 2.x locally on a Raspberry Pi you want to access the TDB via the Internet ofcourse and the thing is, how to do this in a similar way to the cloud offer?

    From what I know InfluxDB can be accessed via http and curl can be used to feed data flawlessly into the buckets.

    Something like that:

    curl -i -XPOST ‘http://localhost:8086/write?db=mydb’ –data-binary ‘cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000’

    So it would be great to use just a POST-request to store data into the buckets and tables.

    But how can we expose the pi just right enough to accomplish this?

    Alternative: Some hosters have offerings that allow the installationa of InfluxDB.

    It would be interesting to see, what features could be used via a browser. Using Grafana, there is a similar challenge.

    Well, please look here to this German Solar-Specialist:

    https://solaranzeige.de:8080/d/99SolEdge1/solaredge?orgId=1&refresh=1m&kiosk=1

    This is also interesting:

    https://solaranzeige.de/phpBB3/download/%C3%9Cbersicht%20Solaranzeige.pdf

    However, he warns to make a pi acessible via the web.

    Reply
  5. Post#2

    I am a proud owner of a pi 400 8 GB (christmas gift 2020). However this pi refuses to boot most newer images. Some newer images that have been produced with balena etcher seem to work, but no 64-Bit RPI OS works. PINN from the rpi-imager works and also some of the OS that are offered within PINN work also. But no version of the rpi-OS works.

    It seems that the bootloader (EEPROM) of the pi 400 has a servere problem. Unfortunately all of the recovery efforts (e.g. with the recovery image) were not successful, even when the green screen appears… The green LED was supposed to flash repeately, but does not…

    So, i have a great pi with lot of memory and cannot use it with a 64-Bit rpi OS….

    I would be so glad to know a way to get at least to know if the boot hardware is defective or not.

    Thanks.

    Reply
  6. Hello,

    I am struggling a little. Been trying a lot to methods to upload data to a server system and this is pretty much my last option but looks very cool.

    However it encounters a Compile fault which I thing may be version specific but unsure. I have just done a direct copy and paste and filled in the relevant fields and i get the same error using the sample code from Influx.

    I have tried this to an ESP8266 and ESP32, same error code.

    Found a similar fault listed for a different library but all seems years old. Error message below.

    Would love some help.

    In file included from C:\Users\Lyndon\Documents\Arduino\Multi_temp_to_InfluxDB\Multi_temp_to_InfluxDB.ino:11:0:

    C:\Users\Lyndon\Documents\Arduino\libraries\ESP8266_Influxdb\src/InfluxDbClient.h:210:21: error: ‘virtual int InfluxDBClient::BatchStreamer::availableForWrite()’ marked override, but does not override

    virtual int availableForWrite() override;

    ^

    C:\Users\Lyndon\Documents\Arduino\libraries\ESP8266_Influxdb\src/InfluxDbClient.h:214:21: error: ‘virtual int InfluxDBClient::BatchStreamer::read(uint8_t*, size_t)’ marked override, but does not override

    virtual int read(uint8_t* buffer, size_t len) override;

    ^

    exit status 1
    Error compiling for board LOLIN(WEMOS) D1 R2 & mini.

    Reply
    • Hi.
      Check your ESP32 boards version. Tools > Boards > Boards Manager > ESP32
      You may need to downgrade.
      Regards,
      Sara

      Reply

Leave a Comment

Download our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.