 MqttClient *mqtt									= NULL;
 Sensor* sensorTemperature							= NULL;
 Sensor* sensorHumidity								= NULL;
-unsigned long publishPeriodMs						= MQTT_PUBLISH_PERIOD_MS;
+unsigned long publishPeriodMs						= 0;
 unsigned long publishTs								= 0;
+unsigned long updateConfigTs						= 0;
 int connectCounter									= 0;
 bool firstPublish									= false;
 

	);
	const int NUMBER_OF_ROOT_PARAMETERS = 1;
	// See JSON_OBJECT_SIZE to predict buffer size
	// Let's make double the prediction
	const int BUFFER_SIZE = 2 * (JSON_OBJECT_SIZE(NUMBER_OF_ROOT_PARAMETERS));
	StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
	JsonObject& root = jsonBuffer.parseObject((char*)payload);
	// Check if parsing succeeds
	if (!root.success()) {
		LOG_PRINTFLN("ERROR, Can't pars configuration");
		return;
	}
	publishPeriodMs = root["period"];
}

void networkHibernate(unsigned long delay) {

void(* reset) (void) = 0;//declare reset function at address 0
void check();
void connect();
bool updateConfig();
void buildMessagePayload(char* buffer, int size);
void processMessageConfig(MqttClient::MessageData& md);
void networkHibernate(unsigned long);
