 #include <WiFiManager.h>          //https://github.com/tzapu/WiFiManager
 #include <ArduinoJson.h>          //https://github.com/bblanchon/ArduinoJson
 
-/* Store strings in PROGMEM
-
-*/
+/* Store strings in PROGMEM */
 const char CANNOT_CONNECT[] PROGMEM = {'Cannot connect to the AP: '};
 const char MOUNTFAIL[] PROGMEM = {'Failed to mount file system!'};
+const char FSMOUNTED[] PROGMEM = {'mounted file system'};
 const char SAVEWCONF[] PROGMEM = {'Saving the WiFi configuration...'};
 const char CONFMODE[] PROGMEM = {'Entered to configuration mode...'};
 const char RESETNODE[] PROGMEM = {'Entered to configuration mode...'};

const char MACMSG[] PROGMEM = {'MAC Address: '};
const char APIPSTR[] PROGMEM = {'AP IP: '};
const char NOCONF[] PROGMEM = {'Config file not found!'};

#define PWM_FREQ 100
#define AP_PASSW "xxx0xxx"
#define CONFNAME "/wificreds.conf"

ESP8266WebServer myServer(8080);
String stassid = "";
String stapass = "";

  stapass = WiFi.psk();
  File configFile = SPIFFS.open(CONFNAME, "w");
  if (configFile) {
        Serial.println(FPSTR(CONFOPEN));
  } else {
        Serial.println(FPSTR(CONFFAILOPEN));
        return;
  }
  Serial.println(FPSTR(CONFOPENSAVE));
  StaticJsonBuffer<200> jsonBuffer;
  JsonObject& json = jsonBuffer.createObject();
  json["sta_ssid"] = stassid;
  json["sta_pass"] = stapass;
  json.printTo(configFile);
  Serial.println(FPSTR(CONFSAVED));
}

void configModeCallback(WiFiManager *myWfMan) {
