     Serial.print("Ooops, no TSL2561 detected ... Check your wiring or I2C ADDR!");
     while(1);
   }
-  
-  /* Setup the sensor gain and integration time */
-  configureLightSensor();
-  
-
 }
 
 void loop() {
   digitalWrite(LEDPIN, HIGH);
+  digitalWrite(XBEESLEEPPIN, LOW);  //Wake UP XBEE
+
+  configureLightSensor();
    
   Serial.print("{'_sensor': 'weather', '_sample': {'_id':"); 
   Serial.print(sample++); 

int sample=0;

void setup() {
  Serial.begin(57600); 
  dht.setup(DHTPIN);
  

  Serial.println("}}");
  
  digitalWrite(LEDPIN, LOW);
  digitalWrite(XBEESLEEPPIN, HIGH);  //Put XBEE to sleep
  
  sleep(30000);
}

void configureLightSensor(void)
