       digitalWrite(YELLOW, LOW);
       digitalWrite(GREEN, HIGH);
   }
+
   
+  if (success == false) {
+    blinkLEDForever();
+  }
   delay(500);
 }
 


  digitalWrite(GREEN, HIGH);

  if (!ESP_ACTIVE)
    return; // bail to loop
  
  // setup serial with esp-01
  digitalWrite(LED, HIGH);
  Serial.begin(115200);
  Serial.setTimeout(10000);


  if (!sendATJoinNetwork()) blinkLEDForever();
  blink(BLINK_COUNT, BLINK_DURATION, 1, 1, 1);
}

void loop() {
  bool success = true;
  if (gStateChanged) {
    if (gLastState == LOW) {
      success = sendLock();
    } else {
      success = sendUnlock();
    }
    gStateChanged = false;
  }
  
  if (gLastState == LOW) {
    gCount++;
  } else if (gCount > 0) { 
