Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

NodeMCU ESP8266 12E - serial monitor garbage output

Open gigmaps opened this issue 8 years ago • 58 comments

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

gigmaps avatar Dec 20 '17 22:12 gigmaps

set the baudrate in your IDE ser.mon. window to 74880 and use Serial.begin(74880); in your sketch, then everything should be ok.

5chufti avatar Dec 21 '17 11:12 5chufti

@5chufti legend !

On my system ser.mon window doesn't even need to be at 74880 - as long as the sketch has Serial.begin(74880) it seems to work fine.

thank you

gigmaps avatar Dec 21 '17 17:12 gigmaps

Oh man, it took half a day to stumble upon this issue. This is even more weird. I also need to set Serial.begin(74880); in my sketches but in the serial window I can ONLY use 115200 to see correct output, if I select anything else (even 74880) I get totally useless output. (cheap nodemcu v3 china, lolin, wemos.cc, ver 0.1, gentoo linux & arduino 1.8.5)

pauledd avatar Dec 29 '17 16:12 pauledd

@pauledd yes highly frustrating - and probably the card - I repurchased two Makerfocus NodeMCU 12E cards from amazon and don't have the same issues (though some sketches are a little fussy on the baud rate selected in the SM - but not the sketch). An interesting read to shed some light on all the different NodeMCU card versions / manufacturers available: https://frightanic.com/iot/comparison-of-esp8266-nodemcu-development-boards/

gigmaps avatar Dec 31 '17 21:12 gigmaps

You are a hero, I've been searching sites and posts for a day now and this is the one that fixed it for me.

They must have a clock divisor set wrong some place!

Thank you!!!!

brucebuxkemper avatar Jan 13 '18 12:01 brucebuxkemper

If the crystal is running 1.5 times too fast, could this be why my wifi is not working?

brucebuxkemper avatar Jan 14 '18 16:01 brucebuxkemper

Depend if this frequency is properly reflected in the esp_init_data block.

5chufti avatar Jan 14 '18 21:01 5chufti

Same here! I got a Lolin ESP8266 nodeMCU v3 from aliexpress.. I'm testing on Hellow Server example code. it only works fine at sketch 74880, ser.mon 115200. But the wifi is not working..

js9742 avatar Jan 15 '18 02:01 js9742

Hi, I still have not found a solution. I'll email you if I do.

I'm not sure the serial issue is a fundamental problem with the board and the bad clock rate is keeping the wifi from working.

I'm still working on it and I ordered a different board.

FYI, my email is [email protected]

On Sun, Jan 14, 2018 at 8:23 PM, Jungseo Park [email protected] wrote:

Same here! I got a Lolin ESP8266 nodeMCU v3 from aliexpress.. I'm testing on Hellow Server example code. it only works fine at sketch 74880, ser.mon 115200. But the wifi is not working..

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/esp8266/Arduino/issues/4005#issuecomment-357567002, or mute the thread https://github.com/notifications/unsubscribe-auth/AhmuVOCKlVWVv7yLKEuwfZjXO9Gui_a1ks5tKraYgaJpZM4RJDN1 .

brucebuxkemper avatar Jan 15 '18 07:01 brucebuxkemper

I got my money back for the faulty unit and ordered another one here in germany. The board looks quite the same like the Chinese one except one part: the faulty china unit has on that wifi metal case printed "Vendor AI-THINKER". The good one I got from germany has printed HYSIRY and this "pacman" next to the Wifi-logo.

pauledd avatar Jan 15 '18 07:01 pauledd

I"m not sure where the esp_init_data block is or how to debug it.

In Arduino IDE the board is set to 80MHz.

On Sun, Jan 14, 2018 at 3:18 PM, 5chufti [email protected] wrote:

Depend if this frequency is properly reflected in the esp_init_data block.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/esp8266/Arduino/issues/4005#issuecomment-357543284, or mute the thread https://github.com/notifications/unsubscribe-auth/AhmuVKI4fT8fHS9SnwkRCnHbVe9akBcVks5tKm8lgaJpZM4RJDN1 .

brucebuxkemper avatar Jan 15 '18 08:01 brucebuxkemper

Did you have the same baud rate issue/no wifi on the Chinese board and then have it work on the German board?

If so I will quit trying on the HiLetgo board I have and wait for a new board.

On Mon, Jan 15, 2018 at 1:28 AM, pauledd [email protected] wrote:

I got my money back for the faulty unit and ordered another one here in germany. The board looks quite the same like the Chinese one except one part: the faulty china unit has on that wifi metal case printed "Vendor AI-THINKER". The good one I got from germany has printed HYSIRY and this "pacman" next to the Wifi-logo.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/esp8266/Arduino/issues/4005#issuecomment-357601968, or mute the thread https://github.com/notifications/unsubscribe-auth/AhmuVKU9IphPAoaw6P0A7JeZjYH4Rg5sks5tKv4mgaJpZM4RJDN1 .

brucebuxkemper avatar Jan 15 '18 08:01 brucebuxkemper

Yes, 74880 baud and no wifi. But be warned, dont try to identify "good" boards on the shop images of the board. I noticed that with the china seller. He sent me the "AI-THINKER" board while in his shop the images did not have that logo. Its a bit trial and error...

pauledd avatar Jan 15 '18 08:01 pauledd

I'm on the same boat. If I try the wifiscan example, I only get some readable output when I set to 74880 and keep reading at 115200, but I don't get any wifi.

surak avatar Jan 15 '18 22:01 surak

And the Blink examples don't work with the builtin led either

surak avatar Jan 15 '18 23:01 surak

unfortunately there is no "standard" for the builtin led for esp "generic boards", so your mileage with blink example will vary. The latest github should have some led selection menu I heared...

5chufti avatar Jan 16 '18 16:01 5chufti

Just wanted to update you.

I got a new HiLetgo board and it works fine.

My conclusion is that if you have to set baudrate to 74880 to get a good output 115200, the board is bad and wifi will not work. Throw it away and get a new one.

For $6 it is not worth wasting your time on. I'm still waiting to see if HiLetgo atleast does the right thing and replaces the two bad boards that I have now.

On Tue, Jan 16, 2018 at 10:08 AM, 5chufti [email protected] wrote:

unfortunately there is no "standard" for the builtin led for esp "generic boards", so your mileage with blink example will vary. The latest github should have some led selection menu I heared...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/esp8266/Arduino/issues/4005#issuecomment-358012966, or mute the thread https://github.com/notifications/unsubscribe-auth/AhmuVLHiPWLikQ8QIulPOG1Gl_IeRzCxks5tLMl5gaJpZM4RJDN1 .

brucebuxkemper avatar Jan 20 '18 15:01 brucebuxkemper

I have a board that has the same issue, looks like the problem is it has a 40MHz crystal instead of the standard 26MHz one, what I did to solve this was to flash esp_init_data_default.bin with ESP8266 Download Tool changing CrystalFreq from 26M to 40M (I flashed it at 0x3fc000, having a 32mb board). Let me know if this solves it for you.

m-m-0-0 avatar Jan 20 '18 15:01 m-m-0-0

ok, turns out that doesn't work with arduino, so what I did now was commenting line 91,93,94 and 95 from cores\esp8266\core_esp8266_phy.c and it seems to be working correctly, i'm not sure wifi works as intended, i'll have to test that. It is not a good solution, but it seems to work.

m-m-0-0 avatar Jan 20 '18 16:01 m-m-0-0

Did you try the 40MHz crystal setting in the IDE?

5chufti avatar Jan 20 '18 16:01 5chufti