   //digitalWrite(resetupPin, LOW);
   digitalWrite(redLED, HIGH);
 
-  vdd = ESP.getVcc() ;
+  //vdd = ESP.getVcc() ;
   WiFiClient::setLocalPortStart(millis() + vdd);
 
   if (DEBUG_PRINT) {
     Serial.begin(115200);
+    Serial.println("");
   }
 
   // ****************
-  system_deep_sleep_set_option(2);
-  //
+  //system_deep_sleep_set_option(0);
+  //WiFi.config(IPAddress(ip_static), IPAddress(ip_gateway), IPAddress(ip_subnet));
+  //wifi_set_phy_mode(PHY_MODE_11B);
   //wifi_set_phy_mode(PHY_MODE_11B);
   //wifi_set_phy_mode(PHY_MODE_11G);
   //wifi_set_phy_mode(PHY_MODE_11N);

{
  if (WiFi.status() != WL_CONNECTED) {
    // WIFI
    if (DEBUG_PRINT) {
      Serial.print("===> WIFI ---> Connecting to ");
      Serial.print(millis() - startMills);
      Serial.print(" ");
      Serial.println(ssid);
    }
    delay(10);
    WiFi.mode(WIFI_STA);
    // ****************
    WiFi.begin(ssid, password);
    //WiFi.begin(ssid, password, channel, bssid);
    //WiFi.config(IPAddress(ip_static), IPAddress(ip_gateway), IPAddress(ip_subnet));
    // ****************

    int Attempt = 0;
    while (WiFi.status() != WL_CONNECTED) {
      if (DEBUG_PRINT) {
        Serial.print(". ");
        Serial.print(Attempt);
      }
      //
      digitalWrite(blueLED, HIGH);
      delay(50);
      digitalWrite(blueLED, LOW);
      delay(50);
      //
      Attempt++;
      if (Attempt == 150)
      {
        if (DEBUG_PRINT) {
          Serial.println();
          Serial.println("-----> Could not connect to WIFI");
        }
        goingToSleepWithFail();
      }
    }

    wifiMills = millis() - startMills;
    if (DEBUG_PRINT) {
      Serial.println();
      Serial.print("===> WiFi connected : ");
      Serial.println(wifiMills);
      Serial.print("---> IP address: ");
      Serial.println(WiFi.localIP());

      Serial.print("===>  Current WIFI : ");
      Serial.print(WiFi.RSSI());
      Serial.print("\t");
      Serial.print(WiFi.BSSIDstr());
      Serial.print("\t");
      Serial.print(WiFi.channel());
      Serial.print("\t");
      Serial.println(WiFi.SSID());

    }

    //wifi_set_sleep_type(LIGHT_SLEEP_T);

#include "user_interface.h"
}

//ADC_MODE(ADC_VCC);

#define DEBUG_PRINT 1

