Cannot upload to Wemos board in Arduino IDE

I just received the D1 mini and attempted to upload to it from Arduino IDE 1.8.3 but it fails. I installed the CH340G driver, and updated the boards manager to include the esp8266 library: http://arduino.esp8266.com/versions/2.3.0/package_esp8266com_index.json. I plug the Wemos into the usb and from Device Manager I see the com port: “USB-SERIAL CH340 (COM5)”. I select the following options from the Tools menu:

Board: “WeM os D1 R2 & Mini”
Flash Size: “4M (1M SPIFFS)”
CPU Frequency: “80MHz”
Upload Speed: “115200”
Port “Com5”

For programmer I choose: “AVRISP mkII”.

When I choose Upload, this is the error: “espcomm_upload_mem failed” and this is the output text:

WARNING: Category 'Sensor' in library Adafruit_VL53L0X is not valid. Setting to 'Uncategorized'
WARNING: Category 'Real-time clock' in library DS3231 is not valid. Setting to 'Uncategorized'
Archiving built core (caching) in: C:\Users\PERIGA~1\AppData\Local\Temp\arduino_cache_68121\core\core_esp8266_esp8266_d1_mini_CpuFrequency_80,UploadSpeed_115200,FlashSize_4M1M_82358c2f9e86d376ed80024bea7f0df4.a
Sketch uses 222221 bytes (21%) of program storage space. Maximum is 1044464 bytes.
Global variables use 31588 bytes (38%) of dynamic memory, leaving 50332 bytes for local variables. Maximum is 81920 bytes.
C:\Users\Perigalacticon\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9/esptool.exe -vv -cd nodemcu -cb 115200 -cp COM5 -ca 0x00000 -cf C:\Users\PERIGA~1\AppData\Local\Temp\arduino_build_945344/Blink.ino.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel ck@atelier-klippel.de
setting board to nodemcu
setting baudrate from 115200 to 115200
setting port from COM1 to COM5
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Can you please help me get this working? Thank you.

This isn’t really a Blynk related issue.

Double check everything… Try looking at the link below for Wemos’s official install wiki.

https://wiki.wemos.cc/tutorials:get_started:get_started_in_arduino

Confirm if you are using the correct driver (the D1 mini and the D1 mini Pro use different drivers).

Confirm you are using the correct version of Python (You need Python 2.7).

And also confirm that your USB cable is of good enough quality to carry the needed current to the Wemos (cheap cables cause power issues).

Thanks for replying, I have posted to other forums and no one responded. I use the usb cable to program many other boards. I installed Python 2.7.13 and that’s not the issue I believe because I used to get an error about Python when compiling but I don’t get it now. There’s a reset button on the side, do I need to do anything with it when uploading? I’ve tried but there’s no difference. What am I supposed to choose for the programmer option? Is there a problem with the esptool command I noticed it says nodemcu. Here’s the command as shown in the output:
C:\Users\Perigalacticon\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9/esptool.exe -vv -cd nodemcu -cb 115200 -cp COM3 -ca 0x00000 -cf C:\Users\PERIGA~1\AppData\Local\Temp\arduino_build_687133/Blink.ino.bin

Does anyone know where I can get help with this?

No.

WeMos is a clone of the nodemcu even though they don’t look alike. They even cloned the same bad design for the Analogue port :slight_smile:

The command you have looks fine and 90% of the time you can go to 921600 baud.

Suggests a hardware fault (WeMos, USB cable, com port). I would try half a dozen different USB cables.

Is your MCU a WeMos or a MCU with WeMos simply printed on it i.e. is it a clone or an original? Originals are only available from the official WeMos store on AliExpress. I believe most clones are OK but some users have experienced problems with the very poor clones.

You can flash the WeMos with tools external to the IDE, some of which work better but try working through some of the details above before we move on to that.

I got it on ebay. Here’s the link. I attached photos of the board.

The IC’s are labeled Esp-12S and CH340G. I tried the mini Pro driver just in case I had the 16MB version but got the same results. I tried 2 other USB cables and other usb ports and got the same error. I’m interested to try alternative programming methods, I also use Atmel Studio 7 BTW, and I have programmed a Huzzah breakout with the Arduino IDE via FTDI just fine.

I would start by removing and reinstalling everything (well ,the Python and IDE’s ESP board library at least). and redo your install following the official Wemos link I provided above.

Ok I noticed in my sketch/hardware directory there is nothing from Esp8266. I don’t know if there is supposed to be something there if you use the Boards Manager option it doesn’t say. I run Windows 64bit Pro, so my libraries directory for Arduino is here: C:\Program Files (x86)\Arduino\libraries, but my sketch directory is here: C:\Users\Perigalacticon\Documents\Arduino\sketches. I’ll try to use the clone option which I haven’t done before.

I would recommend the Boards manager install method…

I uninstalled it from the boards manager, removed the url from the list, restarted, and then re-installed the library, restarted, tried to upload, and got the same error. I tried several baud rates. It cannot connect. Could this be due to the 64bit directory structure, where the main install/libraries location is the C:\Program Files (x86)\ directory but my sketchbook is in the Documents library? I also noticed the instructions say IDE 1.8.2, but I have 1.8.3 I hope that wouldn’t be the issue.

Then I tried copying the github files to various locations within the arduino directories and at one point I got this error:

exec: "C:\\Program Files (x86)\\Arduino\\hardware\\esp8266com\\esp8266/tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++": file does not exist

I am running Win10 64 and Arduino 1.8.3 so you shouldn’t be having any issue there.

Just try the Arduino preferences/boards manager method… it will install the files where they need to go automatically.

In preferances insert this:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

The in Boards manager search for ESP8266 and install 2.3.0 You should end up with the same as in my screenshot above.

Yes. I get the same error, and I reinstalled python as well.

opening bootloader
resetting board
trying to connect

And it doesn’t connect.

I noticed in your screenshot the esptool.exe reference…I don’t seem to have or need that on my setup. Perhaps it’s a redundant extra in the Arduino IDE and causing some conflicts? Just a guess at this point.

I measured the pin voltages while idle:

5v = 4.57
D4 = 3.3 (pull up on pin GPIO2)
D3 = 3.3 (pull up on pin GPIO0)
D2 = 0
D1 = 0
Rx = 3.3
Tx = 3.3

3v3 = 3.3
D8 = 0 (pull down pin GPIO15)
D7 = 0
D6 = 3.3
D5 = 3.3
D0 = 3.3
A0 = 0
RST = 3.3

The readings were all within 3 mV of 3.30V or 0V. All of the pins that are supposed to have pull up or down resistors have the expected voltage. But I don’t know about the others, some are high and some are low. Then I measured (with multimeter) the critical pin voltages when uploading (GPIO0, 2, 15, RST) and they did not change during the upload attempt. Is this what they are supposed to do?

Could you send your output when you upload something?

I also tried powering it with 5V to the 5V pin while attempting upload, no change.

I am sure your issue in in the core drivers in the IDE, not in the physical wiring or power… It seems you may have a corrupted file, perhaps from using both the Board managers install and the Git install? I never did the Git install so that may be why my results look different.

That all said… somewhere in my files, while looking into what to show you, I managed to bork my esp setup, so can’t show you anything yet :stuck_out_tongue:

It’s probably not the Git install, because I did the board manager install the very first time I set it up, and tried to upload to it for a few days before trying copying the Git files just today. I bet it has to do with the split directory set up on 64bit installations. I am looking into using esptool by itself, have you done this in Windows?

While there is a possibility you have some data corruption, I doubt it is due to running a 64 bit OS. As stated, I also am running Win10 64 bit and Arduino 1.8.3… with the added split of storing my windows data files (documents, etc) on the D: drive, and no problems with everything finding everything else.

OK, I cleared out my Boards manager files and installed the Git method.

My main file install path is:

D:\Users\Gunner\Documents\Arduino\hardware\esp8266com\esp8266

And everything loaded OK:

So compare with yours and confirm you are using the proper file structure path.