 		MQTTPacket_connectData data = MQTTPacket_connectData_initializer;
 		data.willFlag = 1;
 		data.MQTTVersion = 4;
+		data.cleansession = 1;
+		data.keepAliveInterval = 10;
 		data.clientID.cstring = (char*)"sensor-1";
 		data.will.topicName.cstring = (char*)willTopicBuffer;
 		data.will.qos = 2;

}

void loop() {
	if (!mqttClient.isConnected()) {
		connect();
	} else {
		checkSwitches();
	}
}
//IP constants
byte mac[] = { 0x90, 0xA2, 0xDA, 0x10, 0x39, 0x37 }; //MAC address for sensor device

//MQTT constants
const char* mainTopic = "londonbridge";
MQTT::QoS qos = MQTT::QOS1;
bool retained = true;
int timeout = 5000; //5 seconds for client to publish before timing out

//MQTT variables
MQTT::Client<IPStack, Countdown> mqttClient = MQTT::Client<IPStack, Countdown>(ipstack, timeout);
char room[21] = "roman"; //name of room within building

//Room State
enum RoomState
