  * Arduair configuration initialization
  */
 void setup() {
-  
   digitalWrite(GREEN_LED_PIN,HIGH); // Setup Light On
+  pinMode(CONFIGPIN,INPUT);//check config button
+  int config = digitalRead(CONFIGPIN);
+
+  #if defined(DEVMODE)
+    Serial.begin(9600);
+    if (digitalRead(CONFIGPIN)==HIGH) Serial.println("CONFIG PIN: HIGH");
+  #endif
+
   getDate(DS1307_ADDRESS);
   sdBegin();
-  #if defined(DEVMODE)
-  Serial.begin(9600);
   arduairSetup();
-  #endif
-  Serial1.begin(9600); //ZE CO-sensor
-  Serial2.begin(9600); //ZE NO2-sensor
-  Serial3.begin(9600); //ZE SO2-sensor
+  if (wifi){wifiBegin();}
+  if (config==HIGH) requestConfig();
+
   Wire.begin();
   dht.begin();
   bmp.begin();
   light.begin();
-  
-  if (wifi){wifiBegin();}
   winsenBegin();
   digitalWrite(GREEN_LED_PIN,LOW); // Setup Light Off
 }

*/
void applySetting(String settingName, String settingValue) {
  if (settingName=="network"){
    settingValue.toCharArray(ssid,20); 
  }
  if (settingName=="networkpass"){
    settingValue.toCharArray(pass,20);
  }
  if (settingName=="server"){
    settingValue.toCharArray(server,20);
  }
  if (settingName="device"){
    settingValue.toCharArray(device,20);
  }
  if (settingName=="password"){
    settingValue.toCharArray(password,20);
  }
  if (settingName=="wifi"){
    wifi==toBoolean(settingValue);

#include <SFE_BMP180.h>//Sparkfun BMP180 pressure Sensor Library
#include <SparkFunTSL2561.h>//light sensor library SparkFun TSL2561 Breakout
#include <WiFi.h>      //wifi shield Library
#define DEVMODE true  //uncomment to get Serial ouput
//Default configuration
#define RED_LED_PIN 2
#define GREEN_LED_PIN 3
#define YELLOW_LED_PIN 13
#define DS1307_ADDRESS 0x68 //clock ADRESS
#define WIFIPIN 4
#define DHTPIN 5
#define SHINYEI_P1 8
#define SHINYEI_P2 9
#define SDPIN 10
#define CONFIGPIN 23
#define DHTTYPE DHT22  //dht type

#define CO  1 //Ze sensors serials
#define NO2 2
#define SO2 3

