   //end read
 }
 
+void resetConfig() {
+  Serial.println("Config : reset");
+
+  if (SPIFFS.begin() && SPIFFS.exists(config_path)) {
+    SPIFFS.remove(config_path);
+  }
+
+  WiFiManager wifiManager;
+  wifiManager.resetSettings();
+
+}
+
+
   // The extra parameters to be configured (can be either global or just in the setup)
   // After connecting, parameter.getValue() will get you the configured value
   // id/name placeholder/prompt default length
 
 WiFiManagerParameter custom_mqtt_server("server", "mqtt server", mqtt_server, 120);
-WiFiManagerParameter custom_mqtt_port("port", "mqtt port", mqtt_port_config, 5);
+WiFiManagerParameter custom_mqtt_port("port", "mqtt port", mqtt_port_config, 6);
 WiFiManagerParameter custom_mqtt_user("user", "mqtt user", mqtt_user, 120);
 WiFiManagerParameter custom_mqtt_password("password", "mqtt password", mqtt_password, 120);
 
 void initWifiManager() {
-
+  Serial.println("initWifiManager");
+info();
   //WiFiManager
   //Local intialization. Once its business is done, there is no need to keep it around
   WiFiManager wifiManager;


void sendTemperature(float aTemperature){
  ftoa(msg, aTemperature, 2);
  snprintf (topic, sizeof(topic), "%s/%s", topicStatus, "temperature");
  sendmsgToTopic();
}

void sendPressure(int aPresure){
  snprintf (msg, sizeof(msg), "%d", aPresure);
  snprintf (topic, sizeof(topic), "%s/%s", topicStatus, "pressure");
  sendmsgToTopic();
}

void sendLight(uint16_t aLight){
  snprintf (msg, sizeof(msg), "%d", aLight);
  snprintf (topic, sizeof(topic), "%s/%s", topicStatus, "light");
  sendmsgToTopic();
}


    } else {

      if(--cpt==0){
        resetConfig();
        ESP.reset();
        return;
      }

