Uploading MicroPython to Wemos D1 leads to garbage
-
- Posts: 6
- Joined: Sun Mar 11, 2018 4:55 pm
Uploading MicroPython to Wemos D1 leads to garbage
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
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
I assume you've tried erasing the flash first?
Otherwise you've been trying the right things...
Code: Select all
esptool.py --port /dev/tty.wchusbserial1420 erase_flash
-
- Posts: 6
- Joined: Sun Mar 11, 2018 4:55 pm
Re: Uploading MicroPython to Wemos D1 leads to garbage
[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.
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
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).
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).
- Apparently some devices require you to specify the flash mode. See https://github.com/espressif/esptool#flash-modes
- If it's a 16MB module, you have to specify a flash size of 4MB. Auto detect does not work for it.
-
- Posts: 6
- Joined: Sun Mar 11, 2018 4:55 pm
Re: Uploading MicroPython to Wemos D1 leads to garbage
Erasing the flash then using "-fm dio" did the trick. Thanks!!!
Re: Uploading MicroPython to Wemos D1 leads to garbage
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.
-
- Posts: 9
- Joined: Sun Mar 18, 2018 3:05 pm
Re: Uploading MicroPython to Wemos D1 leads to garbage
[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?
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?
-
- Posts: 6
- Joined: Sun Mar 11, 2018 4:55 pm
Re: Uploading MicroPython to Wemos D1 leads to garbage
These are the commands:Henrique Miranda wrote: ↑Sat Mar 24, 2018 4:04 pmHi, i'm getting the same problem with my d1 mini, how exactly you solved your issue?
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
-
- Posts: 9
- Joined: Sun Mar 18, 2018 3:05 pm
Re: Uploading MicroPython to Wemos D1 leads to garbage
I used nowris8_allo_zen0 wrote: ↑Sun Mar 25, 2018 12:44 pmThese are the commands:Henrique Miranda wrote: ↑Sat Mar 24, 2018 4:04 pmHi, i'm getting the same problem with my d1 mini, how exactly you solved your issue?"/dev/tty.wchusbserial1420" and "~/Downloads/" are specific to my environment, so you might need to change them.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
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
Code: Select all
Fatal exception (0):
epc1=0x4020e754, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
-
- Posts: 6
- Joined: Sun Mar 11, 2018 4:55 pm
Re: Uploading MicroPython to Wemos D1 leads to garbage
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.
Also try a non-ultra-recent version of Micropython, like esp8266-20171101-v1.9.3.bin.