Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By kalreg
#41666 Hello,
This is my first post on this BB so please be kind and find me welcoming all of you.
I bought today esp8266. I also have arduino leonardo.Since i've been programming arduino earlier i have no idea why it doesnt want to cooperate with esp.

I connected esp to arduino:
power to 3.3 power on arduino
gnd to arduino gnd
tx on arduino to rx on esp via current stabilizer (5 to 3.3 v)
rx on arduino to tx on esp

I havent uploaded any firmware (i do not have any usb-uart device to do this). esp turns on (i have red led indicating that it is powered on) but blue led is turned off.If i put led to stabilized 3.3 voltage from tx it lights up constantly as if some data data would be sent all the time (or not? not sure of that).

My sketch looks like this.


Code: Select allvoid setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
  while(!sendAT("AT", "OK", 100))
  {
     Serial.println("Error !");
     if ( Serial1.available() > 0 ) { Serial.println("serial 1 available"); } else { Serial.println("serial 1 is not available"); }
     delay(1000);
  }
  Serial.println("Comms ok!");

}

void loop() {

}

boolean sendAT(String at, char *response, int time)
{

  Serial1.println(at);
  delay(time);
  while(Serial1.available() > 0);
  {
    if (Serial1.find(response)) {
      return 1;
    }
  }

  return 0;

}


Serial monitor returns Error and no Comm information. I have no idea what is wrong. Can anybody help me please?
User avatar
By schufti
#41702 an lp2985 is rated 150mA and should be able to deliver it on leonardo board without too much heat dissipation as it is fed with only 5V. But 150mA might be a bit on the wee side for operating esp with full wifi consumption. I at least would add an additional electrolytic on the esp board.

BUT: what do you mean by "tx on arduino to rx on esp via current stabilizer (5 to 3.3 v)" ???
theoretically there is some danger in connecting directly, but in general a series resistor of 10k should be sufficient to avoid harm to the esp.

In general it is no good idea to save on the essential parts aka USB-serial-converter if one is not yet acustomed to the toy. With this arangement you have two possible points of failure, none of them in direct access ...