   Serial.print(hi);
   Serial.println(" *F");
   delay(500);
- return h;
-}
-
-float readTemperature() {
+  char humidity[10];
+  dtostrf(h, 2, 2, humidity);
+  return humidity;
+}
+
+String readTemperature() {
   // read the value on AnalogIn pin 0 and store it in a variable
   int sensorVal = analogRead(sensorPin);
   // send the 10-bit sensor value out the serial port


void loop() {
  Serial.println("DEBUG :: loop()");
  float tempVar = readTemperature();
  float humVar = getDHT11HumidityReadings();
  char temp[10];
  char humidity[10];
  dtostrf(tempVar, 2, 2, temp);
  dtostrf(humVar, 2, 2, humidity);
  Serial.print("DEBUG :: Temp value return is : ");
  Serial.println(temp);
  Serial.print("DEBUG :: Humidity value return is : ");
  Serial.println(humidity);
  publishTempHumMsg(temp, humidity);
  // MQTT client loop processing
  client.loop();
}

void checkTiltState() {
  tiltState = digitalRead(tiltSensorPin);
  Serial.print("INFO :: [1 -> On, 0 -> Off] :: Tilt State is : ");
  Serial.println(tiltState);
  if (tiltState != previousTiltState) {
    previousTiltState = tiltState;
    String tiltMsg = getSensorId();
    tiltMsg.concat(",");
    tiltMsg.concat(tiltState);
//    tiltMsg.concat(",");
//    tiltMsg.concat(time);
    char message_buff[30];
    tiltMsg.toCharArray(message_buff, tiltMsg.length()+1);
    //send tilt state to the tilt queue
    client.publish("arduino-tilt-exchange", message_buff);
  }
  
}

void connectToMQTT() {


//#define MQTT_SERVER "192.168.0.8"
byte mac[]    = {  0x90, 0xA2, 0xDA, 0x0E, 0x07, 0x18 };
byte serverRabbit[] = { 192, 168, 0, 2 };//192.168.0.8
byte ip[]     = { 192, 168, 0, 4 };
//char* user = "guest";
//char* pwd = "guest";
