I recently got an ESP8266 Node MCU and have been trying to get it setup, but am running into an issue where any ouput I post to the serial monitor using serial.println produces garbled characters.
I am using the Arduino IDE to program a test sketch, which contains the following code:
After researching the issue online I determined that the most likely reason the issue was occuring was that I had set my baud rate incorrectly at some point, so I ensured that the Serial.begin method was provided with the same baud rate as I was using in the serial monitor. This did not resolve the issue.
I attempted to setup the MCU as per the seller's instructions as written on the sell page for the item, which I have copied below:
Instruction & Steps of How to use: 1. Download the Arduino IDE, the latest version. 2. Install the IDE 3. Set up your Arduino IDE as: Go to File->Preferences and copy the URL below to get the ESP board manager extensions: arduino.esp8266.com/stable/package_esp8266com_index.json 4. Go to Tools > Board > Board Manager> Type "esp8266" and download the Community esp8266 and install. 5. Set up your chip as: Tools -> Board -> NodeMCU 1.0 (ESP-12E Module) Tools -> Flash Size -> 4M (3M SPIFFS) Tools -> CPU Frequency -> 80 Mhz Tools -> Upload Speed -> 921600 Tools-->Port--> (whatever it is) 6. Download and run the 32 bit flasher exe at Github(Search for nodemcu/nodemcu-flasher/tree/master/ at Github) nodemcu-flasher/Win32/Release at master · nodemcu/nodemcu-flasher · GitHub Or download and run the 64 bit flasher exe at: nodemcu-flasher/Win64/Release at master · nodemcu/nodemcu-flasher · GitHub 7. In Arduino IDE, look for the old fashioned Blink program. Load, compile and upload. 8. Go to FILE> EXAMPLES> ESP8266> BLINK, it will start blinking.
After following these steps, the blink program did seem to work. However, any serial.print/println returned those strange characters.
I tried updating the firmware again using different methods as was listed in node mcu's documentation:
Tools -> Board -> NodeMCU 1.0 (ESP-12E Module) - the problem can be here, I checked with stm32f103 it working ok, I have on serial port "test" every 2 sec.
I currently have the board set to NodeMCU 1.0 (ESP-12E Module), do you think I should try a different board setting?
Edit- I tried NodeMCU 0.9 (ESP-12E Module) and it did not output anything to do the serial output. I also tried the Generic ESP8266 Module and it threw an error trying to upload the sketch.
I took a look at that video and I have done the steps that he described already, as they were part of the steps I followed on the site I bought the MCU from, as I mentioned in my original post. I ran a similar blink application, which worked fine and still works just fine with the current firmware. It seems to function fine apart from the serial monitor.
I should also note that I am on windows, and checked the device manager's driver settings to make sure they matched the baud rate I was using (115200).
Thank you for your help by the way, I appreciate you taking the time to provide me with suggestions.
Edit- I should also mention that when I hit the reset button while the sketch is uploaded and running on the MCU, I receive the following:
Z⸮⸮Q⸮Z⸮⸮Q⸮Z⸮⸮Q⸮Z⸮⸮Q⸮
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
This is the first time I have seen the serial output produce anything other than garbled characters since updating the firmware.
I should also note that the garbled characters at the beginning are the program running for a bit before I hit it, and the garbled characters at the end are the program running again after it was reset.
Some time examples are dedicated for most popular boards, sometime they are dedicated for specific boards, for example I have library with the name "examples for stm32f103 board " pick up another example.
Just make sure that the serial monitor window has the same serial speed setting. Eg. if the code is setting 115200, then the serial monitor window should also be manually set to 115200.
If you're still getting the same issue after the speed settings are correctly set, then it might be a board driver issue. Although, it might also pay to see what happens if you use another board of the same kind ---- this is to make sure that it's not a hardware issue.