     Serial.println("------Count------/");
 }
 
+void inline updateCountErrosAndPrint() {
+    if(errorCount > 1000) {
+        Serial.println("/-----errorCount-------");
+        Serial.println(errorCount);
+        Serial.println("------errorCount------/");
+        errorCount = 0;
+        resetFunc();
+    }
+}
+
 void loop() {
     updateNtp();
     readMotionSensorAndSendToFirebase();

    pinMode(FANPIN, OUTPUT);
    pinMode(LIGHTPIN, OUTPUT);
    pinMode(SENSORPIN, INPUT);
    motionSensorRead = !digitalRead(SENSORPIN);
    digitalWrite(LED_BUILTIN, !Firebase.getBool(String(DEVICE_PATH) + "light"));

}

inline String getErrorString(String table) {
    return String(TABLE_LEITURA) + " failed to send:";

#define FANPIN D6
#define LIGHTPIN D5
#define SENSORPIN D8

#define REDPIN D7
#define GREENPIN D0
#define BLUEPIN D3

#define DHTTYPE DHT11
#define DELAY_TIME_TO_SEND  360
#define TABLE_LEITURA "leitura"
#define TABLE_MOTION "motion"
#define CLIENT_EMAIL "well.oliveira.snt@gmail.com"  
#define DEVICE_PATH "/devices/mkW3jbNvyKMzC8FLODaQd7GAum023/"

DHT dht(DHTPIN, DHTTYPE);

