 //      Serial.println("Failed to Connect to RabbitMQ");
 //    }
 // }
- 
- if (wifiClient.connect(server, 80)) {
-    Serial.println("connected");
-    // Make a HTTP request:
-    wifiClient.println("GET /search?q=arduino HTTP/1.1");
-    wifiClient.println("Host: www.google.com");
-    wifiClient.println("Connection: close");
-    wifiClient.println();
-  } 
-  else {
-    // kf you didn't get a connection to the server:
-    Serial.println("WIFI google connection failed");
-  }
-}
-
-void loop() {
-  Serial.println("loop");
-  
-  if (wifiClient.available()) {
-    char c = wifiClient.read();
-    Serial.print(c);
-  }
-  
-  float tempVar = readTemperature();
-  char temp[10];
-  dtostrf(tempVar, 2, 2, temp);
-  Serial.print("Temp value return is : ");
-  Serial.println(temp);
-//  publishTempHumMsg(temp, "0");
-}
-
-
-void publishTempHumMsg(String temp, String humidity) {
-  
-  if (!client.connected()) {
+if (!client.connected()) {
     delay(1000);
-    Serial.println("Connecting to RabbitMQ");
-    if (client.connect("ArduinoClient", user, pwd)) {
-      client.publish("topic","Connected to RabbitMQ");
-      Serial.println("Connected to RabbitMQ");
+    Serial.println("INFO :: Connecting to RabbitMQ");
+    if (client.connect("ArduinoClient", "guest", "guest")) {
+      Serial.println("DEBUG :: About to sent message......");
+      client.publish("arduino-weather-exchange","Connected to RabbitMQ");
+      Serial.println("INFO :: Connected to RabbitMQ");
     } else {
-      Serial.println("Failed to Connect to RabbitMQ");
+      Serial.println("ERROR :: Failed to Connect to RabbitMQ");
     }
   } else {
     client.publish("outTopic", "hello world");
   }
-  
-//  if (client.connect("arduinoClient", "guest", "guest")) {
-//    Serial.println("connected to rabbit!!!");
-//    client.publish("outTopic", "hello world");
+}
+
+void publishTempHumMsg(String temp, String humidity) {
 //    client.subscribe("inTopic");
-//  } else {
-//    Serial.println("Failed to connect!!! 101");
-//  }
   //MQTT send json???
   //String pubString = "{\"report\":{\"temp\": \"" + String(temperature) + "\"}}";
   //      pubString.toCharArray(message_buff, pubString.length()+1);
-  Serial.println("sending temp ");
+  Serial.println("DEBUG :: Sending temp ");
   Serial.println(temp);
   //"io.m2m/arduino/lightsensor"
-  client.publish("topicTempHum", "temp");
-
-  // MQTT client loop processing
- // client.loop();
-}
-
-void printMacAddress() {
-  // the MAC address of your Wifi shield
-  byte mac[6];
-
-  // print your MAC address:
-  WiFi.macAddress(mac);
-  Serial.print("MAC: ");
-  Serial.print(mac[5], HEX);
-  Serial.print(":");
-  Serial.print(mac[4], HEX);
-  Serial.print(":");
-  Serial.print(mac[3], HEX);
-  Serial.print(":");
-  Serial.print(mac[2], HEX);
-  Serial.print(":");
-  Serial.print(mac[1], HEX);
-  Serial.print(":");
-  Serial.println(mac[0], HEX);
+  client.publish("arduino-weather-exchange", "temp");
 }
 
 
 void printWifiData() {
-  Serial.println("------> printWifiData s");
   // print your WiFi shield's IP address:
   IPAddress ip = WiFi.localIP();
-  Serial.print("IP Address: ");
+  Serial.print("DEBUG :: IP Address: ");
   Serial.println(ip);
-  //Serial.println(ip);
-
   // print your MAC address:
   byte mac[6];
   WiFi.macAddress(mac);
-  Serial.print("MAC address: ");
+  Serial.print("DEBUG :: MAC address: ");
   Serial.print(mac[5], HEX);
   Serial.print(":");
   Serial.print(mac[4], HEX);

  return temperature;
}

// handles message arrived on subscribed topic(s)
void callback(char* topic, byte* payload, unsigned int length) {



  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("DEBUG :: Signal strength (RSSI):");
  Serial.println(rssi);

  // print the encryption type:
  byte encryption = WiFi.encryptionType();
  Serial.print("DEBUG :: Encryption Type:");
  Serial.println(encryption, HEX);
  Serial.println();
}


