 
 void sendTemperature(float aTemperature){
   ftoa(msg, aTemperature, 2);
-  snprintf (topic, sizeof(topic), "%s/%s", topicStatus, "temperature");
+  snprintf (topic, sizeof(topic), "%s/%s", topicStatus.c_str(), "temperature");
   sendmsgToTopic();
 }
 
 void sendPressure(int aPresure){
   snprintf (msg, sizeof(msg), "%d", aPresure);
-  snprintf (topic, sizeof(topic), "%s/%s", topicStatus, "pressure");
+  snprintf (topic, sizeof(topic), "%s/%s", topicStatus.c_str(), "pressure");
   sendmsgToTopic();
 }
 
 void sendLight(uint16_t aLight){
   snprintf (msg, sizeof(msg), "%d", aLight);
-  snprintf (topic, sizeof(topic), "%s/%s", topicStatus, "light");
+  snprintf (topic, sizeof(topic), "%s/%s", topicStatus.c_str(), "light");
   sendmsgToTopic();
 }
 

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