     }
   }
   
-  long currentMillis = millis();
+  unsigned long currentMillis = millis();
   
   if (!connected && (currentMillis - lastConnectionRetry >= CONN_RETRY_DELAY)) {
     lastConnectionRetry = currentMillis;

    lastConnectionCheck = currentMillis;
    checkConnectionStatus();
  }

}

void initWifiModule() {

         "password" // PWD
         }; 

unsigned long lastConnectionRetry = 0;
int CONN_RETRY_DELAY = 1000;

unsigned long lastSensorCheck = 0;
long SENSOR_CHECK_RATE = 300000; // 5 minutes

unsigned long lastConnectionCheck = 0;
long CONN_CHECK_RATE = 300000; // 5 minutes 300000

unsigned long lastSensorDataUpdate = 0;
long SENSOR_DATA_UPDATE = 1200000; // 20 min

byte OUT_CONN_ID = 0;

