WiFi LoRa 32 (V3) I2C SDA/SCL

Hello, i have the same kind of problem. I tried this :
/***************************************************************************

This is a library for the BMP280 humidity, temperature & pressure sensor

Designed specifically to work with the Adafruit BMP280 Breakout

----> http://www.adafruit.com/products/2651

These sensors use I2C or SPI to communicate, 2 or 4 pins are required

to interface.

Adafruit invests time and resources providing this open source code,

please support Adafruit andopen-source hardware by purchasing products

from Adafruit!

Written by Limor Fried & Kevin Townsend for Adafruit Industries.

BSD license, all text above must be included in any redistribution

***************************************************************************/

#include <Wire.h>

#include <SPI.h>

#include <Adafruit_BMP280.h>

#include “SSD1306Wire.h”

#define BMP_SCK (13)

#define BMP_MISO (12)

#define BMP_MOSI (11)

#define BMP_CS (10)

SSD1306Wire display(0x3c, SDA_OLED, SCL_OLED);

TwoWire I2Ctwo = TwoWire(1);

Adafruit_BMP280 bmp(&I2Ctwo); // I2C

//Adafruit_BMP280 bmp(BMP_CS); // hardware SPI

//Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);

void setup() {

Serial.begin(115200);

display.setFont(ArialMT_Plain_10);

I2Ctwo.begin(SDA, SCL);

while ( !Serial ) delay(100); // wait for native usb

Serial.println(F(“BMP280 test”));

unsigned status;

status = bmp.begin(BMP280_ADDRESS_ALT, BMP280_CHIPID);

//status = bmp.begin();

if (!status) {

Serial.println(F("Could not find a valid BMP280 sensor, check wiring or "

                  "try a different address!"));

Serial.print("SensorID was: 0x"); Serial.println(bmp.sensorID(),16);

Serial.print("        ID of 0xFF probably means a bad address, a BMP 180 or BMP 085\n");

Serial.print("   ID of 0x56-0x58 represents a BMP 280,\n");

Serial.print("        ID of 0x60 represents a BME 280.\n");

Serial.print("        ID of 0x61 represents a BME 680.\n");

while (1) delay(10);

}

/* Default settings from datasheet. */

bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /* Operating Mode. */

              Adafruit_BMP280::SAMPLING_X2,     /* Temp. oversampling */

              Adafruit_BMP280::SAMPLING_X16,    /* Pressure oversampling */

              Adafruit_BMP280::FILTER_X16,      /* Filtering. */

              Adafruit_BMP280::STANDBY_MS_500); /* Standby time. */

}

void loop() {

display.setTextAlignment(TEXT_ALIGN_LEFT);

display.drawString(0, 10, "Left aligned (0,10)");

Serial.print(F("Temperature = "));

Serial.print(bmp.readTemperature());

Serial.println(" *C");

Serial.print(F("Pressure = "));

Serial.print(bmp.readPressure()/100);

Serial.println(" hPa");

Serial.print(F("Approx altitude = "));

Serial.print(bmp.readAltitude(1013.25)); /* Adjusted to local forecast! */

Serial.println(" m");

Serial.println();

delay(2000);

}

It compiles but when i try to upload it i have a kernel panic.
Any idea ?

You should be able to strategically comment out a few of those lines of code to identify the offending line. But having said that, I uploaded your code and all that showed in the Serial Monitor was your message “Could not find a valid BMP280 sensor…etc.” (which was no surprise because there was nothing connected to my Dev-Board). So maybe you’ve misconfigured your hardware in some way.

Kernel panic… bootloop… old version esptool? See earlier topics from past few days, it’s mentioned somewhere. May be the solution.

It’s not an old esptool version. With the same sketch without any mention of SSD1306Wire (i comment all lines related) it works fine…

hi, could u share the code about ur solution
I’m very frustrating now on this…
I had tried the solution u said, but still not working
I just want to display the time on the screen using ds3231, the arduino serial monitor can display the time but my oled on wifi lora 32 V3 cant display

Anyone have the code for DS3231 with Heltec wifi lora 32 V3
I had tried many solution but it still no working

It sounds like you are able to configure the DS3231 and display the time in the IDE Serial Monitor. So, have you tried the Examples > Heltec-Example > OLED > Simple Demo to test the OLED display? If you can do both of those, it’s not clear why you shouldn’t be able to simply combine the code from those two exercises, taking into consideration earlier posts in this thread in relation to operating the second I2C bus.

If you can successfully read the DS3231 and run the OLED Demo(s) independently, and you are still having trouble, if you post your code, someone who has not actually coded this particular configuration may still be able to help pinpoint your problem.