Programming the ESP8266 WeMos

Programming the ESP8266 WeMos

Posted Apr. 9, 2016StatsWeMos D1R2 is an ESP8266 12 based WiFi enabled microprocessor unit on a Arduino UNO footprint. That means the board looks and works (in most cases) like an UNO. Apparently several shields, sensors and output devices that are manufactured for the Arduino platform will work on the WeMos D1R2 with the added advantage of builtin WiFi. You have to make sure you have the current version of the board WeMos D1R2. I bought my WeMos D1R2 from Banggood, I believe it is a Hong Kong based online retailer. The quality of the product is good and has a short delivery time, about two weeks to the US. They carry the genuine WeMos D1R2. There are several older model WeMos D1 being sold as WeMos D1R2 to unsuspecting customers by several other vendors.

You will find several similarities between this Instructable and my previous one because of the fact that the ESP8266 12 is the foundation of the WeMos D1R2 board.

Though the Arduino UNO and the WeMos D1R2 are similar, there are a few differences in their pin assignment. The above illustration provides the mapping of the pins. In some situations programs written for the UNO will need to be modified a little to the proper pin assignments of the WeMos D1R2. Make sure you have a data cable and not a ordinary charging cable. A data cable causes your Windows OS to react. It announces the attachment of a new hardware and tries to install the USB drivers. It either finds the driver on your system or it does not. If it does not then you will need to download the USB drivers. The USB interface chip is the CH340G. You will need to install the drivers for this chip.

A Google search for the “CH340G drivers” finds several sites. You can download the Windows 7 drivers from here or the Windows 8 from here. Though I have not tried them, other operating systems can be downloaded from here. Getting this step right is important for any further action. It is a Windows installer exe file so double clicking on it will start the installation including the installation of several peripheral drivers. You can find detailed instructions to install the Arduino software here.

The WeMos D1R2 board can be added to the Arduino software/IDE by installing the necessary libraries. This community supported Github page: Unofficial list of 3rd party boards support has the information needed to get your Arduino software to support the WeMos D1R2. Search/look for “ESP8266” on this webpage. Look for the URL shown in the image above. Copy and paste that URL into your Preferences dialog and select OK.
Programming the ESP8266 WeMos