   Serial.println("going to sleep....");
   Serial.flush();
 
-  bbutton_up_isr = false;
+  bbutton_up_isr = bbutton_downp_isr = false;
   haveData = false;
   device_pro.button = device_pro.esp8266 = 0;
   device_pro.hash = calc_hash(device_pro);

uint16_t pir_interuptCount = 0;
volatile bool haveData = false;
volatile bool bbutton_up_isr = false;

unsigned long duration;


  attachInterrupt(digitalPinToInterrupt(BUTTON_INT), button_down_isr, FALLING);
  LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);

  if (bbutton_downp_isr)
  {
    Serial.println("Wake up....");
    reset_esp();
  }
}

void setup()
