   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() {

}

boolean Sonoff::isConfigured() {
  if (Configuration.wifi_ssid[0] == (char) 0 || Configuration.wifi_password[0] == (char) 0 || Configuration.mqtt_host[0] == (char) 0 || Configuration.mqtt_host[0] == (char) 0 ) {
    if (Configuration.debugger) Serial << endl << "WARN: Missing configuration. Going to configuration mode.";
    Eeprom.saveMode(MODE_ACCESSPOINT);
    Configuration = Eeprom.getConfiguration();

  }
}

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