It is about the problem on my project..... please help me!

This is the error below:

SmartAgricultureMonitoring:12:10: fatal error: BlynkTimer.h: No such file or directory
Multiple libraries were found for "BlynkSimpleEsp8266.h"
   12 | #include <BlynkTimer.h>
 Used: C:\Users\veget\OneDrive\Documents\Arduino\libraries\Blynk-1.0.1
      |          ^~~~~~~~~~~~~~
 Not used: C:\Users\veget\OneDrive\Documents\Arduino\libraries\Blynk
compilation terminated.
exit status 1
BlynkTimer.h: No such file or directory

This is my code below:

#include <dummy.h>

#include <dummy.h>

// Viral Science www.viralsciencecreativity.com www.youtube.com/c/viralscience
// Blynk IOT Smart Agriculture Monitoring System 

#define BLYNK_PRINT Serial   
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <BlynkTimer.h>
#include <DHT.h>
#define BLYNK_PRINT Serial
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS D2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

char auth[] = "----------------";               //Authentication code sent by Blynk
char ssid[] = "-------";                        //WiFi SSID
char pass[] = "-------";                        //WiFi Password


#define pirPin D1            
int pirValue;                   
int pinValue;                   

#define sensorPin D6 
#define rainPin D5
int sensorState = 0;
int rainState = 0;
int lastState = 0;
int lastRainState = 0;
#define DHTPIN 2    
#define DHTTYPE DHT11     
DHT dht(DHTPIN, DHTTYPE);
SimpleTimer timer;

BLYNK_WRITE(V0)
{
 pinValue = param.asInt();    
} 

void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
 
  Blynk.virtualWrite(V5, h);  //V5 is for Humidity
  Blynk.virtualWrite(V6, t);  //V6 is for Temperature
}
void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
   pinMode(sensorPin, INPUT);
   pinMode(rainPin, INPUT);
   pinMode(pirPin, INPUT);
  dht.begin();

  timer.setInterval(1000L, sendSensor);
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
   sensors.begin();
}
int sensor=0;
void sendTemps()
{
sensor=analogRead(A0);
sensors.requestTemperatures();
float temp = sensors.getTempCByIndex(0); 
Serial.println(temp);
Serial.println(sensor);
Blynk.virtualWrite(V1, temp);
Blynk.virtualWrite(V2,sensor);
delay(1000);
}

void getPirValue(void)        //Get PIR Data
  {
   pirValue = digitalRead(pirPin);
    if (pirValue) 
     { 
       Serial.println("Motion detected");
       Blynk.notify("Motion detected");  
     }
  }
  
void loop()
{
  Blynk.run(); 
  timer.run(); 
  sendTemps();
sensorState = digitalRead(sensorPin);
Serial.println(sensorState);

if (sensorState == 1 && lastState == 0) {
  Serial.println("needs water, send notification");
  Blynk.notify("Water your plants");
  lastState = 1;
  delay(1000);
//send notification
    
  } 
  else if (sensorState == 1 && lastState == 1) {
    //do nothing, has not been watered yet
  Serial.println("has not been watered yet");
  delay(1000);
  }
  else {
    //st
    Serial.println("does not need water");
    lastState = 0;
    delay(1000);
  }



rainState = digitalRead(rainPin);
Serial.println(rainState);

  if (rainState == 0 && lastRainState == 0) {
  Serial.println("Its Raining!");
  Blynk.notify("Its Raining!");
  lastRainState = 1;
  delay(1000);
//send notification
    
  } 
  else if (rainState == 0 && lastRainState == 1) {
  delay(1000);
  }
  else {
    Serial.println("No Rains");
    lastRainState = 0;
    delay(1000);
  }


  if (pinValue == HIGH)    
      {
        getPirValue();
      }
      Blynk.run();
  delay(100);
}

I'm guessing there is more to the error message. Copy the entire error message and paste it here, please.

@satya_07

Your post was MOVED to its current location as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.

It will help you get the best out of the forum in the future.

That means you have two copies of the "Blynk" library. One is called "Blynk" and one is called "Blynk-1.0.1". Try deleting one to get rid of the warning.

That means that you don't have the BlynkTimer library installed or you don't have the library that contains BlinkTimer.h

This is the entire error message below :

Multiple libraries were found for "BlynkSimpleEsp8266.h"
SmartAgricultureMonitoring:12:10: fatal error: BlynkTimer.h: No such file or directory
 Used: C:\Users\veget\OneDrive\Documents\Arduino\libraries\Blynk-1.0.1
   12 | #include <BlynkTimer.h>
 Not used: C:\Users\veget\OneDrive\Documents\Arduino\libraries\Blynk
      |          ^~~~~~~~~~~~~~
compilation terminated.
exit status 1
BlynkTimer.h: No such file or directory

Solved the first but about the second one I don't have any idea how to get install blynktimer library. Can you please guide me for that please?

It looks like BlynkTimer is part of the Blynk library. Remove and re-install the Blynk library.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.