esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
16.07k stars 13.33k forks source link

NodeMCU ESP8266 12E - serial monitor garbage output #4005

Closed gigmaps closed 6 years ago

gigmaps commented 6 years ago

Basic Info

Amica NodeMCU ESP8266MOD to Arduino IDE gives garbage / gibberish serial monitor output. Note that the Blink examples function perfectly (both native Arduino and ESP8266 versions). The only good serial monitor text I can generate from this board is the bootloader output after reset button is pressed. Anything else (I've tried many examples and all baud rates) gives garbage.

Hardware

Hardware: Amica ESP8266 CP2102 NodeMCU LUA ESP-12E WIFI Serial Wireless Module Chip: ESP8266EX Purchased From: https://www.amazon.com/gp/product/B010O1G1ES/ref=ask_ql_qh_dp_hza Core Version: 2.4.0-rc2 OS: macOS High Sierra 10.13.2

Description

Arduino IDE v1.8.5 installed with latest rc2 version of esp8266/Arduino installed - with the Silicon Labs CP2102 drivers installed correctly. Using the latest version of esp8266/Arduino and can't get the module to output to serial monitor (only outputs gibberish characters) - except for bootloader reset. Serial monitor baud rate is 115200 - no other baud rate works with bootloader (gives 100% gibberish).

Settings in IDE

Module: NodeMCU 1.0 (ESP- 12E Module) Flash Size: 4MB/1MB CPU Frequency: 80Mhz Flash Mode: n/a Flash Frequency: ?? not sure where this is set in Arduino IDE ?? Upload Speed: 115200 Upload Using: USB Reset Method: nodemcu

Serial Output

ets Jan  8 2013,rst cause:2, boot mode:(3,7)
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v355232ff
~ld
UJj,⸮⸮⸮T⸮⸮⸮-+Z⸮孲⸮⸮U⸮+⸮⸮⸮⸮⸮T⸮⸮⸮⸮⸮⸮UUUVU⸮T⸮⸮⸮-+Z⸮孢⸮⸮UJ+⸮⸮⸮⸮⸮T⸮⸮⸮⸮⸮⸮UUUVUE⸮

Sketch

Only testing with the WifiScan example for now

diyelexvidyadhar commented 5 years ago

I get my IP by following these steps maybe it work for you ip

Arduino IDE 1.8.9 , windows 10 settings Untitled

code

include

const char wifiName = "wifi name"; const char wifiPass = "your password";

// the setup function runs once when you press reset or power the board void setup() { Serial.begin(115200); delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.print("ESP8266 MAC: "); Serial.println(WiFi.macAddress()); Serial.print("Connecting to "); Serial.println(wifiName);

WiFi.begin(wifiName, wifiPass);

while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); }

Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); }

// the loop function runs over and over again forever void loop() {

}

JDK-Dulangi commented 5 years ago

Hey i think I also brought a cheap Chinese board though it was sold at a reputed shop, it prints gibberish at baud rates of 9600, and 115200, but at 74880 it started printing some English and I got a check sum error, then i tried Erasing all Flash contents and now I m getting compiling errors as undefined reference to vPortFree Does anyone know how to fix this?

JavanPoirier commented 4 years ago

I was also having this issue in my own code but not in the samples. No samples show the use of pins other than LED_BUILTIN. I was able to isolate it to a single pinMode() I was calling. This was a result of assigning a GPIO that was not what I thought it was. On a vanilla Arduino I am used to assigning the pins based on what number is on the board. So when I set pin 7 for this board it is not equivalent to D7...? Anyways, referring to D#, changing my pinout and reading up on the GPIO pinout got me past this.

sbabadag commented 4 years ago

I get my IP by following these steps maybe it work for you ip

Arduino IDE 1.8.9 , windows 10 settings Untitled

code

include

const char wifiName = "wifi name"; const char wifiPass = "your password";

// the setup function runs once when you press reset or power the board void setup() { Serial.begin(115200); delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.print("ESP8266 MAC: "); Serial.println(WiFi.macAddress()); Serial.print("Connecting to "); Serial.println(wifiName);

WiFi.begin(wifiName, wifiPass);

while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); }

Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); }

// the loop function runs over and over again forever void loop() {

}

Absolulty after many trials ... your configuration worked for me.... but dont forget to reset by chpd pin to gnd after downloading to board many thanks...

sbabadag commented 4 years ago

sorry rst pin to gnd

tralves commented 3 years ago

My problem was that I was setting GPIO1 (TXD0) as OUTPUT and writing LOW... After I stopped doing that, it started working (74880 baud).

bhamilton1co commented 3 years ago

I was having a similar issue as others with a knock off ESP8266EX D1 Mini Pro; garbage in serial monitor, even though the board would flash successfully. Things started looking better using Serial.begin(74880); and changing various IDE options like the Crystal Freq, but WiFi was not working. Ultimately I figured out that it had a different size Flash chip than what was indicated on the product listing and purchase order. So when I set everything back to normal including Serial.begin(115200); Crystal Frequency 26MHz, etc, but choosing Flash Size 4MB (FS: 1MB my sketch starting working properly, WiFi started working, everything is good to go. Here are my Arduino settings

image

d-a-v commented 3 years ago

@bhamilton1co what's the flash chip reference ? whhooops you figured out it is a 4MB flash chip - sorry. to be noted: esptool flash_id gives the flash size.