       logMode = false;
     }
   }
-  if(topic == (hostName + "/ota/url")) {
+  if(topic == (mainTopic + "/ota/url")) {
     otaURL = String(payload);
-    mqtt.publish((hostName+ "/ota/nonce").c_str(), otaAuth.nonce().c_str());
-  }
-  if((topic == (hostName + "/ota/passwd")) && (otaURL.length() > 7)) {
+    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: ");

      rawMode = false;
    }
  }
  if(topic == (hostName + "/set/log")) {
    Serial.println("Change log mode.");
    if (payload[0] == '1') {
      logMode = true;

  rf.setPulseTrainCallBack(rfRawCallback);
  rf.initReceiver(RECEIVER_PIN);
  Serial.println("");
  Serial.print("Name: ");
  Serial.println(mainTopic);
}

void setup_wifi() {
