                 onDisconnected();
             }
             lastAliveCheck = millis();            
-            esp8266Serial.println("startAlive(" + String(esp8266alive) + ")");
-            esp8266Serial.flush();
-            esp8266Serial.println("connectAP(\"" + String(APssid) + "\", \"" + String(APpsw) + "\")");
-            esp8266Serial.flush();
+            esp8266serial.println("startAlive(" + String(esp8266alive) + ")");
+            esp8266serial.flush();
+            esp8266serial.println("connectAP(\"" + String(APssid) + "\", \"" + String(APpsw) + "\")");
+            esp8266serial.flush();
         } else if (cb[0] == 'a') {
             lastAliveCheck = millis();
             checkComm();
         } else if (cb[0] == 'w') {
             //wifi connected
-            esp8266Serial.println("mqttInit(\"" + String(MQTTid) + "\", \"" + String(MQTTip) + "\", " + MQTTport + ", \"" + String(MQTTuser)
+            esp8266serial.println("mqttInit(\"" + String(MQTTid) + "\", \"" + String(MQTTip) + "\", " + MQTTport + ", \"" + String(MQTTuser)
                             + "\", \"" + String(MQTTpsw) + "\", " + MQTTalive + ", " + MQTTretry + ")");
-            esp8266Serial.flush();
+            esp8266serial.flush();
         } else if (cb[0] == 'c') {
             //mqtt connected
             connected = true;

    if (!connected)
        return;
    success = false;
    esp8266Serial.println("mqttPublish(\"" + topic + "\", \"" + message + "\",  " + MQTTqos + ", " + retain + ")");                
    esp8266Serial.flush();
    waitForSuccess();
}
void mqttSubscribe(String topic) {
    if (!connected)
        return;
    success = false;
    esp8266Serial.println("mqttSubscribe(\"" + String(topic) + "\", " + MQTTqos + ")");
    esp8266Serial.flush();
    waitForSuccess();
}


        lastAliveCheck = millis();
        connected = false;        
    }
    if (esp8266serial.find("[(")) {
        esp8266serial.readBytes(cb, 1);
        if (cb[0] == 'r') {
            //ready
            if (connected) {
