             blinkSlow(dec);
             delay(2000);
             blinkSlow(unit);
-          
-
-
             
       }
 


/************************* WiFi Access Point *********************************/

IPAddress    apIP(10, 10, 10, 10);

#define BUTTON 0
#define RELAY 12
#define LED 13
#define SPARE 14


#define EEPROM_FIELD_SIZE 32
#define EEPROM_NB_FIELD   5
char  eepromArray[EEPROM_NB_FIELD][EEPROM_FIELD_SIZE];


const char INDEX_RELAY_HTML[] =



void setup() {
    Serial.begin(115200);
    pinMode(BUTTON, INPUT);
    pinMode(RELAY, OUTPUT);
    pinMode(LED, OUTPUT);
    pinMode(SPARE, INPUT);

    digitalWrite(LED, LOW);
    delay(3000);
    digitalWrite(LED, HIGH);

    myConfigServer = new ConfigServer(configServerIP);

    //If button pressed at boot
    if(digitalRead(BUTTON) == 0){
        Serial.println("Entering config boot mode");
        bootMode = BOOT_MODE_CONFIG;
        myConfigServer->start();
    }
    else{
        MqttConfig tmpConfig = myConfigServer->getMqttConfig();

        if(tmpConfig.mqttPort != ""){
            bootMode = BOOT_MODE_MQTT;
            myMqtt = new MqttConnection(tmpConfig.sensorName.c_str(), tmpConfig.wifiName.c_str(), tmpConfig.wifiPwd.c_str(), tmpConfig.mqttIp.c_str(), tmpConfig.mqttPort.toInt());
      
            myMqtt->registerCustomProcessing(&processCommandMsg);
            myMqtt->addSubscription("command");

            if(myMqtt->connected()){
                deviceMqttReadyBlink();
            }
            else
            {
                Serial.println("could not connect to MQTT server");
            }
        }
        else{
            WiFi.mode(WIFI_STA);
            WiFi.begin(tmpConfig.wifiName.c_str(), tmpConfig.wifiPwd.c_str());
         
            while (WiFi.status() != WL_CONNECTED) {
                delay(500);
                Serial.print(".");
            }
            Serial.println("");
            Serial.print("Connected to ");
            Serial.println(tmpConfig.wifiName);
            Serial.print("IP address: ");
            Serial.println(WiFi.localIP());

            server.on("/", handleRootDefault);
            server.begin();
            
            Serial.println(WiFi.localIP());
            Serial.println("last number : ");
            int addressNumber = WiFi.localIP()[3];
