 #include <Preferences.h>
 #include <ArduinoOTA.h>
 #include "BluetoothSerial.h"
-#define HTTP_MAX_CLOSE_WAIT 0
+#include <rom/rtc.h>
+
+#define HTTP_MAX_CLOSE_WAIT 10
 Preferences preferences;
-
 BluetoothSerial SerialBT;
 
 // led pins

void handlePitoune() {
  String sortie = "";
  String addy = server.client().remoteIP().toString();
  sortie += "\n";
  sortie += addy;
  sortie += "\n";

void handleDebug() {
  String sortie = "";
  String addy = server.client().remoteIP().toString();
  reboot_ip(addy, "Debug");
  sortie += "\n";
  sortie += addy;
  sortie += "\n";
