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.

2 Answers 2

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.

6
  • Thank you for your response -- I am unsure how to view this boot message. I am currently using Windows 10, and don't have (readily accessible) a working Linux installation. I can access one in a few hours, however. The baud rates appear to match - in the Arduino IDE Tools > Baud Rate menu + the serial monitor menu & the code itself, they all read 115200. I changed them do 57600 and did not notice a change yet
    – Alex
    Sep 25, 2016 at 21:24
  • 1
    ... "If you want to see the boot messages then the serial monitor will have to be set to the right baud rate." ... What isn't clear about that? Where does your host OS come into it?
    – Majenko
    Sep 25, 2016 at 21:25
  • I hit the enter key pre-maturely -- see the edit to the comment above
    – Alex
    Sep 25, 2016 at 21:27
  • 1
    I am doing that all the time ;) The baud rate in the tools menu is purely for performing the upload of the code. The baud rate in your code is purely for your own communication from within your code. The only baud rate that has any bearing at all on the boot messages is the one in the serial monitor's drop-down list. Try different values in there. Or just ignore the boot messages as they aren't that interesting.
    – Majenko
    Sep 25, 2016 at 21:28
  • 1
    The ÿ is usually associated with the line being dropped or otherwise going dead, usually at the end of transmission, or just as transmission starts. It's basically corruption and is pretty much normal.
    – Majenko
    Sep 25, 2016 at 22:28
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.