           Serial.println(FPSTR(CONFPARSED));
           stassid = String((const char*)json["sta_ssid"]);
           stapass = String((const char*)json["sta_pass"]);
+          mqtt_channel = String((const char*)json["mqtt_channel"]);
+          mqtt_user = String((const char*)json["mqtt_user"]);
+          mqtt_pass = String((const char*)json["mqtt_pass"]);
+          
           hasSavedConfig = true;
         } else {
           Serial.println(FPSTR(CONFPARSEFAIL));

const char WIFIFAIL[] PROGMEM = {'WiFi: failed to connect to the AP'};
const char WIFICONF[] PROGMEM = {'Current config: '};
const char WIFIIP[] PROGMEM = {'IP: '};

/* Global constants */
#define MAX_CONNTRY 5
#define PWM_FREQ 100
#define CONFNAME "/wificreds.conf"

/* Global variables */
ESP8266WebServer myServer(8080);
String stassid = "";
String stapass = "";

void deleteWifiConfig() {
  cli();

  WiFi.setAutoConnect(false);
  WiFi.setAutoReconnect(true);
  for (uint8_t count = MAX_CONNTRY; count > 0; count--) {
    Serial.println(FPSTR(WIFICONNECTTRY));
    if (!WiFi.isConnected()) {
      WiFi.begin(stassid.c_str(), stapass.c_str());
    } else {
      Serial.println(FPSTR(WIFIFAIL));
      break;
    }
    delay(500);
  }
  
  // Check for wifi connected status after a number of tries
  if (!WiFi.isConnected()) {
    SLEDS_OFF;
    Serial.print(FPSTR(CANNOT_CONNECT));
    Serial.println(stassid.c_str());
    Serial.println(FPSTR(CONFSTR));
    WiFi.printDiag(Serial);
    Serial.println(FPSTR(RESETNODE));
    ERROR_ON;
  } else {
    SLEDS_OFF;
    WiFi.setAutoConnect(true);
    Serial.println("");
    Serial.println(FPSTR(WIFIOK));
