Trouble uploading code to WEMOS D1 Board (w/ESP8266) <Fixed>

Hi all,

I have started to get myself familiar with arduino, and have tried to use a WEMOS D1 Board (Model:v210) with an ESP8266 built in.
I installed the esp8266 board from: http://arduino.esp8266.com/stable/package_esp8266com_index.json
and selected the "Generic ESP8266 Module"

Computer: Windows 10 64x Surface Book 2
I have simply connected the WEMOS to my computer on USB-SERIAL CH340.

I am uploading a simple test code (blink):

The error message I am getting when trying to upload is:

esptool.py v2.7
Serial port COM3
Traceback (most recent call last):
File "C:\Users\Loznero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.0/tools/upload.py", line 25, in
esptool.main(fakeargs)
File "C:/Users/Loznero/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.0/tools/esptool\esptool.py", line 2840, in main
esp = chip_class(each_port, initial_baud, args.trace)
File "C:/Users/Loznero/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.0/tools/esptool\esptool.py", line 237, in init
self.port = serial.serial_for_url(port)
File "C:/Users/Loznero/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.0/tools/pyserial\serial_init
.py", line 88, in serial_for_url
instance.open()
File "C:/Users/Loznero/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.0/tools/pyserial\serial\serialwin32.py", line 62, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM3': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
serial.serialutil.SerialException: could not open port 'COM3': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)

This is my first time posting, so if I have made anything unclear please let me know!
Thank you in advance.

did you select the right com port in Tools menu?

select your board in Tools menu, not the Generic one

Sorry I forgot to mension that the port selection option is grayed out.
The port works fine however, for a normal arduino uno.
(Attached Picture)

If you open Windows Device Manager, then plug in your WeMos D1's USB cable to your computer, do you see a new device appear in the device tree?

Hi thanks for the reply,

No new things pop up, in Ports or USB controllers.

I just have the two ports - USB-SERIAL CH340 (COM3) and USB-SERIAL CH340 (COM4)

Do those ports remain even after you unplug the WeMos D1?

Yes, they are always there, I have also refreshed multiple times.

Make sure the USB cable is completely plugged into both the Arduino board and the PC.

You may have a damaged/defective or charge-only USB cable. Try a different cable.

Hi yeah, I thought it might be a charge only cable, but it was the one my teacher gave me so ::slight_smile: .

I'll return and see if that's the problem, but in the mean time do you know of any micro usb cables that would be charge and upload? If not that's ok.

Are you asking for a recommendation of where to buy a USB cable?

No, just what would I search for? I've tried "Two way micro usb to usb" etc.

Basically, what are usb to micro usbs that both upload and charge called?

Thanks for your time :slight_smile:

I understand now. I'm surprised you don't already have one on hand.

I'm not sure what the best keywords are. I would expect that if it specifically says "data" then it will be good. Probably it's best to avoid any that mention "charging". I got burned from buying a charge-only USB cable on eBay from a listing that didn't at all make it clear it wasn't for data. That caused me a few minutes of head scratching, as I hadn't heard about the charge-only cables at that time. So it is easy to accidentally buy the wrong type.

most of the cables USB cables have data wires. check the cables for phones

Hi all,

Thank you so much for the replies.
Turns out it was in fact due to my usb to micro usb cable!

I had another cable lying around the house, and that worked fine!

You're welcome. I'm glad to hear it's working now. Enjoy!
Per