Getting error ets jan 8 2013,rst cause:4,boot mode(1,6) wdt reset
Your loop():

void loop() {
  Serial.println(String(WiFi.status()));
  if (WiFi.status() != 3)
  {
    WiFi.begin("VENTURE", "12345678");   //WiFi connection
    while (WiFi.status() != 3)
    {
      Serial.println("Waiting for connection");
    }
  }
  else 
  {
    // Other code...
  }
}


While waiting for the connection, you are creating String objects at a very high rate, since your delay(20000) is in the else clause.

This means you are possibly running out of memory, as you are creating the String objects with every iteration, which is in the Megahertz range.

You likely don't need the String(...) wrappers, as the Serial.println() function can work with C-style strings returned by the WiFi library. Then, your program won't be allocating memory to hold the result of WiFi.status() millions of times per second, which you don't use later on in your program.