   if(topic.startsWith(sendTopic)) {
     transmitt(topic.substring(sendTopic.length()), payload);
   }
-  sendTopic = hostName + "/send/";
+  sendTopic = mainTopic + "/send/";
   if(topic.startsWith(sendTopic)) {
     transmitt(topic.substring(sendTopic.length()), payload);
   }
-  if(topic == (hostName + "/set/raw")) {
+  if(topic == (mainTopic + "/set/raw")) {
     Serial.println("Change raw mode.");
     if (payload[0] == '1') {
       rawMode = true;

      Serial.print(data);
      Serial.println();

      mqtt.publish((hostName + "/recvRaw").c_str(), data.c_str());
    }
  }
}

      logMode = false;
    }
  }
  if(topic == (mainTopic + "/ota/url")) {
    otaURL = String(payload);
    mqtt.publish((mainTopic+ "/ota/nonce").c_str(), otaAuth.nonce().c_str());
  }
  if((topic == (mainTopic + "/ota/passwd")) && (otaURL.length() > 7)) {
    if(otaAuth.verify(payload)) {
      beatLED.on();
      Serial.print("Start OTA update from: ");
