   digitalWrite(YELLOW, LOW);
   digitalWrite(GREEN, LOW);
   
-  if (espActive) {
+  if (ESP_ACTIVE) {
     if (!sendATConnectServer()) return false;
     if (!sendATPrepareLockDoor()) return false;
     if (!sendATLockDoor()) return false;


  // setup the switch
  pinMode(SWITCH, INPUT_PULLUP);
  lastState = digitalRead(SWITCH);
  lastStateTimestamp = millis();
  delay(100);
  attachInterrupt(digitalPinToInterrupt(SWITCH), onLockStateChange, CHANGE);

  digitalWrite(GREEN, HIGH);

  if (!espActive)
    return; // bail to loop
  
  // setup serial with esp-01

  if (!sendATJoinNetwork()) blinkLEDForever();
  blink(BLINK_COUNT, BLINK_DURATION, 1, 1, 1);
}
void loop() {
  if (gLastState == LOW) {
    gCount++;
  } else if (gCount > 0) { 
      gCount -= gCourtesyDelay;
      digitalWrite(RED, LOW);
      digitalWrite(YELLOW, HIGH);
      digitalWrite(GREEN, LOW);
  } else {
      gCount = 0;
      digitalWrite(RED, LOW);
      digitalWrite(YELLOW, LOW);
      digitalWrite(GREEN, HIGH);
