Serial Monitor not working or Blynk not connectinv

Hello I am doing a little project where ESP8266 is supposed to send the data it got from Arduino Uno(which works completely fine) to Blynk and also get a signal to turn a water pump on or off.
The problem is that even with BLYNK_PRINT defined the standard Blynk begin doesn’t show up on the Serial Monitor. Not only that, the device itself seems to not be working, so nothing is posted on it and the ESP8266 recieves nothing.
Here is my sketch for the esp:

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Wire.h>
#define BLYNK_PRINT Serial
char auth[] = "726vbF21w7UyF4C9KngX6rizCZKksXlz";//Enter your Auth token
char ssid[] = "ALHN-89E5";//Enter your WIFI name
char pass[] = "6161294651";//Enter your WIFI password

BlynkTimer timer;
bool Relay = 0;
int data[3] = {0, 0, 0};
//Define component pins  
#define waterPump 12

void setup() {
  Serial.begin(74880);
  
  Wire.begin(D1, D2);
  
  Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
  timer.setInterval(1000L, req);

  timer.setInterval(1000L, processCall);
  }

BLYNK_WRITE(V0) {
  Relay = param.asInt();

  if (Relay == 1) {
    digitalWrite(waterPump, LOW);
  } else {
    digitalWrite(waterPump, HIGH);
  }
}


void processCall(){
          Blynk.virtualWrite(V1, data[0]);
          Blynk.virtualWrite(V2, data[1]);
          Blynk.virtualWrite(V3, data[2]);
}

void req(){
  Wire.requestFrom(8, 3); /* request & read data of size 13 from slave */
  
  int i=0;
  while(Wire.available())
  {

    data[i]=Wire.read();
    i++;
  }
}

void loop(){

  Blynk.run();//Run the Blynk library
  timer.run();//Run the Blynk timer
}

Thanks in advance!
Edit: It think the problem is in Blynk begin but I can’t figure out what is it.

Hello, I think for serial monitor should be:
Serial.begin(115200);

And need set same value in serial monitor of Arduino IDE

baud

I tried it, but while the serial monitor started at least working the Blynk message(?)/logo still isn’t showing up. I should also probably mention that while the Arduino/Esp8266 communication is working when I am not using the Blynk timer, I am suspecting that the Blynk timer is also not working because I tried to debug it through Serial monitor, but it also shows nothing.

@Oleksii-QA it doesn’t matter which baud rate you use in the sketch, provided your serial monitor is set to the same baud rate.
It is usually best to set the baud rate to the native baud rate used by the board/MCU you’re using, so you can see MCU related messages at start-up.

Most ESP8266 based dev boards use 74880 as their default native baud rate, and most ESP32s use 15200.

Pete.

I suspect that the issue is…

Pin D3 (GPIO0) is a strapping pin, which puts the board into Flash mode when pulled LOW. When it’s in flash mode it is waiting for a code upload and doesn’t enter run mode.

I’d recommend changing this to a more appropriate pin - see this link for more info…

I’d also suggest using GPIO numbers in your code, rather than “D” numbers.

If you still have issues then try removing all connections from your board, other than the USB connection.
If you still have issues then make sure you aren’t using any Digital datastreams.

Pete.

Thank you for responding! Sadly, the problem still persists. I tried everything you said including changing to gpio pins, isolating the esp and checking the datastreams. It still just outputs garbage character in the Serial Monitor. I am not sure what to do here.

That’s because you have your serial monitor baud rate set incorrectly.

Pete.

I used the baud rate you suggested and it is still outputing nonesense every time I load the ESP8266 up. I think there may be some problems from Blynk.begin() because after it the code completely stops executing. I just don’t know why, because the Wi-Fi connection seems to be fine.

Maybe if you told us EXACTLY what baud rate you’re now using in your sketch, and also told us EXACTLY which baud rate you’re selecting in your serial monitor, we’d be one step closer to being able to help you with this problem.

The serial monitor output will almost certainly tell you why, once you’ve managed to get it working correctly.

Pete.

74880

Lets see some code, screenshots of your serial monitor, and photos of your device.

Pete.

изображение

new code in post
last message is incorrect

When i push reset button on esp8266
изображение

I asked for a screenshot so that it would show the baud rate you’d selected in the serial monitor.

I’d also asked for you to post the code that produced the output in the serial monitor, but you haven’t done that.

Seeing a picture of your board, so that we know what sort of board you are using would also be useful, but you haven’t done that either

Do you want help with this, or not?

Pete.

1 min

#include <BlynkSimpleEsp8266.h>
#include <Wire.h>
#define BLYNK_PRINT Serial
char auth[] = "726vbF21w7UyF4C9KngX6rizCZKksXlz";//Enter your Auth token
char ssid[] = "ALHN-89E5";//Enter your WIFI name
char pass[] = "6161294651";//Enter your WIFI password

BlynkTimer timer;
bool Relay = 0;
int data[3] = {0, 0, 0};
//Define component pins  
#define waterPump 12

void setup() {
  Serial.begin(74880);
  
  Wire.begin(D1, D2);
  
  Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
  timer.setInterval(1000L, req);

  timer.setInterval(1000L, processCall);
  }

BLYNK_WRITE(V0) {
  Relay = param.asInt();

  if (Relay == 1) {
    digitalWrite(waterPump, LOW);
  } else {
    digitalWrite(waterPump, HIGH);
  }
}


void processCall(){
          Blynk.virtualWrite(V1, data[0]);
          Blynk.virtualWrite(V2, data[1]);
          Blynk.virtualWrite(V3, data[2]);
}

void req(){
  Wire.requestFrom(8, 3); /* request & read data of size 13 from slave */
  
  int i=0;
  while(Wire.available())
  {

    data[i]=Wire.read();
    i++;
  }
}

void loop(){

  Blynk.run();//Run the Blynk library
  timer.run();//Run the Blynk timer
}

Why have you created a second user identity on this forum?

Pete.