Interface multiple sensors with Blynk in I2c bus

How do I proceed with adding multiple sensors like gps module, Heart rate sensor,BMP180 in an i2c bus in esp32 and read the output using Blynk

I would suggest that you get it working without Blynk first.

Pete.

i have successfully interfaced the individual sensors to the i2c bus and tried getting values from the same. But the issue is that only one of the sensor values are read . Incorporating Blynk, is it possible to view all the sensor values using i2c bus? Please guide me to proceed with the same.

Blynk isn’t a magic wand that will make your I2C code suddenly start working.
You need to get the sketch reading all of the sensors and outputting the results to the serial monitor before trying to push the sensor results out to Blynk.

Pete.

this is the code i have written for an esp32 to push a gps data to Blynk. How do I program a node MCU to receive this information from blynk?

# define BLYNK_PRINT Serial
# include<SPI.h>
# include<ESP8266WiFi.h>
# include<BlynkSimpleEsp8266.h>
# include<SimpleTimer.h>
#include<TinyGPS++.h>
#include<SoftwareSerial.h>
char auth[] = "N2BQ-W-aerb8Ym80CD3l96eTr2e9ZoJy" ; //main esp32
char ssid[] = "rahul" ; 
char pass[] = "rahul123" ;
static const int RXPin = 2, TXPin = 3;
static const uint32_t GPSBaud = 9600;
double lati, longi;
// The TinyGPS++ object
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);
WidgetBridge bridge1(V1) ;
BlynkTimer timer ;
BLYNK_CONNECTED() {
bridge1.setAuthToken("IMllmyb21c1QBfB4qtEUcrp5aN-Uj1cI") ;// 2nd nodemcu
}

void sendSensor(){
  while (ss.available() > 0){
    gps.encode(ss.read());
    if (gps.location.isUpdated()){
      // Latitude in degrees (double)
      Serial.print("Latitude= ");
      lati = gps.location.lat();`
      Serial.print(lati, 5);
           
      // Longitude in degrees (double)
      Serial.print(" Longitude= ");
      longi = gps.location.lng();
      Serial.println(longi, 6);
  
}
  }
Blynk.virtualWrite(V1 , lati ) ;
Blynk.virtualWrite(V2 , longi) ; 


// The serial connection to the GPS device


void setup(){
  Serial.begin(9600);
  ss.begin(GPSBaud);
  
  Blynk.begin(auth, ssid, pass); // start up Blynk

  // this uploads data from sensor to Blynk at 1 second intervals
  timer.setInterval(1000L, sendSensor);
  //timer.setInterval(2307L, oledDisplay);  // skew timer interval to stop i2c issues
}




void loop()
{
  Blynk.run();
  timer.run();
  //call function if Blynk is disabled
  //oledDisplay();
  //delay(1000);

}

@Rahul_Ravi please edit your post and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

just did

That’s a significantly different scenario to the one you described in your opening post, with a significantly different answer.

To do what you are now describe, you need to research the use of Bridge code within Blynk.

Pete.

# define BLYNK_PRINT Serial
# include <SPI.h>
# include <ESP8266WiFi.h>
# include <BlynkSimpleEsp8266.h>
# include <SimpleTimer.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
char auth[] = "N2BQ-W-aerb8Ym80CD3l96eTr2e9ZoJy" ; //main esp32
char ssid[] = "rahul" ; 
char pass[] = "rahul123" ;
static const int RXPin = 2, TXPin = 3;
static const uint32_t GPSBaud = 9600;
double lati, longi, dmy,hmsc,kmphr,alt, sats;
// The TinyGPS++ object
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);
WidgetBridge bridge1(V1) ;
BlynkTimer timer ;
BLYNK_CONNECTED() {
  
bridge1.setAuthToken("IMllmyb21c1QBfB4qtEUcrp5aN-Uj1cI") ;// 2nd nodemcu
}

void sendSensor(){
  while (ss.available() > 0){
    gps.encode(ss.read());
    if (gps.location.isUpdated()){
      // Latitude in degrees (double)
      Serial.print("Latitude= ");
      lati = gps.location.lat();
      Serial.print(lati, 5);
           
      // Longitude in degrees (double)
      Serial.print(" Longitude= ");
      longi = gps.location.lng();
      Serial.println(longi, 6);
  }
  }
}

Blynk.virtualWrite(V1 , lati ) ;
Blynk.virtualWrite(V2 , longi) ; 


// The serial connection to the GPS device


void setup(){
  Serial.begin(9600);
  ss.begin(GPSBaud);
  
  Blynk.begin(auth, ssid, pass); // start up Blynk

  // this uploads data from sensor to Blynk at 1 second intervals
  timer.setInterval(1000L, sendSensor);
  //timer.setInterval(2307L, oledDisplay);  // skew timer interval to stop i2c issues
}




void loop(){
  Blynk.run();
  timer.run();
  //call function if Blynk is disabled
  //oledDisplay();
  //delay(1000);
  }


error comes: ‘Blynk does not name a type’

I’ve merged your two topics as they are about the same project and code. Please don’t spam the forum with multiple postings, as you’ll find that people respond to both topics and it gets very messy.

When you’re posting compiler error messages, it’s good practice to copy and paste the actual message, as that will point to the location of the error within the code.
My guess, without compiling the code myself, is that it’s caused by these two lines that are floating outside of your sendSensor function:

Having said that, there are numerous other issues with this code. However, as you’re unwilling to explain what you are trying to achieve with your project it is difficult to point you in the right direction.

Pete.