Blynk Wasn't online yet

My project is watering plants but is not working

and this is code;

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>   
#include <BlynkSimpleEsp8266.h>

char auth[] = " yJS8PBaRbQiBYzN6a4aULZp9Farz6qGu";
char wifi[] = "fakulte_2"; //Blynk uygulamasının bize vermiş olduğu token ve bağlanmak istediğimiz wifi ve şifresini char komutu ile belirliyoruz.
char wifipass[] = "19apart20fakulte..";
int value ;
int volume; // okuma yapacağımız nem değerini deger değişkeni olarak belirliyoruz
#define sensor A0
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Blynk.begin(auth, wifi, wifipass);

}

void loop() {
// put your main code here, to run repeatedly:
value = analogRead(sensor);
volume = map(value , 0, 1023, 0, 100);
Blynk.virtualWrite (V1, volume);
Blynk.run();
}

Hey there, first check this out
https://docs.blynk.io/en/legacy-platform/legacy-articles/keep-your-void-loop-clean

1 Like

Before you do anything else, read the link that @John93 provided and make the necessary changes.
You are breaking the golden rule of Blynk, which is never put a Blynk.virtualWrite() command in your void loop. Once you’ve read the “keep your void loop clean” link then you’ll understand why this isn’t acceptable, and what you need to do to fix this.

Once you’ve done than then…

You have a leading space in your auth token. As a result, if you opened your serial monitor, you would have probably seen an “Invalid auth token” message.

Pete.

2 Likes

To read the soil moisture sensor you can check this topic

thanks. i add void loop delay

You’ll also find that the sensor you are using corrodes very quickly.
One way to mitigate this is to not provide Vcc to the sensor when it’s not in use, and not to take frequent readings.
If you connect Vcc on the sensor to a GPIO, then keep that LOW (off) until you want to take a reading, then make it HIGH (3.3v) just before taking a reading, then it’s like will be somewhat longer.

Pete.

I opened the seral monitor and I can not see anything

I change the code but problem not solved



#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>   
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;

char auth[] = "yJS8PBaRbQiBYzN6a4aULZp9Farz6qGu";
char wifi[] = "fakulte_2"; //Blynk uygulamasının bize vermiş olduğu token ve bağlanmak istediğimiz wifi ve şifresini char komutu ile belirliyoruz.
char wifipass[] = "19apart20fakulte..";
int value ;
int volume; // okuma yapacağımız nem değerini deger değişkeni olarak belirliyoruz
#define sensor A0

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Blynk.begin(auth, wifi, wifipass);
timer.setInterval(3000L, sendSensor);

}
void sendSensor()
{
value = analogRead(sensor);
volume = map(value , 0, 1023, 0, 100);
Blynk.virtualWrite (V1, volume);

}

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

And what does your serial monitor show?

Pete.

Nothing.

In that case you have a problem that is not related to Blynk.

Pete.

Have you tried a different board ?

yes i did it but its same resualt

I’d start by disconnecting everything except the USB cable, and setting the serial monitor to 74880 and pushing the RST button on your board.
You should then see the boot message from the board.

Pete.

1 Like

This will be useful as well


i wrote like this code and nothing see serial screen again

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>   
#include <BlynkSimpleEsp8266.h>

char auth[] = "yJS8PBaRbQiBYzN6a4aULZp9Farz6qGu";
char wifi[] = "iPhone"; 
char wifipass[] = "alaaddin";

void setup() {
  // put your setup code here, to run once
  Serial.begin(9600);
  Blynk.begin(auth, wifi, wifipass);
}

void loop() {
  // put your main code here, to run repeatedly:

So you didn’t take my advice to…

Pete.

i take your advice but nothing to see serial screen

Sounds like you have a hardware issue - maybe with your board, your USB serial cable or your computer.
As the cable has worked for the sketch upload then that seems unlikely.

Try the board with different cables, different USB ports, and a different computer if possible. Also try every available baud rate in the IDE’s serial monitor to see if you get anything (even garbage is good).
If none of these produce any output then your board is probably faulty.

Pete.

2 Likes