Platformio i2c Wifi Lora32 v2

Hi,
I’m trying to use the LMIC-Node project with Platformio and am not able to get any i2c sensors working.

I’m testing with a BMP280. I’ve tried an i2c scanner and can see the sensor on 21/22 or 4/15 however I haven’t been able to get readings from it with any library.

I’ve tried the following libraries



None of them can detect the sensor.

Here’s the example code for the BMP280_DEV project.

// BMP280_DEV - ESP32, I2C Communications, Default Configuration, Normal Conversion, User-Defined Pins

//////////////////////////////////////////////////////////////////////////////////////////////////////////

#include <BMP280_DEV.h> // Include the BMP280_DEV.h library

float temperature, pressure, altitude; // Create the temperature, pressure and altitude variables

BMP280_DEV bmp280(21, 22); // Instantiate (create) a BMP280 object and set-up for I2C operation on pins SDA: A6, SCL: A7

void setup()

{

Serial.begin(9600); // Initialise the serial port

bmp280.begin(); // Default initialisation, place the BMP280 into SLEEP_MODE

bmp280.setTimeStandby(TIME_STANDBY_2000MS); // Set the standby time to 2 seconds

bmp280.startNormalConversion(); // Start BMP280 continuous conversion in NORMAL_MODE

}

void loop()

{

if (bmp280.getMeasurements(temperature, pressure, altitude)) // Check if the measurement is complete

{

Serial.print(temperature);                    // Display the results    

Serial.print(F("*C   "));

Serial.print(pressure);    

Serial.print(F("hPa   "));

Serial.print(altitude);

Serial.println(F("m"));  

}

}

Any suggestions to get this basic example working? Hopefully once I get one of these libraries working I can get it working in LMIC-Node as well.

Thanks!