         elements[id_ele]->lastConnectionTime = millis();
     }
     elements[id_ele]->lastValue = val;
+}
+
+void setup(){
+    Serial.begin(9600);
+    
+    getInfoFromSD(false);
+    
+    /*
+    if(board_ip != NULL)
+        Ethernet.begin(mac, board_ip);
+    else
+        Ethernet.begin(mac, BOARD_IP);
+    */
+    
+    Serial.println("Trying to get an IP address using DHCP");
+    if (Ethernet.begin(mac) == 0) {
+        Serial.println("Failed to configure Ethernet using DHCP");
+        
+        // initialize the ethernet device not using DHCP:
+        if(board_ip != NULL)
+            Ethernet.begin(mac, board_ip);
+        else
+            Ethernet.begin(mac, BOARD_IP);
+    }
+    
+    Serial.print("My IP address: ");
+    Serial.println(Ethernet.localIP());
 }
 
 void loop(){

    if (configFile) {
        String s;
        char c;
        while (configFile.available()) {
            c = configFile.read();
            if(c == '#' ){

                    }
                    num_elements++;
                }
                s = "";
            }
        }
        if(check_for_elements){
//            req += "]";
              client.print("]");
        }
        configFile.close();
    }
    else {
        Serial.println("error opening configuration file");
    }
}

int getValueFromSensor(bool ad, int pin){  
