 void handleRoot() {
   String addy = server.client().remoteIP().toString();
   String header;
-  String userAgent;
-  if (server.hasHeader("User-Agent")) {
-    userAgent = server.header("User-Agent");
+  String referer;
+  if (server.hasHeader("Referer")) {
+    referer = server.header("Referer");
   } else {
-    userAgent = "Pas de userAgent ?";
+    referer = "Direct ?";
   }
   String contenu = "<!DOCTYPE html>\n<html lang=\"en\" dir=\"ltr\" class=\"client-nojs\">\n<head>\n";
   contenu += "<meta charset=\"UTF-8\" />\n<title>Que la lumiere soit</title>\n"

    preferences.putUInt("r", r);
    preferences.putUInt("g", g);
    preferences.putUInt("b", b);
    Serial.print("Rouge = ");
    Serial.println(r);
    Serial.print("Vert = ");
    Serial.println(g);
    Serial.print("Bleu = ");
    Serial.println(b);
    dernadd = addy;
    flashoufade = 1;
    flashrendu = 0;

  }
}


//Serial output (BT+SERIAL)
void logeur(String mess){
  SerialBT.print(mess);
  delay(20);
  Serial.print(mess);
}

void logeurln(String mess){
  SerialBT.println(mess);
  delay(20);
  Serial.println(mess);
}

// used to flash leds
void flashfunk() {
  if (flashrendu <= flashfois) {
