Github Devices Community Docs Blog

Firebeetle ESP32 + DFR BME280 - Can't compile - error 'cannot declare variable 'bme' to be of abstract type 'DFRobot_BME280' using ESP32 Firebeetle and DFRobot BME280

I’ve seen a solution to a similar issue on this site so, here goes:
I’m trying to apply the code data_thingspeak_code.ino found as part of the ESP32 Solar Weather Station project on the DFRobot site (
I installed Arduino, added the Firebeetle ESP32 board manager, installed the libraries found in DFRobot_BME280-master (for the DFRobot BME280 Temp, Humidity, Pressure sensor) and successfully ran the raed_data_i2c.ino sketch that displayed readings from the sensor on the monitor.

When I attempt to compile and upload the data_thingspeak_code.ino sketch (which reads and uploads weather data to a thingspeak account) I get the following . I suspect, from other posts, it is defaulting to an incorrect library but, since it appears to be using the one I installed above, I’m not sure what’s going on.

Thanks for your time.

Arduino: 1.8.12 (Windows 10), Board: “FireBeetle-ESP32, 80MHz, 115200, None”

WARNING: library SPI claims to run on esp32 architecture(s) and may be incompatible with your current board which runs on DFRobot_FireBeetle-ESP32 architecture(s).
data_thingspeak_code:17:16: error: cannot declare variable ‘bme’ to be of abstract type ‘DFRobot_BME280’

DFRobot_BME280 bme; //I2C


In file included from C:\Users\dneill\Documents\Arduino\data_thingspeak_code\data_thingspeak_code.ino:13:0:

C:\Users\dneill\Documents\Arduino\libraries\DFRobot_BME280-master/DFRobot_BME280.h:32:7: note: because the following virtual functions are pure within ‘DFRobot_BME280’:

class DFRobot_BME280 {


C:\Users\dneill\Documents\Arduino\libraries\DFRobot_BME280-master/DFRobot_BME280.h:254:19: note: virtual void DFRobot_BME280::writeReg(uint8_t, uint8_t*, uint16_t)

virtual void writeReg(uint8_t reg, uint8_t *pBuf, uint16_t len) = 0;


C:\Users\dneill\Documents\Arduino\libraries\DFRobot_BME280-master/DFRobot_BME280.h:255:19: note: virtual void DFRobot_BME280::readReg(uint8_t, uint8_t*, uint16_t)

virtual void readReg(uint8_t reg, uint8_t *pBuf, uint16_t len) = 0;


C:\Users\dneill\Documents\Arduino\data_thingspeak_code\data_thingspeak_code.ino: In function ‘void Get_Values()’:

data_thingspeak_code:65:14: error: ‘class DFRobot_BME280’ has no member named ‘temperatureValue’

temp = bme.temperatureValue();


data_thingspeak_code:68:18: error: ‘class DFRobot_BME280’ has no member named ‘pressureValue’

pressure = bme.pressureValue() / 100.0F;


data_thingspeak_code:69:13: error: ‘class DFRobot_BME280’ has no member named ‘humidityValue’

hum = bme.humidityValue();


data_thingspeak_code:70:13: error: ‘class DFRobot_BME280’ has no member named ‘altitudeValue’

alt = bme.altitudeValue(SEA_LEVEL_PRESSURE);


C:\Users\dneill\Documents\Arduino\data_thingspeak_code\data_thingspeak_code.ino: In function ‘void BME280_Sleep()’:

data_thingspeak_code:172:23: error: ‘BME280_REGISTER_CONTROL’ was not declared in this scope



Multiple libraries were found for “WiFi.h”
Used: C:\Users\dneill\AppData\Local\Arduino15\packages\esp32\hardware\DFRobot_FireBeetle-ESP32\0.0.9\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
cannot declare variable ‘bme’ to be of abstract type ‘DFRobot_BME280’

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.


Sorry but I don’t get how is your issue related to OpenMQTTGateway?

In seeking a solution to my issue, one of the only relevant returns a search produced was to an answer provided for a similar issue. I admit, because I’m not using Open MQTT right now, it’s pretty tangential but, it is an assembly of like technologies and resources that are themselves used with MQTT.
I didn’t think it wold be too out-of-bounds as OpenMQTT users face the same thing.