5

I recently started using the ESP8266 12E (Amazon link) and hooked the board up to the Arduino IDE.

When trying to run any of the example sketches, all sketches compile and upload correctly. The blink sketch correctly causes the LED to blink, however, in the serial monitor a varying and large quantity of junk characters appear:

screenshot

The first thing I investigated was of course the baud rate. Online, documentation for the ESP8266 indicate 115200 as the correct baud rate, but on the bottom of the device, the baud rate is listed as 9600.

The junk characters, of course, appear whether the baud rate is 9600 or 115200. Using trial-and-error, I tried each other option. I've also tried several USB to micro-USB (c) cables. They're the same ones I use to charge my phone - is that the issue?

Am I missing something simple here? I searched each of the other Stack Exchange questions about garbage serial monitor values and they all seemed to indicate that the baud rate was the culprit, or that the CL / NR values needed to be changed. Experimentation with these did not result in removing the characters.

brasofilo
  • 133
  • 7
Alex
  • 153
  • 1
  • 6

2 Answers2

2

The baud rate you specify in your program and the baud rate in the serial monitor must match. The ESP8266 outputs a boot message at its own baud rate (varies from model to model - try 57600) before it executes your sketch.

For example:

enter image description here

You can choose any (within reason) baud rate in your program as long as you also choose the same baud rate in whatever is communicating with it (such as the serial monitor in the IDE). If you want to see the boot messages then the serial monitor will have to be set to the right baud rate.

Majenko
  • 105,851
  • 5
  • 82
  • 139
0

I had what I think is the same problem you did. I posted my solution to it here:

Link to my solution

It seems that the ESP can upload code at 115200, but it can't talk to the serial monitor at that baud rate. The solution is to programatically change the baud rate within your sketch. The change in baud rate doesn't 'stick'. You have to include it in your sketch so it is set every time the sketch is run.

Hope that helps.

Bob Johnson
  • 11
  • 1
  • 2