my code is succesfully upload to esp8266 wifimodule ,but my blynk always show offline, can solve it for me ?
Not without seeing your code and your serial monitor output.
Pete.
/*Water level monitoring system with the New Blynk app
Home Page
*/
//Include the library files
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define ESP8266_BAUD 9600
#define BLYNK_TEMPLATE_ID "TMPL6qctXgDVG"
#define BLYNK_TEMPLATE_NAME "water monitoring"
#define BLYNK_AUTH_TOKEN "cYhN3StFgg46Tp0FGOnDO8oIsnFpvuvV"
//Initialize the LCD display
LiquidCrystal_I2C lcd(0x27, 16, 2);
char auth[] = "cYhN3StFgg46Tp0FGOnDO8oIsnFpvuvV";//Enter your Auth token
char ssid[] = "POCO F5 Pro";//Enter your WIFI name
char pass[] = "987654321";//Enter your WIFI password
BlynkTimer timer;
// Define the component pins
#define trig D7
#define echo D8
#define relay 3
//Enter your tank max value(CM)
int MaxLevel = 30;
int Level1 = (MaxLevel * 75) / 100;
int Level2 = (MaxLevel * 65) / 100;
int Level3 = (MaxLevel * 55) / 100;
int Level4 = (MaxLevel * 45) / 100;
int Level5 = (MaxLevel * 35) / 100;
void setup() {
Serial.begin(9600);
Serial.println("Setup started"); // Debugging print
lcd.init();
lcd.backlight();
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
digitalWrite(relay, HIGH);
//Blynk.config(auth, ssid, pass, "blynk.cloud", 80);
Blynk.config(auth, "blynk-cloud.com", 80);
Blynk.connect();
lcd.setCursor(0, 0);
lcd.print("Water quality");
lcd.setCursor(4, 1);
lcd.print("Monitoring");
delay(4000);
lcd.clear();
//Call the functions
timer.setInterval(100L, ultrasonic);
}
//Get the ultrasonic sensor values
void ultrasonic() {
digitalWrite(trig, LOW);
delayMicroseconds(4);
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);
long t = pulseIn(echo, HIGH);
int distance = t / 29 / 2;
int blynkDistance = (distance - MaxLevel) * -1;
if (distance <= MaxLevel) {
Blynk.virtualWrite(V1, blynkDistance);
} else {
Blynk.virtualWrite(V1, 0);
}
lcd.setCursor(0, 0);
lcd.print("WaterLevel:");
if (Level1 <= distance) {
lcd.setCursor(8, 0);
lcd.print("Very Low");
} else if (Level2 <= distance && Level1 > distance) {
lcd.setCursor(8, 0);
lcd.print("Low");
lcd.print(" ");
} else if (Level3 <= distance && Level2 > distance) {
lcd.setCursor(8, 0);
lcd.print("Medium");
lcd.print(" ");
} else if (Level4 <= distance && Level3 > distance) {
lcd.setCursor(8, 0);
lcd.print("High");
lcd.print(" ");
} else if (Level5 >= distance) {
lcd.setCursor(8, 0);
lcd.print("Full");
lcd.print(" ");
}
}
//Get the button value
BLYNK_WRITE(V3) {
bool Relay = param.asInt();
if (Relay == 1) {
digitalWrite(relay, LOW);
lcd.setCursor(0, 1);
lcd.print("Motor is ON ");
} else {
digitalWrite(relay, HIGH);
lcd.setCursor(0, 1);
lcd.print("Motor is OFF");
}
}
void loop() {
Blynk.run();//Run the Blynk library
timer.run();//Run the Blynk timer ```
} ```

@yenhing Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
Copy and paste these if you can’t find the correct symbol on your keyboard.
Pete.
donee
You need to upgrade your Blynk C++ library from 0.6.1 to 1.3.2
Pete.
Post your full code, correctly formatted, and I’ll take a look at it.
Pete.