คือ NodeMCU esp8266 แจ้งเตือนLINE notify 3-4แล้วหยุดไม่แจ้งต่อ รบกวนท่านใดช่วยดูให้หน่อยคับ
#include <Wire.h>
#include <TridentTD_LineNotify.h>
#include <ESP8266WiFi.h>
#define SSID "***************"
#define PASSWORD "****************"
#define LINE_TOKEN "4DkscDhriLW9NFrhZoKVgaPyBxDOTf5gUHEL9Zh7CeP"
int Relay1 = D0;
int SoilSensor = A0;
float soil = 0;
String LineText ="";
String LineText2 ="";
void setup() {
pinMode(Relay1,OUTPUT);
Serial.begin(115200);
Serial.println();
Serial.println(LINE.getVersion());
WiFi.begin(SSID, PASSWORD);
Serial.printf("WiFi connecting to %s\n", SSID);
while(WiFi.status() != WL_CONNECTED)
{ Serial.print(".");
delay(400);
}
Serial.println("Connected to WiFi");
Serial.println(WiFi.localIP());
LINE.setToken(LINE_TOKEN);
LINE.notifySticker(11538,51626494);
}
void loop() {
soil = analogRead(SoilSensor);
float LevelSoil = ((soil * 100.0) / 1024.0)-100;
float LevelSoil1 = LevelSoil*(-1);
Serial.print("Humidity = ");
Serial.print(LevelSoil1);
Serial.println("%");
LineText = "ความชื่นต่ำ = " + String(LevelSoil1, 1) + " %";
LineText2 = "ความชื่นปัจจุบัน = " + String(LevelSoil1, 1) + " %";
if(LevelSoil1 <= 35){
digitalWrite(Relay1,HIGH);
Serial.println("PUMP = ON");
LINE.notify(LineText);
LINE.notify("ทำการลดน้ำ");
}
else{
digitalWrite(Relay1,LOW);
Serial.println("PUMP = OFF");
LINE.notify(LineText2);
}
delay(2000);
}