How To Write Micropython Firmware to the Wemos D1 Mini

All Wemos D1 Minis I tested required a different flash mode than shown in the official documentation to successfully write the Micropython firmware to the module.

The following commands resulted in a succesfull write.

esptool.py –port [usbdevice] –baud 115200 erase_flash

esptool.py –port [usbdevice] –baud 115200 write_flash -fm dio –flash_size=detect 0 [firmware.bin]