 }
 
 void setup() {
+  // Set serial port
+  Serial.begin(115200);   
   // Default on
   pinMode(RELAY_PIN,OUTPUT);
   digitalWrite(RELAY_PIN, LOW);
   pinMode(13,OUTPUT);
   digitalWrite(13, LOW);
   // configuring serial
-  Serial.begin(115200);   
   // Loading setting 
   eeprom_read_block((void*)&settings, (void*)0, sizeof(settings));
   if (strcmp(settings.magic, MAGIC) != 0) {

      // If you've gotten to the end of the line (received a newline
      // character) the http request has ended, so you can send a reply
      if (c == '\n' || idx >= STRING_BUFFER_SIZE) {
        char method [5];
        char url [20];
        sscanf (buffer,"%s /%s/%s/%d",method,url);
        if (strcmp(method, "GET") == 0) {
          char * toks;
          toks = strtok (url,"/");
          if (strcmp(toks, "read") == 0) {
            toks = strtok (NULL, "/");
            if (strcmp(toks, "datastreams") == 0) {
              DBG Serial.println("Sending full datastream");
              sendContent(request,getDatastreams());
              break;
            } 
            else if (strcmp(toks, "switch") == 0) {

#include <avr/eeprom.h>

// comment/uncomment to disable/enable debug
//#define DEBUG

#define RELAY_PIN 3
#define STRING_BUFFER_SIZE 300
