Cannot upload to Wemos board in Arduino IDE

I ran it by starting a cmd task from the task manager as admin. At the top it says

same error as if normal cmd run

I changed to 115200 baud and tried the reset button just before upload and it says now:

Here’s the whole sequence in the cmd window:

sorry forgot

Try a slightly different command line:

esptool -cp COM5 -cd nodemcu -cb 921600 -cf app_00000.bin -ca 0x40000 -cf app_40000.bin

C:\flash>esptool -cp COM5 -cd nodemcu -cb 921600 -cf app_00000.bin -ca 0x40000 -cf app_40000.bin
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: Invalid argument or value after -cf (argument #8)

Any ideas?

Just created bin files and flashed a genuine WeMos with the following (ignore the long path)

c:\flash16m\esptool-0.4.11-5-ga3425f4-win32>esptool -bz 4M -eo app.elf -bo app_0
0000.bin -bs .text -bs .data -bs .rodata -bc -ec -eo app.elf -es .irom0.text app
_40000.bin -ec

c:\flash16m\esptool-0.4.11-5-ga3425f4-win32>esptool -cp COM6 -cd nodemcu -cb 921
600 -cf app_00000.bin -ca 0x40000 -cf app_40000.bin
Uploading 34688 bytes from app_00000.bin to flash at 0x00000000
..................................
 [ 100% ]
Uploading 247312 bytes from app_40000.bin to flash at 0x00040000
................................................................................
 [ 33% ]
................................................................................
 [ 66% ]
................................................................................
 [ 99% ]
..
 [ 100% ]

COM5 is closed in the IDE and everywhere else, right?
You sure it’s COM5?

Yep I closed everything and tried same result.

Wow. I guess this is good documentation of what to do to determine if you have a working board!

Thanks for your help Costas! I hope this can help anyone else who needs to rule out a bad board. I will try to figure out the ‘python method’ later today just to try it and I’ll post the results.

I think I might have found the problem.

  1. I don’t think you have a WeMos
  2. I don’t think you have a 4M ESP

The ESP-12S is a 1M device as far as I can make out and not used by WeMos. They do have a 1M (lite) but not like yours https://wiki.wemos.cc/products:d1:d1_mini_lite

Keep your Windows open but return to the IDE and select Generic ESP, flash size 1M (no spiffs) , reset method nodemcu and speed 115200.

Or from command prompt for 1M devices something like this:

  1. Create bin files:
    esptool -bz 1M -eo app.elf -bo app_00000.bin -bs .text -bs .data -bs .rodata -bc -ec -eo app.elf -es .irom0.text app_10000.bin -ec

  2. Flash bin files:
    esptool -cp COM5 -cd ck -cb 115200 -cf app_00000.bin -ca 0x10000 -cf app_10000.bin

Ok from the IDE I got “An error occurred while uploading the sketch”:
java.io.IOException: Cannot run program "C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266/tools/esptool/esptool.exe": CreateProcess error=2, The system cannot find the file specified

I just realized I have the 2.20 version board. it has a different page on their website:

https://wiki.wemos.cc/products:retired:d1_mini_v2.2.0

but it has the same page for driver downloads.

current version is 2.3.0

Forget the IDE, you have messed up the file structure. Try command line.

I have sent a message to your Ebay seller regarding the 4M.