Page 1 of 2

Uploading MicroPython to Wemos D1 leads to garbage

Posted: Sun Mar 11, 2018 5:23 pm
by ris8_allo_zen0
Hi all,
I've used the my WeMos D1 Mini clone for other projects before, but seems like MicroPython doesn't want to run correctly.
I used the following command to flash (from https://docs.micropython.org/en/latest/ ... e-firmware):

esptool.py --port /dev/tty.wchusbserial1420 --baud 115200 write_flash --flash_size=detect 0 ~/Downloads/esp8266-20171101-v1.9.3.bin

Here's the output:

esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0040
Compressed 600888 bytes to 392073...
Wrote 600888 bytes (392073 compressed) at 0x00000000 in 34.9 seconds (effective 137.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

And after typing "screen /dev/tty.wchusbserial1420 115200", this is all I get:

sdl��|�l�|�l�c|����r�c�c��og�lnn���cx��drlslx�g�

Typing on the keyboard doesn't show any reaction.

What I've tried so far:
* change baudrate of screen: just garbage of different length.
* change baudrate of esptool to 460800: uploading fails in the step "Configuring flash size...".
* uploading another program with PlatformIO: works fine.
* using the same esptool executable and command line of the PlatformIO program above: same result.
* adding parameter "-fm dio": the garbage output continues in loop.
* uploading a previous version like 1.8.7: same result.
* uploading a 512k version of 1.9.3: same result.

Thanks for any help or suggestion!
Kind regards,
Enrico

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Sun Mar 11, 2018 10:59 pm
by mattyt
I assume you've tried erasing the flash first?

Code: Select all

esptool.py --port /dev/tty.wchusbserial1420 erase_flash
Otherwise you've been trying the right things...

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Mon Mar 12, 2018 8:16 am
by ris8_allo_zen0
[quote=mattyt post_id=26101 time=1520809160 user_id=2488]
I assume you've tried erasing the flash first?
[/quote]
I did erase the flash a couple of times, but not in all attempts. Will retry.

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Mon Mar 12, 2018 4:40 pm
by bitninja
Yes, you should definitely try erasing the flash first.

If that doesn't help there are a couple of caveats surrounding esptool.py, but I have not had any of these issues with any of my D1 Minis (or clones).
HTH

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Mon Mar 12, 2018 9:06 pm
by ris8_allo_zen0
Erasing the flash then using "-fm dio" did the trick. Thanks!!!

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Mon Mar 12, 2018 10:31 pm
by mattyt
Yes, if you are still stuck @ris8_allo_zen0, please try to list the exact specs (or provide a link where you bought it?) of your clone and we'll be able to suggest the other more nitpicky parameters. :)

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Sat Mar 24, 2018 4:04 pm
by Henrique Miranda
[quote=ris8_allo_zen0 post_id=26111 time=1520888793 user_id=3811]
Erasing the flash then using "-fm dio" did the trick. Thanks!!!
[/quote]

Hi, i'm getting the same problem with my d1 mini, how exactly you solved your issue?

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Sun Mar 25, 2018 12:44 pm
by ris8_allo_zen0
Henrique Miranda wrote:
Sat Mar 24, 2018 4:04 pm
Hi, i'm getting the same problem with my d1 mini, how exactly you solved your issue?
These are the commands:

Code: Select all

esptool.py --port /dev/tty.wchusbserial1420 --baud 115200 erase_flash
esptool.py --port /dev/tty.wchusbserial1420 --baud 115200 write_flash -fm dio --flash_size=detect 0 ~/Downloads/esp8266-20171101-v1.9.3.bin
"/dev/tty.wchusbserial1420" and "~/Downloads/" are specific to my environment, so you might need to change them.

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Sun Mar 25, 2018 1:07 pm
by Henrique Miranda
ris8_allo_zen0 wrote:
Sun Mar 25, 2018 12:44 pm
Henrique Miranda wrote:
Sat Mar 24, 2018 4:04 pm
Hi, i'm getting the same problem with my d1 mini, how exactly you solved your issue?
These are the commands:

Code: Select all

esptool.py --port /dev/tty.wchusbserial1420 --baud 115200 erase_flash
esptool.py --port /dev/tty.wchusbserial1420 --baud 115200 write_flash -fm dio --flash_size=detect 0 ~/Downloads/esp8266-20171101-v1.9.3.bin
"/dev/tty.wchusbserial1420" and "~/Downloads/" are specific to my environment, so you might need to change them.
I used now

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash -fm dio --flash_size=detect 0 esp8266-20180325-v1.9.3-477-g7b0a020a.bin
and i still geting a loop on serial using -baud at 74800(if i use diferent baud i get only garbages from serial)

Code: Select all

Fatal exception (0): 
epc1=0x4020e754, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000

Re: Uploading MicroPython to Wemos D1 leads to garbage

Posted: Sun Mar 25, 2018 1:26 pm
by ris8_allo_zen0
My "gotcha" was to do erase_flash before every attempt at write_flash. Also the usage of -fm dio, but your mileage may vary.
Also try a non-ultra-recent version of Micropython, like esp8266-20171101-v1.9.3.bin.