     sensors.begin();
     Serial.print(" Requesting temperatures...");
     sensors.requestTemperaturesByIndex(0); 
-    Serial.print("Temperature for sensor T");
-    Serial.print(sensor_id);
-    Serial.print(" is: ");
+    Serial.print("Temperature: ");
     double temperature = sensors.getTempCByIndex(0);
     Serial.print(temperature); Serial.println(" *C"); 
     char temp[] = "";
     dtostrf(temperature,1, 2, temp);
     DynamicJsonBuffer jsonBufferFS;
     JsonObject& rootFS2 = jsonBufferFS.createObject();
-    rootFS2["topic"] = String(getMac()+"/sensors/T"+sensor_id+"/output/value");
+    rootFS2["topic"] = TEMP_TOPIC;
     rootFS2["payload"] = String(temperature);
     String json_msg;
     rootFS2.printTo(json_msg);
     Serial.println("Sending.....");
     uint32_t dest = GW_ID;
-    String encrypted_msg = AES_encrypt(json_msg, key);
+    String encrypted_msg = AES_encrypt(json_msg, AES_KEY);
     mesh.sendSingle( dest, encrypted_msg );
 
     return sensors.getDeviceCount();

#include <DallasTemperature.h>
#include<ESP8266WiFi.h>

//************************************************************
// this is a simple example that uses the easyMesh library
//
// 1. blinks led once for every node on the mesh
// 2. blink cycle repeats every BLINK_PERIOD
// 3. sends a silly message to every node on the mesh at a random time betweew 1 and 5 seconds
// 4. prints anything it recieves to Serial.print
// 
//
//************************************************************
#include <painlessMesh.h>
#include <AES.h>
#include "HashMap.h" 
#include "SimpleList.h"

// some gpio pin that is connected to an LED... 
// on my rig, this is 5, change to the right number of your LED.
#define   LED             D1      // GPIO number of connected LED

#define   BLINK_PERIOD    1000000 // microseconds until cycle repeat
#define   BLINK_DURATION  100000  // microseconds LED is on for

#define   MESH_SSID       "whateverYouLike"
#define   MESH_PASSWORD   "somethingSneaky"
#define   MESH_ENCRYPT    "sampleEncryptKey"
#define   MESH_PORT       5555
#define   GW_ID           2143537872

#define NC_ID 0x00
#define WIND_ID 0x01
#define VOLT_ID 0x02
#define CURR_ID 0x03
#define HUM_ID 0x04
#define TEMP_ID 0x05
#define DOOR_ID 0x06
#define RELAY_ID 0x07
#define LIGHT_ID 0x08

#define SEND_INTERVAL 1000

painlessMesh  mesh;
bool calc_delay = false;
SimpleList<uint32_t> nodes;
uint32_t sendMessageTime = 0;

String key = "0123456789010123";
int bits = 256;
unsigned long long int my_iv = 36753562;

long lastMsg[17] = {millis(), millis(), millis(), millis(),
                    millis(), millis(), millis(), millis(),
                    millis(), millis(), millis(), millis(),
                    millis(), millis(), millis(), millis(), millis()};

// {Identifier => Sensor type} Map 
CreateHashMap(sensTypeMap, String, int, 8);

/************************************************************************/
/* Turns returned mac address into a readable string                    */



/************************************************************************/
/* Reads and returns the device MAC adress as a String                  */
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
String getMac()                                    
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
