-->
Page 1 of 1

Arduino due and ESP8266-01 Am I missing something?

PostPosted: Sun May 16, 2021 7:32 am
by TONIE
I have an Arduino due and an ESP8266-01 hooked up as follows:

Arduino Due-------ESP8266-01
3.3volt out-------->VCC and CH_PD
GND--------------->GND
TX1---------------->RXD
RX1---------------->TXD

Then I use some really simple code on Arduino to get the two to talk together:
Code: Select allvoid setup() {
  // put your setup code here, to run once:
 
  Serial.begin(9600);
  Serial1.begin(115200);
  delay(1000);
  Serial.write("Ready\n\r");

}

void loop() {
  // put your main code here, to run repeatedly:
 
  // check if a character is available from ESP8266 to read and if yes, read it and write out to computer
  if(Serial1.available()) {
    byte in = Serial1.read();
    Serial.write(in);
  }
// check if a character is available from computer to read and if yes, read it and write out to ESP8266
  if(Serial.available()) {
    byte out = Serial.read();
    Serial1.write(out);
   
  }
}


Trouble is that this just seems to echo the characters which I send through the Arduino IDE serial monitor back: when I enter AT+GMR, that is what I read back from the ESP8266, but nothing else. I.e. I get no response from the ESP8266. Although, when I do a reset of the ESP8266 by pulling RST to GND and then relieve the reset, the ESP8266 seems to send a couple of lines of nonsense to the Arduino

May-be the trivial question first: This is a brandnew ESP8266-01, I did not put any code in it myself. Can I expect that the module comes with code in it already which can interpret AT commands, or do I have to put that code in myself first?

Re: Arduino due and ESP8266-01 Am I missing something?

PostPosted: Mon May 17, 2021 12:56 am
by JurajA
did you set line endings in Serial Monitor to "Both"?
yes, new esp-01 should have the AT firmware

Re: Arduino due and ESP8266-01 Am I missing something?

PostPosted: Mon May 17, 2021 1:04 am
by TONIE
I did not have the serial moniotor to Both. When I set it to both, the response which I get from the command AT+GMR is no longer "AT+GMR" but "?+?M?" (whereby the "?"'s are actually mirrored vertically - which I cannot type here).

Re: Arduino due and ESP8266-01 Am I missing something?

PostPosted: Tue Jan 31, 2023 5:52 am
by titanshown
TONIE wrote:I have an Arduino due and an ESP8266-01 hooked up as follows:

Arduino Due-------ESP8266-01
3.3volt out-------->VCC and CH_PD
GND--------------->GND
TX1---------------->RXD
RX1---------------->TXD

Then I use some really simple code on Arduino to get the two to talk together:
Code: Select allvoid setup() {
  // put your setup code here, to run once:
 
  Serial.begin(9600);
  Serial1.begin(115200);
  delay(1000);
  Serial.write("Ready\n\r");

}

void loop() {
  // put your main code here, to run repeatedly:
 
  // check if a character is available from ESP8266 to read and if yes, read it and write out to computer
  if(Serial1.available()) {
    byte in = Serial1.read();
    Serial.write(in);
  }
// check if a character is available from computer to read and if yes, read it and write out to ESP8266
  if(Serial.available()) {
    byte out = Serial.read();
    Serial1.write(out);
   
  }
}


Trouble is that this just seems to echo the characters which I send through the Arduino IDE serial monitor back: when I enter AT+GMR, that is what I read back from the ESP8266, but nothing else. I.e. I get no response from the ESP8266. Although, when I do a reset of the ESP8266 by pulling RST to GND and then relieve the reset, the ESP8266 seems to send a couple of lines of nonsense to the Arduino

May-be the trivial question first: This is a brandnew ESP8266-01, I did not put any code in it myself. Can I expect that the module comes with code in it already which can interpret AT commands, or do I have to put that code in myself first?


This issue has been fixed.