     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");
     }

void setup()
{
    Serial.begin(115200);

    fsInit();

    initWifiManager();
    doSaveConfig();

    //read updated parameters
    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());
    // strcpy(blynk_token, custom_blynk_token.getValue());

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

    info();

    // MQTT
    client.setCallback(callback);

Adafruit_BMP085_Unified bmp;

// MQTT
const char config_path[20] = "/config.json";
char mqtt_server[120]="mqtt.broker.net";
char mqtt_port_config[6]="1883";
char mqtt_user[120]="";
char mqtt_password[120]="";
int mqtt_port = 1883;
const String topicCmd    = "esp/" + String(ESP.getChipId()) + "/cmd";
const String topicStatus = "esp/" + String(ESP.getChipId()) + "/status";
const String clientId = "ESP8266Client" + String(ESP.getChipId()) ;

WiFiClient espClient;
PubSubClient client(espClient);
