New to MicroPython, putty showing garbage chars

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
snake77
Posts: 31
Joined: Thu Jun 24, 2021 11:26 pm

Re: New to MicroPython, putty showing garbage chars

Post by snake77 » Fri Jul 02, 2021 4:17 pm

tonynsx wrote:
Fri Jul 02, 2021 4:00 pm
I'm not seeing the ESP8266XXX Wi-Fi either
I'm not an expert on MicroPython or microcontrollers at all, I'm just starting out. But if you can not see the AP WiFi then I think something is still wrong with flashing and you don't even need to bother getting the serial console to work. It's already failing at flashing the firmware. Unless you see that "MicroPython-xxxxxx" WiFi, something is wrong with your flashing process.

Unfortunately, that also means that I don't have any more ideas how to fix it. :(
Last edited by snake77 on Fri Jul 02, 2021 9:16 pm, edited 1 time in total.

tonynsx
Posts: 43
Joined: Thu May 07, 2020 1:43 pm

Re: New to MicroPython, putty showing garbage chars

Post by tonynsx » Fri Jul 02, 2021 4:34 pm

Thanks for your help

CaCO3
Posts: 5
Joined: Sat Aug 07, 2021 9:51 pm

Re: New to MicroPython, putty showing garbage chars

Post by CaCO3 » Sat Aug 07, 2021 10:04 pm

I have the same garbage output issue.

I have quite some experience with ESPeasy and now tried to start with MicroPython.

I tested with a WeMos D1 mini PRO 16Mbit ESP8266 (v1.1.0) board as well with a NodeMCU board.
When I flash ESPeasy on them, I get useful output (and the firmware works fine):

Code: Select all

sudo esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash  0x00000 ESPEasy_ESP82xx_mega-20210802/bin/ESP_Easy_mega_20210802_normal_ESP8266_1M.bin
esptool.py v3.1
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 50:02:91:e9:d2:80
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x0009afff...
Flash params set to 0x0300
Compressed 633392 bytes to 416081...
Wrote 633392 bytes (416081 compressed) at 0x00000000 in 9.8 seconds (effective 516.5 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
UART output:

Code: Select all

rl<break>
[23:58:23:243] l<0x9c><0x9e>|<break>
[23:58:23:243] <0x8c>l<0xe0>|<0x02><0x0c><0x0c><0x0c><0x8c><0x0c>l<0xec><0x0c>b|<0x8e><0x82><0x02><0xec><0x12><0x92>r<0x92>b<0x8c><0x0c>b<0x8c><0xf2>nn<0x9e>lnn<0x9c><0xe2><0xec><0x0c>b<0x1c>p<0x8c><0x8e>lrlrlp<0xf2>n<0xe0><0x10><0x02><0x0c><0x0c><0x82><0x0c>l<0x0c><0x8c><0x9c><0x0c><0x0c><0x0c>b<0x0c>n<0xe2>|<0x02><0xec>l<0x8e><0x0c><0x8e>b<0x8c><0xf2>nn<0xee><break>
[23:58:23:272] l<0x8c><0x8e>l`<0x02><0x90><0x12><0x12>nn<0x0c>l`<0x02><0x0e><0x02>nr<0x8e><0x92><0x92>n<0x0c><0x0c>b<0x02>l`<0x02><0x0e>r<0x92><0x92>n<0x0c><0x0c>b<0x02>l`<0x02><0x9c>b<0x0c><0x0c><0x8e><0x1c><0x02><0x92>lr<0x92>`<0x02><0xfc><0x82>n<0x9c><0x02><0xaa>U82 : Info   : ␊
[23:58:23:380] ␊
[23:58:23:380] ␍INIT : Booting version: pygit2_not_installed (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)␍␊
[23:58:23:380] 84 : Info   : INIT : Free RAM:34912␍␊
[..]
So the hardware clearly works correctly!

How ever when I flash MicroPython, I only get garbage forever:

Code: Select all

esp8266-20210618-v1.16.bin
[..]
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
UART output:

Code: Select all

[00:00:15:840] rl<break>
[00:00:15:840] l<0x9c><0x9e>|<break>
[00:00:15:840] <0x8c>l<0xe0>|<0x02><0x0c><0x0c><0x0c><0x8c><0x0c>l<0xec><0x0c>b|<0x8e><0x82><0x02><0xec><0x12><0x92>r<0x92>b<0x8c><0x0c>b<0x8c><0xf2>nn<0x9e>lnn<0x9c><0xe2><0xec><0x0c>b<0x1c>p<0xec><0x8e>lrlrlp<0xf2>n<0xe0><0x10><0x02><0x0c><0x0c><0x82><0x0c>l<0x0c><0x0c><0x0c><0x0c><0x0c><0x0c>b<0x0c>n<0xe2>|<0x02><0xec><0x0c><0xec><0x8e><0x1c><0x9c><0x0c>b<0x8c><0xf2>nn<0xee><break>
[00:00:15:866] l<0x8c><0x8e>l`<0x02><0x90><0x12><0x12>nn<0x0c>l`<0x02><0x0e><0x02>nr<0x8e><0x92><0x92>n<0x0c><0x0c><0x82><0xec><0x8e><0x0e>lp<0xf2>n<0xe0><0x10><0x02><0x0c><0x0c>r<0x8c><0x9c><0x9c><0xe2><0xe0><0x0c><0x0c><0x0c><0x0c>b<0x0c>n<0xe2>|<0x02>ll<0x8c><0x8e>b<0x8c><0xf2>nn<0xee><break>
[00:00:15:902] <0x0c><0x0c>l`<0x02><0x90><0x12><0x12>nnl<0x8c>l`<0x02><0x0e><0x02>nr<0x8e><0x92><0x92>n<0x0c><0x0c><0x12>ll`<0x02>`<0xf2>n<0x0c><0x0c><0x0c><0x9e><0xe0>b<0x82>nl<0x8c><0x0c><0x8c><0xf2>nn<0xee><break>
[00:00:15:911] <0x0c><0x8e><0x0e>lp<0xf2>n<0xe0><0x10><0x02><0x0c><0x0c>r<0x8c><0x9c><0x9c><0xe2><0xe0><0xec><0x8c><0x9c><0x0c>b<0x0c>n<0xe2>|<0x02>l<0x0c><0x8c><0x8e><0x8e>b<0x8c><0xf2>nn<0xee><break>
[00:00:15:914] l<0x8c><0x0c>l`<0x02><0x90><0x12><0x12>nnl<0x8c>l`<0x02><0x0e><0x02>nr<0x8e><0x92><0x92>n<0x0c><0x0c><0x12><0x12><0x92>`<0x02><0x0e>r<0x92><0x92>n<0x0c><0x0c><0x12><0x12><0x92>`<0x02><0x8e><0x12>r<0x82><0x92><0x92>n<0x0c><0x12>b<0x12><0x92>nl<0x9c>|<0x8c><0xf2>n|p<0x0c>l<0x9e>|<0x12><0x02><0x0c>n<0xe0><0x8e><0x82><0x02><0xec><0x12><0xe2><0x92><0x82><0x02><0x0c><0x12>b<0x12><0x92>n`rl<0x8c><0xe2><0xf2><0x92>p<0x02><0x82>nn<0x80>l<0x12>ll<0x0c><0x0c><0x02>l<0x8e>b<0xec><0x8e><0x02><0x0c><0x0c><0x82>bl`<0x02>rl<break>
[00:00:15:966] l<0x9c><0x9e>|<break>
[00:00:15:966] <0x8c>l<0xe0>|<0x02><0x0c><0x0c><0x0c><0x8c><0x0c>l<0xec><0x0c>b|<0x8e><0x82><0x02><0xec><0x12><0x92>r<0x92>b<0x8c><0x0c>b<0x8c><0xf2>nn<0x9e>lnn<0x9c><0xe2><0xec><0x0c>b<0x1c>p<0xec><0x8e>lrlrlp<0xf2>n<0xe0><0x10><0x02><0x0c><0x0c><0x82><0x0c>l<0x0c><0x0c><0x0c><0x0c><0x0c><0x0c>b<0x0c>n<0xe2>|<0x02><0xec><0x0c><0xec><0x8e><0x1c><0x9c><0x0c>b<0x8c><0xf2>nn<0xee><break>
[00:00:15:991] l<0x8c><0x8e>l`<0x02><0x90><0x12><0x12>nn<0x0c>l`<0x02><0x0e><0x02>nr<0x8e><0x92><0x92>n<0x0c><0x0c><0x82><0xec><0x8e><0x0e>lp<0xf2>n<0xe0><0x10><0x02><0x0c><0x0c>r<0x8c><0x9c><0x9c><0xe2><0xe0><0x0c><0x0c><0x0c><0x0c>b<0x0c>n<0xe2>|<0x02>ll<0x8c><0x8e>b<0x8c><0xf2>nn<0xee><break>
[00:00:16:030] <0x0c><0x0c>l`<0x02><0x90><0x12><0x12>nnl<0x8c>l`<0x02><0x0e><0x02>nr<0x8e><0x92><0x92>n<0x0c><0x0c><0x12>ll`<0x02>`<0xf2>n<0x0c><0x0c><0x0c><0x9e><0xe0>b<0x82>nl<0x8c><0x0c><0x8c><0xf2>nn<0xee><break>
[00:00:16:038] <0x0c><0x8e><0x0e>lp<0xf2>n<0xe0><0x10><0x02><0x0c><0x0c>r<0x8c><0x9c><0x9c><0xe2><0xe0><0xec><0x8c><0x9c><0x0c>b<0x0c>n<0xe2>|<0x02>l<0x0c><0x8c><0x8e><0x8e>b<0x8c><0xf2>nn<0xee><break>
[00:00:16:043] l<0x8c><0x0c>l`<0x02><0x90><0x12><0x12>nnl<0x8c>l`<0x02><0x0e><0x02>nr<0x8e><0x92><0x92>n<0x0c><0x0c><0x12><0x12><0x92>`<0x02><0x0e>r<0x92><0x92>n<0x0c><0x0c><0x12><0x12><0x92>`<0x02><0x8e><0x12>r<0x82><0x92><0x92>n<0x0c><0x12>b<0x12><0x92>nl<0x9c>|<0x8c><0xf2>n|p<0x0c>l<0x9e>|<0x12><0x02><0x0c>n<0xe0><0x8e><0x82><0x02><0xec><0x12><0xe2><0x92><0x82><0x02><0x0c><0x12>b<0x12><0x92>n`rl<0x8c><0xe2><0xf2><0x92>p<0x02><0x82>nn<0x80>l<0x12>ll<0x0c><0x0c><0x02>l<0x8e>b<0xec><0x8e><0x02><0x0c><0x0c><0x82>bl`<0x02>rl<break>
[00:00:16:093] l<0x9c><0x9e>|<break>
[00:00:16:093] <0x8c>l<0xe0>|<0x02><0x0c><0x0c><0x0c><0x8c><0x0c>l<0xec><0x0c>b|<0x8e><0x82><0x02><0xec><0x12><0x92>r<0x92>b<0x8c><0x0c>b<0x8c><0xf2>nn<0x9e>lnn<0x9c><0xe2><0xec><0x0c>b<0x1c>p<0xec><0x8e>lrlrlp<0xf2>n<0xe0><0x10><0x02><0x0c><0x0c><0x82><0x0c>l<0x0c><0x0c><0x0c><0x0c><0x0c><0x0c>b<0x0c>n<0xe2>|<0x02><0xec><0x0c><0xec><0x8e><0x1c><0x9c><0x0c>b<0x8c><0xf2>nn<0xee><break>
[00:00:16:118]
Also the LED flash continuously like if it resets all the time.

I also tried -fm dout, but same result:

Code: Select all

sudo esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash -fm dout 0x0000 esp8266-20210618-v1.16.bin
Any Idea what gets wrong?

CaCO3
Posts: 5
Joined: Sat Aug 07, 2021 9:51 pm

Re: New to MicroPython, putty showing garbage chars

Post by CaCO3 » Sat Aug 07, 2021 10:26 pm

OK, I finally got it working with the hint in http://www.bikealive.nl/esp8266-wemos.html 
One has to limit the flash size to 4MB: --flash_size=4MB

Its a pitty this issue is open now for 4 years!

bitninja
Posts: 165
Joined: Thu Sep 15, 2016 4:09 pm
Location: Spring, Texas

Re: New to MicroPython, putty showing garbage chars

Post by bitninja » Mon Aug 09, 2021 1:34 am

Actually, with a 16MB flash size you should also be flashing an extra file called...

esp_init_data_default.bin

For example...

Code: Select all

esptool.py -p COM5 -c esp8266 -b 460800 write_flash -fm dio --flash_size=16MB 0x0000 esp8266-v1.16.bin 0xffc000 esp_init_data_default.bin
Is what I used to use for a Wemos D1 Mini Pro. I am not entirely sure if this is still accurate though.

HTH

clueless
Posts: 2
Joined: Mon Aug 16, 2021 2:16 am

Re: New to MicroPython, putty showing garbage chars

Post by clueless » Mon Aug 16, 2021 2:25 am

I've had exactly this problem with Weimos/Lolin D1 mini clones and the same flashing softwares. However uPyCraft (https://dfrobot.gitbooks.io/upycraft/content/) was able to successfully flash and get me a REPL - which also worked with Putty. No idea what's going on, go figure. uPyCraft looks like a nice simple IDE also.

bitninja
Posts: 165
Joined: Thu Sep 15, 2016 4:09 pm
Location: Spring, Texas

Re: New to MicroPython, putty showing garbage chars

Post by bitninja » Mon Aug 16, 2021 8:59 am

Ye, I like upyCraft.

Here is a good page on the ESPTOOL which all the apps use to do the dirty work.

https://github.com/espressif/esptool

Especially the Flash Modes on the ESP8266.

Glad you got it solved!

Post Reply