About the ESP8266

The ESP8266 is a low-cost Wi-Fi chip with full TCP/IP stack and microcontroller capability produced by Shanghai-based Chinese manufacturer, Espressif Systems

The chip first came to the attention of western makers in August 2014 with the ESP-01 module, made by a third-party manufacturer, AI-Thinker. This small module allows microcontrollers to connect to a Wi-Fi network and make simple TCP/IP connections using Hayes-style commands. However, at the time there was almost no English-language documentation on the chip and the commands it accepted.

The very low price and the fact that there were very little external components on the module which suggests that it could eventually be very inexpensive in volume, attracted many hackers to explore the module, chip, and the software on it, as well as to translate the Chinese documentation.

In late October 2014, Espressif released a software development kit (SDK) that allowed the chip to be programmed, removing the need for a separate microcontroller.Since then, there have been many official SDK releases from Espressif; Espressif maintains two versions of the SDK — one that is based on RTOS and the other based on callbacks.

An alternative to Espressif’s official SDK is the open source esp-open-sdk that is based on the GCC toolchain. ESP8266 uses the Cadence Tensilica LX106 microcontroller and the GCC toolchain is open-sourced and maintained by Max Filippov. Another alternative is “Unofficial Development Kit” by Mikhail Grigorev.

Features

32-bit RISC CPU: Tensilica Xtensa LX106 running at 80 MHz
64 KiB of instruction RAM, 96 KiB of data RAM
External QSPI flash – 512 KiB to 4 MiB (up to 16MiB is supported)
IEEE 802.11 b/g/n Wi-Fi
Integrated TR switch, balun, LNA, power amplifier and matching network
WEP or WPA/WPA2 authentication, or open networks
16 GPIO pins
SPI, I²C,
I²S interfaces with DMA (sharing pins with GPIO)
UART on dedicated pins, plus a transmit-only UART can be enabled on GPIO2
1 10-bit ADC

NodeMCU board and Arduino development

The is a microcontroller from Chinese manufacturer Espressif that includes Wi-Fi capability.

Setup Arduino

Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).

Install Arduino 1.6.5 from the Arduino website.
Start Arduino and open Preferences window.
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field.
Open Boards Manager from Tools > Board menu and install esp8266 platform. this may take a while.
Selecting the board

Here is a screen capture of the settings I used in the Arduino IDE, your settings may differ slightly

nodemcu
nodemcu

You will see the board I purchased below, as you can see I have selected it. On my PC the NodeMCU was on Com 35 (I’ve connected a lot of deveopment boards to this rig). the other settings I left as they were

My board

A fairly low cost board this one, its clearly marked and you will notice that this one uses the CH340 chip

NodeMCU-v0.9

Code

This is just a blink example

void setup() 
{
pinMode(D1, OUTPUT);
}
 
// the loop function runs over and over again forever
void loop() 
{
//flash an led connected to D1
digitalWrite(D1, LOW); 
delay(1000); 
digitalWrite(D1, HIGH); 
delay(1000); 
}

 

Links

The board pictured earlier comes in at about $7, so wont break the bank in any way.

NodeMcu Lua WIFI Internet of Things development board based ESP8266

Wemos D1 ESP8266 based board

The wemos d1 is an Arduino Uno-like wifi board based on ESP-8266EX. You can use the Arduino IDE, NodeMCU and there are other development environments available

Wemos D1 ESP8266 based board
Wemos D1 ESP8266 based board

There is a USB connector, note that its a micro type and you can use this and also OTA for programming. I used the USB cable, it was the easiest way. The board can be pwered via the usb cable or you can plug in an external DC source, in the range of 7v to 24v. I recommend 9v.

The table below shows the pins of the wemos d1, the main difference between this and the Arduino UNO is that there is only one Analog input. All I/O pins are 3.3v, so some arduino shields will not work and obviously be careful what you connect to these pins.

Pin Function ESP-8266 Pin
D0 RX GPIO3
D1 TX GPIO1
D2 IO GPIO16
D3(D15) IO,SCL GPIO5
D4(D14) IO,SDA GPIO4
D5(D13) IO,SCK GPIO14
D6(D12) IO,MISO GPIO12
D7(D11) IO,MOSI GPIO13
D8 IO,Pull-up GPIO0
D9 IO,pull-up, BUILTIN_LED GPIO2
D10 IO,pull-down,SS GPIO15
A0 Analog Input A0

Installing with Boards Manager

Starting with Arduino IDE 1.6.4, the software allows installation of third-party platform packages using Boards Manager. There are packages available for Windows, Mac OS, and Linux (32 and 64 bit).

Install Arduino 1.6.5 from the Arduino website.
Start Arduino and open Preferences window.
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
Open Boards Manager from Tools > Board menu and install esp8266 platform (and don’t forget to select your ESP8266 board from Tools > Board menu after installation).

Code

You can open the examples folder and upload the blink sketch, its copied below for reference

void setup() {
pinMode(BUILTIN_LED, OUTPUT); // Initialize the BUILTIN_LED pin as an output
}
 
// the loop function runs over and over again forever
void loop() {
digitalWrite(BUILTIN_LED, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is acive low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(BUILTIN_LED, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}

Links

https://github.com/esp8266/Arduino

http://www.wemos.cc/wiki/doku.php?id=en:d1
Gikfun WeMos D1 WiFi UNO Based ESP8266 for Arduino IDE Compatible Development Boards EK1715