Code error blynk offline for esp8266

Code error blynk offline for esp8266

diff --git a/ESP32/.vscode/arduino.json b/ESP32/.vscode/arduino.json
index fe55257..cbf21b8 100644
--- a/ESP32/.vscode/arduino.json
+++ b/ESP32/.vscode/arduino.json
@@ -2,5 +2,5 @@
     "board": "esp32:esp32:esp32doit-devkit-v1",
     "configuration": "FlashFreq=80,UploadSpeed=115200,DebugLevel=none",
     "port": "COM10",
-    "sketch": "dht_error_was_not_declared\\dht_error_was_not_declared.ino"
+    "sketch": "widget_Real-time_clock\\widget_Real-time_clock.ino"
 }
\ No newline at end of file
diff --git a/ESP32/.vscode/c_cpp_properties.json b/ESP32/.vscode/c_cpp_properties.json
index d9af936..fb16662 100644
--- a/ESP32/.vscode/c_cpp_properties.json
+++ b/ESP32/.vscode/c_cpp_properties.json
@@ -18,7 +18,8 @@
                 "C:\\Program Files (x86)\\Arduino\\libraries\\**",
                 "C:\\Users\\ArcHeR\\Documents\\Arduino\\libraries\\**",
                 "D:\\Work\\3.Project_32\\**",
-                "C:\\Users\\ArcHeR\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.3\\**"
+                "C:\\Users\\ArcHeR\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.3\\**",
+                "C:\\Users\\ArcHeR\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.4\\**"
             ],
             "forcedInclude": [],
             "intelliSenseMode": "msvc-x64",
diff --git a/ESP32/.vscode/settings.json b/ESP32/.vscode/settings.json
index 38fc339..e6d763a 100644
--- a/ESP32/.vscode/settings.json
+++ b/ESP32/.vscode/settings.json
@@ -3,4 +3,22 @@
     "files.associations": {
         "*.tcc": "cpp"
     }
+     // MAGIC (XL)
+     "powermode.enabled": true,
+     "powermode.enableShake": false,
+ 
+     "powermode.customExplosions": [
+         "https://i.imgur.com/CnBUEmi.gif"
+     ],
+     "powermode.explosionOrder": "sequential",
+     "powermode.explosionSize": 12,
+     "powermode.explosionFrequency": 2,
+     "powermode.maxExplosions": 10,
+     "powermode.explosionOffset": 0.215,
+     "powermode.customCss": {
+         "mix-blend-mode": "color-dodge"
+     },
+     "powermode.gifMode": "restart",
+     "powermode.explosionDuration": 1000,
+     "powermode.backgroundMode": "mask",
 }
\ No newline at end of file
diff --git a/ESP32/widget_Real-time_clock/widget_Real-time_clock.ino b/ESP32/widget_Real-time_clock/widget_Real-time_clock.ino
new file mode 100644
index 0000000..2aff2c4
--- /dev/null
+++ b/ESP32/widget_Real-time_clock/widget_Real-time_clock.ino
@@ -0,0 +1,60 @@
+#define BLYNK_PRINT Serial
+#include <WiFi.h>
+#include <SPI.h>
+#include <TimeLib.h>
+//#include <WidgetRTC.h>
+#include <BlynkSimpleEsp32.h>
+#include <SimpleTimer.h> //Blynk
+#include <Timer.h>
+
+char auth[] = "puzBx8DXSo2cqQA_1-pjjvopu1e7VNAX"; 
+char server[] = "oasiskit.com";
+int port = 8080;
+
+char ssid[] = "Eleceasy"; // ชื่อไวไฟ ที่บอร์ดจะ connect
+char pass[] = "Bb20072536"; // พาสเวิร์ดของไวไฟ
+
+BlynkTimer timer;
+WidgetRTC rtc;
+
+// ฟังก์ชันนาฬิกาดิจิตอลแสดงเวลา
+void clockDisplay()
+{
+
+  String currentTime = String(hour()) + ":" + minute() + ":" + second();
+  String currentDate = String(day()) + " " + month() + " " + year();
+  Serial.print("Current time: ");
+  Serial.print(currentTime);
+  Serial.print(" ");
+  Serial.print(currentDate);
+  Serial.println();
+
+  // ส่งเวลาไปที่แอพ
+  Blynk.virtualWrite(V1, currentTime);
+  // ส่งวันที่ไปที่แอพ
+  Blynk.virtualWrite(V2, currentDate);
+}
+
+BLYNK_CONNECTED() {
+  // ซิงโครไนซ์เวลาในการเชื่อมต่อ
+  rtc.begin();
+}
+
+void setup()
+{
+
+  Serial.begin(115200);
+
+  // แสดงนาฬิกาดิจิตอลทุก 10 วินาที
+  timer.setInterval(10000L, clockDisplay);
+  WiFi.begin(ssid, pass);
+  Blynk.config(auth, server, port);
+  Blynk.connect();
+  setSyncInterval(10 * 60); // ช่วงเวลาการซิงค์เป็นวินาที (10 นาที)
+}
+
+void loop()
+{
+  Blynk.run();
+  timer.run();
+}
\ No newline at end of file
diff --git a/ESP8266/.vscode/arduino.json b/ESP8266/.vscode/arduino.json
index 1ac7b33..375ebfa 100644
--- a/ESP8266/.vscode/arduino.json
+++ b/ESP8266/.vscode/arduino.json
@@ -1,6 +1,6 @@
 {
-    "board": "esp32:esp32:esp32doit-devkit-v1",
-    "configuration": "FlashFreq=80,UploadSpeed=115200,DebugLevel=none",
+    "board": "esp8266:esp8266:nodemcuv2",
+    "configuration": "xtal=80,vt=flash,exception=legacy,ssl=all,eesz=4M2M,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200",
     "port": "COM10",
-    "sketch": "1x1_Beta_FlowSW.ino"
+    "sketch": "Blynk_offline\\Blynk_offline.ino"
 }
\ No newline at end of file
diff --git a/ESP8266/.vscode/c_cpp_properties.json b/ESP8266/.vscode/c_cpp_properties.json
index fb16662..db85637 100644
--- a/ESP8266/.vscode/c_cpp_properties.json
+++ b/ESP8266/.vscode/c_cpp_properties.json
@@ -3,6 +3,7 @@
         {
             "name": "Win32",
             "includePath": [
+                "C:\\Users\\ArcHeR\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\**",
                 "C:\\Users\\ArcHeR\\Documents\\Arduino\\libraries\\Adafruit_Unified_Sensor",
                 "C:\\Users\\ArcHeR\\Documents\\Arduino\\libraries\\DHT_sensor_library",
                 "C:\\Users\\ArcHeR\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\**",
diff --git a/ESP8266/Blynk_offline/Blynk_offline.ino b/ESP8266/Blynk_offline/Blynk_offline.ino
new file mode 100644
index 0000000..93150e0
--- /dev/null
+++ b/ESP8266/Blynk_offline/Blynk_offline.ino
@@ -0,0 +1,97 @@
+#define BLYNK_PRINT Serial
+
+#include <ESP8266WiFi.h>
+#include <BlynkSimpleEsp8266.h>
+#include <SimpleDHT.h>
+#include <SimpleTimer.h>
+//ปั้ม
+ int pinPump1 = D2;
+ int pinPump2 = D3;
+ int pinPump3 = D4;
+// DHT Config
+int pinDHT22 = D0;
+SimpleDHT22 dht22;
+
+// SET Timer
+SimpleTimer timer;
+
+// You should get Auth Token in the Blynk App.
+// Go to the Project Settings (nut icon).
+char auth[] = "31XmVGrutN6PTd-fcSTcQLEPLZnSJNMR";
+
+// Your WiFi credentials.
+// Set password to "" for open networks.
+char ssid[] = "Ammara_2.4GHz";
+char pass[] = "0866922890";
+// Line config
+
+BLYNK_CONNECTED() {
+    Blynk.syncAll();
+}
+
+
+  float temperature = 0;
+  float humidity = 0;
+
+int setTemp;
+int setHumid;
+
+BLYNK_WRITE(V4) //temperature slider in app on pin V4
+{
+setTemp = param.asFloat();
+}
+BLYNK_WRITE(V3) //temperature slider in app on pin V3
+{
+setHumid = param.asFloat();
+}
+
+void setup()
+{
+  // Debug console
+  Serial.begin(115200);
+  // You can also specify server:
+  Blynk.begin(auth, ssid, pass, "oasiskit.com", 8080);
+  timer.setInterval(4000L, sendTemp);
+  pinMode(pinPump1, OUTPUT);
+  pinMode(pinPump2, OUTPUT);
+  pinMode(pinPump3, OUTPUT);
+}
+
+void sendTemp()
+{
+  int err = SimpleDHTErrSuccess;
+  if ((err = dht22.read2(pinDHT22, &temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
+    Serial.print("Read DHT22 failed, err="); Serial.println(err);delay(4000);
+    return;
+}  
+  Blynk.virtualWrite(V1, temperature); // virtual pin 
+  Blynk.virtualWrite(V2, humidity); // virtual pin 
+}
+
+void loop()
+{
+  if (temperature >= setTemp)
+  {
+    digitalWrite(pinPump1, HIGH);
+    digitalWrite(pinPump2, HIGH);
+    digitalWrite(pinPump3, HIGH);
+  }
+  else
+  {
+    digitalWrite(pinPump1, LOW);
+    digitalWrite(pinPump2, LOW);
+    digitalWrite(pinPump3, LOW);
+  }
+  if (humidity <= setHumid)
+  {
+    digitalWrite(pinPump1, HIGH);
+    digitalWrite(pinPump2, HIGH);
+    digitalWrite(pinPump3, HIGH);
+  }
+  else
+  {
+    digitalWrite(pinPump1, LOW);
+    digitalWrite(pinPump2, LOW);
+    digitalWrite(pinPump3, LOW);
+  }
+}
\ No newline at end of file

GitHub
sha: f99e6a33