 Task wifiTask(30000, sendStatus);
 Task sensorTask(1200, detectPresence);
 Task blinkTask(500, pblink);
+
 
 void setup() {
     pinMode(sensor, INPUT);

    }
 
    Serial.print("Requesting " + action + "... ");
    action = action + " HTTP/1.0\r\n\r\n";
    wifi.print("AT+CIPSEND=");
    delay(100);
    wifi.println(action.length());



void healthcheck() {
    request(SERVER_ADDRESS, SERVER_PORT, healthcheckAction, SERVER_HOSTNAME);
}

void registerEvent() {
    request(SERVER_ADDRESS, SERVER_PORT, eventAction, SERVER_HOSTNAME);
}


void request(String host, int port, String action, String hostName) {

    if (!hostName) {
      hostName = host;
    }

    wifi.println("AT+CIPSTART=\"TCP\",\"" + host + "\"," + port);
    delay(2000);
    if (wifi.find("Error")) {
