esp8266 stopped communicating

Hi,
ESP is configured and works fine like I have checked it for more than a day.
But, suddenly the blue led stops blinking with no updates on thingspeak.com Sometimes it stops within an hour or sometimes after 13 hours the hang up is very random.
Then, I just reset the board and esp starts communicating.
The connections are:
TX—RX
RX—TX
CH_PD=3.3V
GPIO0=NC/3.3V didn’t make any difference
rest all are NC.
Esp is powered properly so that it can communicate.
Has anyone faced this problem?
I will post my code as well:
but, code cant be problem because data was updating for more than 13 hours w/o interruptions continuously.

#include <SoftwareSerial.h>
SoftwareSerial esp(2,3);
void sendDebug(String);
String c;
int count=0;
#define IP "184.106.153.149"
//#define IP "api.thingspeak.com"
void setup()
{
  Serial.begin(9600);
  esp.begin(9600);
  connectwifi();
}
void loop()
{

     String cmd = "AT+CIPSTART=0,\"TCP\",\"";     // Setup TCP connection
  cmd += IP;
  cmd += "\",80";
  sendDebug(cmd);
  delay(700);
   while(esp.available()>0)
   {
    if(esp.find("OK"))
    Serial.println("STARTING C/N");
   }
   String g="AT+CIPSEND=0,74";
   sendDebug(g);
   delay(500);
     while(esp.available()>0)
   {
    if(esp.find(">"))
    {
    String GET="GET https://api.thingspeak.com/update?api_key=3TPW62GDD2QNE1JO&field1=99";
    GET=GET+"\r\n";
    sendDebug(GET);
    }
   }
   if(esp.find("SEND OK"))
   Serial.println("Succesfully printed");
   else
   count++;
    delay(19000);
}
void sendDebug(String cmd)
{
  esp.println(cmd);         //ln bcoz new line and carriage for esp
  Serial.println(cmd);
}

void connectwifi(void)
{
 sendDebug("AT");
  delay(1000);
  if(esp.find("OK"))
  {
            Serial.println("success");
   // connectWiFi();
  }
  
  String c="AT+CWJAP=\""; // Join accespoint
  c+="FluxGen";
  c+="\",\"";
  c+="zigbeerocks!";
  c+="\""; 
  sendDebug(c);
   delay(2000);
   while(esp.available()>0)
   {
    if(esp.find("OK"))
    Serial.println("Joined");
   }
    c="AT+CIPMUX=1";
    sendDebug(c);
    delay(2000);
     while(esp.available()>0)
   {
    if(esp.find("OK"))
    Serial.println("\"MULTIPLE C/N\"");
   }
   c="AT+CWMODE=3";
    sendDebug(c);
    delay(2000);
    while(esp.available()>0)
   {
    if(esp.find("OK"))
    Serial.println("SET MODE");
   }

}

Please always do a Tools > Auto Format on your sketch before posting it to the forum. The automatic indentation can be very helpful in finding bugs and it will make it much easier for us to read.

What do you see in Serial Monitor after the ESP8266 stops communicating.

deesha:
Esp is powered properly so that it can communicate.

How is is powered? The 3.3V pin on a standard Arduino board doesn't provide enough current to keep an ESP8266 running reliably.

What is UART port of esp8266 are connect to? The port is connected to is the same logic voltage level or not? If not, whether you are using a voltage level shift?

The problem probably caused by power. Checking power supply and voltage level of the communications.

I want to send ultrasonic sensor data on any hosting website using esp8266.
I want help!
Please suggest me.