Hi, the following sketch works brilliantly with a wemos D1 & a RCWL 0516 SENSOR. I receive a notification by pushingbox sent to prowl on my iphone approx 5 seconds after detection.
However, subsequent notifications do not arrive until at least 5 minutes have passed and this can increase to forever if the sensor keeps detecting movement after the first movement .
I have no idea why there has to be a minimum 5 minute gap between the first detection and the second and why it will not reset unless there is zero movement?
Any ideas how to fix this?
#include <ESP8266WiFi.h>
// PushingBox scenario DeviceId code and API
String deviceId = "v0537B7BA20EAEB9";
const char* logServer = "api.pushingbox.com";
const char* ssid = "XXXXXXXXXXXX";
const char* password = "XXXXXXXXXXXX";
void setup() {
Serial.begin(74880);
// Sending a notification to your mobile phone
// function takes the message as a parameter
sendNotification("Hello World from ESP8266!");
}
void sendNotification(String message) {
Serial.println("- connecting to Home Router SID: " + String(ssid));
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.println("- succesfully connected");
Serial.println("- starting client");
WiFiClient client;
Serial.println("- connecting to pushing server: " + String(logServer));
if (client.connect(logServer, 80)) {
Serial.println("- succesfully connected");
String postStr = "devid=";
postStr += String(deviceId);
postStr += "&message_parameter=";
postStr += String(message);
postStr += "\r\n\r\n";
Serial.println("- sending data...");
client.print("POST /pushingbox HTTP/1.1\n");
client.print("Host: api.pushingbox.com\n");
client.print("Connection: close\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
}
client.stop();
Serial.println("- stopping the client");
}
void loop() {}