0

I have an Arduino DUE and want to connect it to an ESP8266 Board and then test the connection with a simple "AT" command on the serial command line. I have written a lot on the internet but there are so many different answers on this topic and none of them solves my issue directly.

I set up the eps8266 correctly with the two power cables. They are even comming from different power sources, so there should not be a problem with the power for the esp board.

I think the problems are somewhere in the different baud rates. If I choose 9600 Baud for the connection from the Arduino to the PC via USB and 74880 for the connection from the esp board to the DUE I at least get the error messages correctly when the esp board has to restart (when I force it).

ets Jan 8 2013,rst cause:1, boot mode:(3,6)

load 0x40100000, len 1396, room 16
tail 4 chksum 0x89 load 0x3ffe8000, len 776, room 4
tail 4 chksum 0xe8 load 0x3ffe8308, len 540, room 4
tail 8 chksum 0xc0 csum 0xc0

2nd boot version : 1.4(b1)
SPI Speed : 40MHz
SPI Mod
le:52mn

The code is the following:

//always high
int CH_PD_8266 = 53;

void setup() {
  Serial.begin(9600);
  Serial3.begin(74880); //--> at least error code is shwon correctly

//  Serial3.begin(115200); //error code is gibberish
  pinMode(CH_PD_8266, OUTPUT);
  digitalWrite(CH_PD_8266, HIGH);
}

void loop() {
  while (Serial.available() > 0) {
    char a = Serial.read();
    Serial3.write(a);

    //Write back to see if it even comes perfect
    //Serial.write(a);
  }

}

void serialEvent3() {
  while (Serial3.available() > 0) {
    char a = Serial3.read();
   // Serial.write('A');
    Serial.write(a);
  }
}

Any help would be really appreciated.

Kev1n91
  • 3,553
  • 8
  • 46
  • 96
  • Are you sure there is `AT firmware` flashed into your ESP8266? If you used Arduino IDE + ESP8266 plugin to program ESP8266 directly then you overwrote the `AT firmware` so it won't respond to AT commands anymore. – Chupo_cro Dec 07 '16 at 07:55

2 Answers2

1

That isn't an error. It's just a boot message.

The AT firmware could be using a different baud rate, than the bootloader.
You should try different baud rates and test it with a simple AT command.
When you find the right baud rate, the boot message will be garbage, but the AT commands will work.

gre_gor
  • 6,669
  • 9
  • 47
  • 52
  • Thank you but has there to be a special kind of proportion between the baud rates my Arduino to PC is and the baud rate between the ESP and the arduino ? e.g baud rate to pc has to be two times more than the one to the esp ? – Kev1n91 Nov 13 '16 at 13:07
  • There is no need for any proportion, but if there is a lot of data sent from the ESP, the baud rate to the PC should be higher, so that the serial buffer doesn't clog up. – gre_gor Nov 13 '16 at 23:08
  • Keep in mind that the ESP always boots at 74880 baud, prints the boot message, then hands control to the AT firmware, which mostly likely switches to another baud rate. Not sure which that is, but either 9600 or 115200 would be the most likely, depends which AT firmware is loaded! – bluemind Nov 14 '16 at 09:12
  • So I would suggest: in your code wait a bit, allowing the ESP to boot fully. Then send a AT command followed by a newline, and see if the ESP responds to that, try this both with 9600 and 115200 baud. – bluemind Nov 14 '16 at 09:14
  • I tried it with these possibilites still no luck. I will try with a different esp module later to see if it is a hardware error – Kev1n91 Nov 14 '16 at 10:34
1

I had to do a workaround, described in this question:

Why do I need to change the Baudrate after I send a Reset to the ESP8266?

Also the ESP is very sensitive to currency changes. Sometimes it needs a little push by injection a little voltage from the outside (via voltmeter....). After I do this the communication starts.

Community
  • 1
  • 1
Kev1n91
  • 3,553
  • 8
  • 46
  • 96