4

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

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.

  • 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 '16 at 21:24
  • ... "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 '16 at 21:25
  • I hit the enter key pre-maturely -- see the edit to the comment above – Alex Sep 25 '16 at 21:27
  • 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 '16 at 21:28
  • Experimenting more with the Baud Rates -- I learned that 74880 produces an accurate boot message (see link below): link I still get a funky "y" character (y with umlaut) ÿ Is the EOL / CR / NL values for my serial monitor incorrect? Phew, this has been quite an educational process. I very much appreciate your help, Majenko! – Alex Sep 25 '16 at 22:25
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, privacy policy and cookie policy

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