   if (Configuration.debugger) Serial << endl << "INFO: Device mode: LAN Configuration";
   WiFi.mode(WIFI_STA);
   connectWiFi();
-  startHttpServer();
+  if (!Configuration.sleep_mode) {
+    startHttpServer();    
+    Led.startBlinking(0.1);
+    if (Configuration.debugger) Serial << endl << "INFO: Ready for configuration. Open http://" << WiFi.localIP();
+  } else {     
+     if (Configuration.debugger) Serial << endl << "WARN: Not connected to WiFi - configuration is not possible. Try Access Point mode - press button for 12s";
+     toggle();
+  } 
   WiFi.mode(WIFI_STA);
-  if (Configuration.debugger) Serial << endl << "INFO: Ready for configuration. Open http://" << WiFi.localIP();
-  Led.startBlinking(0.1);
 }
 
 void Sonoff::runConfigurationAP() {


  isConfigured();

  SonoffFirmware Firmware;
  if (Firmware.upgraded()) {
    Firmware.update();
  }

  Firmware = {};

  if (Configuration.mode == MODE_SWITCH) {
    runSwitch();
  } else if (Configuration.mode == MODE_CONFIGURATION) {

  }
}

/* Main loop method */
void Sonoff::listener() {
  if (!Configuration.sleep_mode) {
    if (Configuration.mode == MODE_SWITCH) {
