esp8266 stopped communicating


hi,
esp configured , works fine have checked more day.
but, blue led stops blinking no updates on thingspeak.com stops within hour or after 13 hours hang random.
then, reset board , esp starts communicating.
the connections are:
tx---rx
rx---tx
ch_pd=3.3v
gpio0=nc/3.3v didn't make difference
rest nc.
esp powered can communicate.
has faced problem?
i post code well:
but, code cant problem because data updating more 13 hours w/o interruptions continuously.

code: [select]

#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 , carriage 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 tools > auto format on sketch before posting forum. automatic indentation can helpful in finding bugs , make easier read.

what see in serial monitor after esp8266 stops communicating.

esp powered can communicate.
how is powered? 3.3v pin on standard arduino board doesn't provide enough current keep esp8266 running reliably.


Arduino Forum > Topics > Home Automation and Networked Objects > esp8266 stopped communicating


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor