BMP 280 breaks the code but is working fine while used alone

For starters im using arduino UNO R4 with separate ESP 8266 module wired up via digital ports 2 and 3 and using Software Serial library. Im uploading the code to arduino using the ESP module for communication.

I ran in to problem where adding the BMP280 to my sketch stops the communication with Blynk and overall seems to stop the void loop execution. I already tested those sensors all together without blynk and in this scenario, when they just print to serial monitor, everything works fine. Another thing is that the BMP 280 sensor works in this very sketch I provided when all other sensors and lines of code relevant to them are commented out. As for the BMP 280 relevant lines the lines marked with “XX” are the ones that ultimatelly make this bug to appear. I tried using other libraries for BMP 280 but the problem remains the same.

All sensors are wired correctly. Every single one of them works fine while put in a sketch which is not using blynk and just prints them to serial monitor.

Is there any known conflict preventing blynk from using this sensor while combined with others? Or anything really that could be relevant to my problem.

#define BLYNK_TEMPLATE_ID "ID"
#define BLYNK_TEMPLATE_NAME "NAME"
#define BLYNK_AUTH_TOKEN "TOKEN"
#define BLYNK_PRINT Serial

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
//#include <Adafruit_BMP280.h>
#include <DHT.h>
#include <SoftwareSerial.h>


char ssid[] = "wifiname";
char pass[] = "wifipassword";

SoftwareSerial EspSerial(2, 3); // RX, TX
#define ESP8266_BAUD 115200
ESP8266 wifi(&EspSerial);

#define DHTPIN 13
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

//#define BMP280_ADDRESS 0x76 XX
//Adafruit_BMP280 bmp; XX

const int MQ135Pin = A0;

BlynkTimer timer;

///Global variables///
//double temperatureBMP = 5;
//double temperatureBMPreal = 5;
double pressure = 5; 
double temperatureDHT = 5;
double humidity = 5;
int airQuality = 5;



void sendSensorData() {
  //temperatureBMP = bmp.readTemperature();
  //temperatureBMPreal = (temperatureBMP + 0.5);
  //pressure = bmp.readPressure() / 100.0F;
  temperatureDHT = dht.readTemperature();
  humidity = dht.readHumidity();
  airQuality = analogRead(MQ135Pin);

  temperatureDHT = round(temperatureDHT * 10) / 10.0;
  humidity = round(humidity * 10) / 10.0;
  //temperatureBMPreal = round(temperatureBMPreal * 10) / 10.0;
  //Blynk.virtualWrite(V0, temperatureBMPreal);
  //Blynk.virtualWrite(V1, pressure);
  Blynk.virtualWrite(V2, temperatureDHT);
  Blynk.virtualWrite(V3, humidity);
  Blynk.virtualWrite(V4, airQuality);
}

void setup() {
//init BMP280 
  //bmp.begin(BMP280_ADDRESS); 

/// init DHT11 ///
  dht.begin();

  Serial.begin(115200);
  EspSerial.begin(ESP8266_BAUD);
  delay(10);
  Blynk.begin(BLYNK_AUTH_TOKEN, wifi, ssid, pass);
  
 

  //timer set for sendSensorData
  timer.setInterval(2000L, sendSensorData);
}

void loop() {
  
  Blynk.run();
  timer.run(); 

  }

Is your device connecting to Blynk and showing as Online?

Pete.

Yes. Even after adding the BMP 280 I get connection with blink but no data is changing in the data streams. So I concluded that the void loop is not realised.

A simple way to test that is to put a serial print statement in your void loop.

But, I’d start by looking at your serial monitor and seeing what it’s telling you about the Blynk connection, and I’d also add serial print statements in your sendSensorData function.

Pete.

I did that too and im getting no prints neither from loop or sendSensorData function. But in the matter of fact im not getting a print from setup function neither. Im only getting it when im shutting down the program by unplugging the connection PC - Arduino

As to what serial monitor tells me about Blynk connection. Im getting connected and when BMP 280 is “commented” in code im getting frequent pings from blynk but when I uncomment BMP 280 relevant code pings are appearing less frequently.

In both cases initial connection is established and at all times I see my device as online on the blynk site

Your last two posts seem to contradict each other.
Rather than talking in generalisations, you’d be far better posting time stamped serial monitor output text (with triple backticks) and adding narrative to explain what each shows.

Also, if you look at the Adafruit BMP library examples you’ll see that they contain serial prints that provide information to the user regarding the state of the BMP initialisation process. Adding some of that code into your sketch will help you to understand what’s happening.

Pete.