ปรึกษาหน่อยครับ node mcu v3 ผมตั้งเวลาให้ส่งค่าอุณภูมิทุก1ชั่วโมง เมื่อ2วันที่แล้วลงปรับโค้ดใหม่โดยใช้wifi managerมาช่วยเรื่องเชื่อมต่ดไวไฟ แต่ปัญหาคือการส่งข้อมูลพอหลังตี3ไปแล้วตัวnode mcu จะหยุดส่งค่าอุณภูมิ ต้องถอดปลั๊กแล้วเสียบใหม่ถึงจะทำงาน ทั้งที่ก่อนหน้านี้โค้ดเดิมไม่เจอปัญหานี้ครับ มาเป็นเมื่อตอนใช้wifi managerครับ เกิดจากอะไรครับ
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 0 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 1 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 2 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 3 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 4 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 5 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 6 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 7 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 8 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 9 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 10 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 11 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 12 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 13 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 14 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 15 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 16 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 17 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 18 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 19 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 20 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 21 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 22 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
else if (t >= 8 && t <= 30 && p_tm->tm_hour == 23 && p_tm->tm_min == 0 && p_tm->tm_sec == 5)
{
LINE.notify("อุณหภูมิขณะนี้ " + String(t) + " ความชื้น " + String(h) + " %");
LINE.notifySticker(1, 407);
HTTPClient http;
String url = "http://iot.icreate.com/sensor-bziot-api.php/?datetime='" + String(now_day) + "%20" + String(now_time) + "'&temperature='" + String(t) + "'&humidity='" + String(h) + "'&device='" + String(device) + "'";
http.begin(url); // HTTP Initial
int httpCode = http.GET(); // ทำการ GET Request ไปยัง Server String response = myiot.WriteDashboard(userid, key, t, h, 0, 0, private_tweet, public_tweet);
}
}
}