 #define RTC_BASE 64
 byte rtcStore[3];
 uint32_t nextSleep, startTime;
-#define TEN_MIN_TIME 10*60*1000000 // 1min
-#define ONE_HOU_TIME 60*60*1000000    // 10sec
+#define TEN_MIN_TIME 10*60*1000000    // 10 min
+#define ONE_HOU_TIME 60*60*1000000   //  1 hour
 
 // Time related Valriables
 unsigned int localPort = 2390;      // local port to listen for UDP packets

  //get a random server from the pool
  WiFi.hostByName(ntpServerName, timeServerIP);

  sendNTPpacket(timeServerIP); // send an NTP packet to a time server
  // wait to see if a reply is available

  int cb = udp.parsePacket();

  for (int i = 0; i <= 100; i++) {
    if (!cb) {
      cb = udp.parsePacket();
      delay(10);
    } else {
      break;
    }
  }


  if (!cb) {
    Serial.println("no packet yet");
    ESP.deepSleep(10e6, WAKE_RFCAL);
  }
  else {
    udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer

    unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
    unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
    unsigned long secsSince1900 = highWord << 16 | lowWord;

    const unsigned long seventyYears = 2208988800UL;
    unsigned long epoch = secsSince1900 - seventyYears;

    hh = ((((epoch  % 86400L) / 3600) + 11) % 24);
    mm = (epoch  % 3600) / 60;
    ss = epoch % 60;
    Serial.print("time:");
    Serial.print(hh);
    Serial.print(':');
    Serial.print(mm);
    Serial.print(':');
    Serial.print(ss);
    Serial.println("");

    return epoch;

  }

}


void setup() {

  startTime = system_get_time();

  nextSleep = TEN_MIN_TIME;
  pinMode(14, OUTPUT);
  digitalWrite(14, LOW);

  WiFi.forceSleepBegin();
  yield();
