     json["mqtt_user"] = mqtt_user;
     json["mqtt_password"] = mqtt_password;
 
-    File configFile = SPIFFS.open("/config.json", "w");
+    File configFile = SPIFFS.open(config_path, "w");
     if (!configFile) {
       Serial.println("failed to open config file for writing");
     }

          strcpy(mqtt_user, json["mqtt_user"]);
          strcpy(mqtt_password, json["mqtt_password"]);

        } else {
          Serial.println("failed to load json config");
        }

void setup()
{
    Serial.begin(115200);
    Serial.println("Setup");

    fsInit();
    initWifiManager();

    //read updated parameters
    Serial.println("read custom config");
    strcpy(mqtt_server, custom_mqtt_server.getValue());
    strcpy(mqtt_port_config, custom_mqtt_port.getValue());
    strcpy(mqtt_user, custom_mqtt_user.getValue());
    strcpy(mqtt_password, custom_mqtt_password.getValue());

    // convert port
    mqtt_port = String(mqtt_port_config).toInt();

    info();

    doSaveConfig();

    // MQTT
    client.setCallback(callback);
