Error compiling for board nodemcu 1.0

#include <Blynk.h>

#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2 //กำหนดขาที่จะเชื่อมต่อ Sensor
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
//sensor pH start
#define BLYNK_PRINT Serial    
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

#define SensorPin 0          
unsigned long int avgValue;
float b;
int buf[10],temp;

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "QnQtZ45nMOWKDfwwbNCMUprhcL4-WIX_"; //Enter the Auth code which was send by Blink

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "polpolpol";  //Enter your WIFI Name
char pass[] = "polpolpol";  //Enter your WIFI Password
SimpleTimer timer;

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

//Config ขา Output
#define BT1 D1 //คือต่อรีเลย์ขา D0 กำหนดเป็นชื่อ BT1
#define BT2 D2 //คือต่อรีเลย์ขา D1 กำหนดเป็นชื่อ BT2
#define BT3 D3 //คือต่อรีเลย์ขา D2 กำหนดเป็นชื่อ BT3
#define BT4 D4 //คือต่อรีเลย์ขา D0 กำหนดเป็นชื่อ BT3

char auth1[] = "QnQtZ45nMOWKDfwwbNCMUprhcL4-WIX_";
char ssid1[] = "polpolpol";
char pass1[] = "polpolpol";

WidgetLED BT1Blynk(V10);
WidgetLED BT2Blynk(V11);
WidgetLED BT3Blynk(V12);
WidgetLED BT4Blynk(V13);

void setup(void) {
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library");
  sensors.begin();
  char auth[] = "QnQtZ45nMOWKDfwwbNCMUprhcL4-WIX_"; //แก้เป็นรหัสของตัวเอง
  Blynk.begin(auth, "polpolpol", "polpolpol"); // แก้ wifi
{

  Serial.begin(9600); // See the connection status in Serial Monitor
  Blynk.begin(auth, ssid, pass);
 
 
  timer.setInterval(1000L, sendSensor);
}

  // Debug console
  Serial.begin(9600);
 
  //กำหนดขา OUTPUT
  pinMode(BT1,OUTPUT);
  pinMode(BT2,OUTPUT);
  pinMode(BT3,OUTPUT);
  pinMode(BT4,OUTPUT);


  Blynk.begin(auth, ssid, pass);
}

BLYNK_CONNECTED() {
  Blynk.syncVirtual(V1);
  Blynk.syncVirtual(V2);
  Blynk.syncVirtual(V3);
  Blynk.syncVirtual(V4);


}
void sendSensor()
{  for(int i=0;i<10;i++)       //Get 10 sample value from the sensor for smooth the value
  {
    buf[i]=analogRead(SensorPin);
    delay(10);
  }
  for(int i=0;i<9;i++)        //sort the analog from small to large
  {
    for(int j=i+1;j<10;j++)
    {
      if(buf[i]>buf[j])
      {
        temp=buf[i];
        buf[i]=buf[j];
        buf[j]=temp;
      }
    }
  }
  avgValue=0;
  for(int i=2;i<8;i++)                    
    avgValue+=buf[i];
  float phValue=(float)avgValue*5.0/1024/6; //convert the analog into millivolt
  phValue = 4.5 *phValue;                      //convert the millivolt into pH value
   
  Serial.println(phValue);
  Blynk.virtualWrite(V1,phValue);  
}

void loop(void) {
  Serial.println("Requesting temperatures...");
  sensors.requestTemperatures(); //อ่านข้อมูลจาก library
  Serial.print("Temperature is: ");
  Serial.print(sensors.getTempCByIndex(0)); // แสดงค่า อุณหภูมิ
  Serial.println(" *C");
  delay(1000);
  Blynk.run();
  Blynk.virtualWrite(V0, sensors.getTempCByIndex(0)); //ส่งค่าไปแสดงใน blynk


  Blynk.run(); // Initiates Blynk
  timer.run(); // Initiates SimpleTimer
}

  BLYNK_WRITE(V1)
  {
    Serial.println(param.asInt());
      if (param.asInt()){
        digitalWrite(BT1, HIGH);
        BT1Blynk.on();
      } else {
        digitalWrite(BT1, LOW);
        BT1Blynk.off();
      }
  }
 
  BLYNK_WRITE(V2)
  {
    Serial.println(param.asInt());
      if (param.asInt()){
        digitalWrite(BT2, HIGH);
        BT2Blynk.on();
      } else {
         digitalWrite(BT2, LOW);
         BT2Blynk.off();
      }
  }
  BLYNK_WRITE(V3)
  {
    Serial.println(param.asInt());
      if (param.asInt()){
        digitalWrite(BT3, HIGH);
        BT3Blynk.on();
      } else {
         digitalWrite(BT3, LOW);
         BT3Blynk.off();
      }
  }
  BLYNK_WRITE(V4){
  {  
    Serial.println(param.asInt());
      if (param.asInt()){
        digitalWrite(BT4, HIGH);
        BT4Blynk.on();
      } else {
         digitalWrite(BT4, LOW);
         BT4Blynk.off();
      }
  }
}

@Yok_Wuttipong 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:
```

Pete.

thank you . Now it’s work right?
And… Bother you help check my code and how I fix it or where code it wrong.
thank you so much.

Your error message is because you are missing a closing curly bracket - one of these… } from the end of your void loop.

However, that isn’t your biggest problem. Your void loop breaks all of the Blynk rules. You should read this…

Pete.

now that problem is clear but it error here. error compiling for board nodemcu 1.0 (esp-12e module)

#include <Blynk.h>

#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2 //กำหนดขาที่จะเชื่อมต่อ Sensor
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
//sensor pH start
#define BLYNK_PRINT Serial    
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

#define SensorPin 0          
unsigned long int avgValue;
float b;
int buf[10],temp;

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "QnQtZ45nMOWKDfwwbNCMUprhcL4-WIX_"; //Enter the Auth code which was send by Blink

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "polpolpol";  //Enter your WIFI Name
char pass[] = "polpolpol";  //Enter your WIFI Password
SimpleTimer timer;

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

//Config ขา Output
#define BT1 D1 //คือต่อรีเลย์ขา D0 กำหนดเป็นชื่อ BT1
#define BT2 D2 //คือต่อรีเลย์ขา D1 กำหนดเป็นชื่อ BT2
#define BT3 D3 //คือต่อรีเลย์ขา D2 กำหนดเป็นชื่อ BT3
#define BT4 D4 //คือต่อรีเลย์ขา D0 กำหนดเป็นชื่อ BT3

char auth1[] = "QnQtZ45nMOWKDfwwbNCMUprhcL4-WIX_";
char ssid1[] = "polpolpol";
char pass1[] = "polpolpol";

WidgetLED BT1Blynk(V10);
WidgetLED BT2Blynk(V11);
WidgetLED BT3Blynk(V12);
WidgetLED BT4Blynk(V13);

void setup(void) {
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library");
  sensors.begin();
  char auth[] = "QnQtZ45nMOWKDfwwbNCMUprhcL4-WIX_"; //แก้เป็นรหัสของตัวเอง
  Blynk.begin(auth, "polpolpol", "polpolpol"); // แก้ wifi
{

  Serial.begin(9600); // See the connection status in Serial Monitor
  Blynk.begin(auth, ssid, pass);
 
 
  timer.setInterval(1000L, sendSensor);
}

  // Debug console
  Serial.begin(9600);
 
  //กำหนดขา OUTPUT
  pinMode(BT1,OUTPUT);
  pinMode(BT2,OUTPUT);
  pinMode(BT3,OUTPUT);
  pinMode(BT4,OUTPUT);


  Blynk.begin(auth, ssid, pass);
}

BLYNK_CONNECTED() {
  Blynk.syncVirtual(V1);
  Blynk.syncVirtual(V2);
  Blynk.syncVirtual(V3);
  Blynk.syncVirtual(V4);


}
void sendSensor()
{  for(int i=0;i<10;i++)       //Get 10 sample value from the sensor for smooth the value
  {
    buf[i]=analogRead(SensorPin);
    delay(10);
  }
  for(int i=0;i<9;i++)        //sort the analog from small to large
  {
    for(int j=i+1;j<10;j++)
    {
      if(buf[i]>buf[j])
      {
        temp=buf[i];
        buf[i]=buf[j];
        buf[j]=temp;
      }
    }
  }
  avgValue=0;
  for(int i=2;i<8;i++)                    
    avgValue+=buf[i];
  float phValue=(float)avgValue*5.0/1024/6; //convert the analog into millivolt
  phValue = 4.5 *phValue;                      //convert the millivolt into pH value
   
  Serial.println(phValue);
  Blynk.virtualWrite(V1,phValue);  
}

void loop(void) 
{
  Serial.println("Requesting temperatures...");
  sensors.requestTemperatures(); //อ่านข้อมูลจาก library
  Serial.print("Temperature is: ");
  Serial.print(sensors.getTempCByIndex(0)); // แสดงค่า อุณหภูมิ
  Serial.println(" *C");
  delay(1000);
  Blynk.run();
  Blynk.virtualWrite(V0, sensors.getTempCByIndex(0)); //ส่งค่าไปแสดงใน blynk


  Blynk.run(); // Initiates Blynk
  timer.run(); // Initiates SimpleTimer
}

  BLYNK_WRITE(V1)
  {
    Serial.println(param.asInt());
      if (param.asInt()){
        digitalWrite(BT1, HIGH);
        BT1Blynk.on();
      } else {
        digitalWrite(BT1, LOW);
        BT1Blynk.off();
      }
  }
 
  BLYNK_WRITE(V2)
  {
    Serial.println(param.asInt());
      if (param.asInt()){
        digitalWrite(BT2, HIGH);
        BT2Blynk.on();
      } else {
         digitalWrite(BT2, LOW);
         BT2Blynk.off();
      }
  }
  BLYNK_WRITE(V3)
  {
    Serial.println(param.asInt());
      if (param.asInt()){
        digitalWrite(BT3, HIGH);
        BT3Blynk.on();
      } else {
         digitalWrite(BT3, LOW);
         BT3Blynk.off();
      }
  }
  BLYNK_WRITE(V4){
  {  
    Serial.println(param.asInt());
      if (param.asInt()){
        digitalWrite(BT4, HIGH);
        BT4Blynk.on();
      } else {
         digitalWrite(BT4, LOW);
         BT4Blynk.off();
      }
  }
}

Change this line:

to this:

BlynkTimer timer;

and delete the following lines…

Pete.

when I push botton , Relay doesn’t work acutually it must to play relay 1 , 3 and 4 but It don’t have anything happen. (same code , How I can fix it?? )
Thank you for your helping.

What exactly does this mean?

Did you sort-out your void loop ?

How are you powering your relays, and can you make them work by connecting the In1, 2, 3 & 4 pins to GND or VCC?

Pete.