Page 1 of 4

Flashing micropython on Wemos D1 Mini Pro

Posted: Wed Dec 28, 2016 6:07 pm
by blckpstv
I'm following a guide to flash micropython on the Wemos D1 Mini Pro and I get the following error. --port /dev/cu.SLAB_USBtoUART --baud 460800 write_flash --flash_size=detect 0 esp8266-2016-05-03-v1.8.bin
usage: esptool write_flash [-h] [--flash_freq {40m,26m,20m,80m}]
[--flash_mode {qio,qout,dio,dout}]
[--flash_size {detect,4m,2m,8m,16m,32m,16m-c1,32m-c1,32m-c2}]
[--no-progress] [--verify]
<address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: 'esp8266-2016-05-03-v1.8.bin'

Where do I get the bin and where do I place it?

tutorial link ... intro.html

Re: Flashing micropython on Wemos D1 Mini Pro

Posted: Wed Dec 28, 2016 8:08 pm
by Roberthh
are all the binaries. You can take any build from the esp8266 section, and use that filename in the load command.

Re: Flashing micropython on Wemos D1 Mini Pro

Posted: Wed Dec 28, 2016 9:23 pm
by blckpstv
Ok so I did that and flashed the new bin file.

resulting :

Code: Select all v1.2.1
Warning: Could not auto-detect Flash size (FlashID=0x1840ef, SizeID=0x18), defaulting to 4m
Running Cesanta flasher stub...
WARNING: Unlikely to work as data goes beyond end of flash. Hint: Use --flash_size
Flash params set to 0x0200
Writing 569344 @ 0x0... 569344 (100 %)
Wrote 569344 bytes at 0x0 in 49.4 seconds (92.3 kbit/s)...
When I look in Coolterm nothing shows up directly.

When I reset my Wemos D1 Mini Pro 16mb
I get loads and loads of asci data that is not readable. Checked every baudrate.

Also the led keeps on blinking? Is this because my Wemos module is connected to a usb uart?

Re: Flashing micropython on Wemos D1 Mini Pro

Posted: Wed Dec 28, 2016 11:15 pm
by ernitron
This is almost a FAQ ;)

The symptoms are pretty clear: your chip goes into a rebooting loop (that's why it blinks continuously and you see a lot of garbage on uart whatever speed you set). The cause most probably, is because flashed a WeMos D1 Mini Pro with 4m but it has 128mb (16MB) flash.

Moreover, your fails to get the right size with detect because is probably outdated. I would recommend to:

1. Read carefully the three topics at head of esp8266 forum. The ones by pfalcon which has more detailed instruction on get and check the development environment especially this
2. Update the whole toolchain (esp-open-sdk with xtensa compiler, micropython 1.8.6,, etc)
3. Make erase first (then reset the machine)
4. Make flash with -fs 128m or with auto detect which works on WeMos D1 Mini and latest version of

If it can help, this is an excerpt from a Makefile I use to install software from scratch (I use a WeMos D1 Mini with 4MB=32mb).
Change according to your configuration.

Code: Select all

# Serial port configuration
# Windows
# Linux Debian/Ubuntu


# Path to programs
# Install with sudo pip2 install adafruit-ampy
AMPY=ampy -p $(PORT)

        $(ESPTOOL) --port $(PORT) erase_flash

        @echo "Be sure about MEMORY SIZE"
        $(ESPTOOL) --port $(PORT) --baud 115200 write_flash --verify --flash_size=32m --flash_mode=qio 0x00000 $(FIRMWARE)        
        @echo 'Power device again'

Re: Flashing micropython on Wemos D1 Mini Pro

Posted: Thu Dec 29, 2016 10:40 pm
by blckpstv

I followed Pfalcons info ... er/esp8266

And got to the make -C mpy-cross

But this isn't a directory on the case-sensitive img.

So i'm stuck a tried to build/make the crosstool-NG and that worked. But that didn't gave me the esp8266 folder to flash the micropython on the wemos.

The github doesn't follow the older info on this page ... intro.html

Any idea.

Also I don't really know how to make a makefile like yours, so I can't really redo that to try it that way.

Re: Flashing micropython on Wemos D1 Mini Pro

Posted: Sat Dec 31, 2016 7:22 am
by pythoncoder
I'm a bit puzzled as to what you're trying to achieve. There are two approaches, depending on your needs and/or level of experience. The first set of instructions you referenced, from @pfalcon, are intended for experienced users who want to build the firmware from source. Unless you have specific reasons for building from source I'd recommend downloading and installing a standard binary build.

The second set of instructions, from the official documentation, are what you need if you wish to do this. Note that the line

Code: Select all --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-2016-05-03-v1.8.bin
will need adapting for the name of the firmware file you've downloaded. You might also want to try 115200 in place of 460800 if you have problems.

If following those instructions fails please post a message explaining what goes wrong.

Re: Flashing micropython on Wemos D1 Mini Pro

Posted: Mon Jan 02, 2017 9:48 pm
by igraczech
I have to say I have same issue with Wemos D1 mini Pro (blinking and not responding to USB except for erase_flash), where I have used 512k image from ... efd650.bin

Re: Flashing micropython on Wemos D1 Mini Pro

Posted: Mon Jan 02, 2017 9:54 pm
by igraczech
So I've changed baud rate to 74880 and that discovered following debug log on the serial port:

#0 ets_task(40209c10, 31, 3ffe9000, 4)
rf_cal[0] !=0x05,is 0xFF

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 31812, room 16
tail 4
chksum 0xd9
load 0x3ffe8000, len 1068, room 4
tail 8
chksum 0x17
load 0x3ffe8430, len 3000, room 0
tail 8
chksum 0x99
csum 0x99

Re: Flashing micropython on Wemos D1 Mini Pro

Posted: Mon Jan 02, 2017 10:02 pm
by igraczech
Also it happens with other firmwares than Micropython (just tried NodeMCU and it behaves the same).

Has anyone had success?

Posted: Tue Jan 03, 2017 8:08 am
by pythoncoder
Is there an issue with the D1 Mini Pro? The D1 Mini works fine and is widely used. Alas I don't have a Pro: has anyone managed to run MicroPython on one?

There is this issue which appears unresolved.