       Serial.println("Overload warning !");
       Serial.println(bytes);
     }
-    
+
     *from = -1;
-    
+
     for (int i=0; i < N_PANNEL; i++)
     {
-        if (ip[i] == _udpIn.remoteIP()) { *from = i; break; }
-    }
-    
+      if (ip[i] == _udpIn.remoteIP()) { 
+        *from = i; 
+        break; 
+      }
+    }
+
     if (bytes >0) 
     {
       if (buffer[0] == '#') b.fill(buffer,bytes);

/* list of supported protocols and callbacks */

static struct libwebsocket_protocols protocols[] = {
	/* first protocol must always be HTTP handler */

	{
		"http-only",		/* name */
		callback_http,		/* callback */
		0,			/* per_session_data_size */
		0,			/* max frame size / rx buffer */
	},
	{
		"touchserver-protocol",
		callback_lyt_protocol,
		0,
		128,
	},

	{ NULL, NULL, 0, 0 } /* terminator */
};

void sighandler(int sig)
{
	force_exit = 1;
}

static struct option options[] = {

	{ NULL, 0, 0, 0 }
};

int initWebsocket()
{
	int n = 0;
	struct libwebsocket_context *context;
	int opts = LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME;
	char interface_name[128] = "wlan0";
	const char *iface = NULL;

	unsigned int oldus = 0;
	struct lws_context_creation_info info;

	int debug_level = 7;

	memset(&info, 0, sizeof info);
	info.port = 80;


	signal(SIGINT, sighandler);
    int syslog_options =  LOG_PID | LOG_PERROR;

	/* we will only try to log things according to our debug_level */
	setlogmask(LOG_UPTO (LOG_DEBUG));
	openlog("lwsts", syslog_options, LOG_DAEMON);

	/* tell the library what debug level to emit and to send it to syslog */
	lws_set_log_level(debug_level, lwsl_emit_syslog);

	info.iface = iface;
	info.protocols = protocols;


	info.extensions = libwebsocket_get_internal_extensions();

	
  	info.ssl_cert_filepath = NULL;
  	info.ssl_private_key_filepath = NULL;

	info.gid = -1;
	info.uid = -1;
	info.options = opts;

	context = libwebsocket_create_context(&info);
	if (context == NULL) {
		lwsl_err("libwebsocket init failed\n");
		return -1;
	}

	n = 0;
	while (n >= 0 && !force_exit) {
		struct timeval tv;

		gettimeofday(&tv, NULL);

		if (((unsigned int)tv.tv_usec - oldus) > 50000) {
			libwebsocket_callback_on_writable_all_protocol(&protocols[PROTOCOL_LYT]);
			oldus = tv.tv_usec;

		}
		n = libwebsocket_service(context, 50);

        loop(); // call  Arduino loop as we have taken over the execution flow :[


	}
	libwebsocket_context_destroy(context);
	closelog();
	return 0;
}



  // 
  //}


  _udpIn.begin(3333);
  _udpIn.listen();

  //pthread magic !
//  pthread_t oscThread;
//  pthread_create(&oscThread,NULL,osc_loop,0);

  //pthread magic end

  Serial.println("Starting WebSocket");
  initWebsocket();  


}

/*
int getNextMessage(OSCBundle &b, int* from)
{

  int bytes  = _udpIn.parsePacket();
  if (bytes)
  {
