Before you read this post, I recommend reading these tutorials about the ESP8266:
- Getting Started with ESP8266 WiFi Transceiver
- ESP8266 Web Server Tutorial
- Flashing NodeMCU Firmware on the ESP8266 using Windows
In this project you’re going to create a simple HTTP client with an ESP8266 WiFi module. Having your ESP8266 connected to your network, it requests the current Bitcoin price. This is an example on how to retrieve data from the web.
First, flash your ESP8266 module with NodeMCU
NodeMCU is a firmware that allows you to program the ESP8266 modules with LUA script. And you’ll find it very similar to the way you program your Arduino. With just a few lines of code you can establish a WiFi connection, control the ESP8266 GPIOs, turning your ESP8266 into a web server and a lot more. Follow this tutorial to Flash your ESP8266 with NodeMCU.
Schematics (3.3V FTDI Programmer)
The schematics for this project are very straight forward. You only need to establish a serial communication between your FTDI programmer and your ESP8266. You can buy one FTDI programmer on eBay.
- RX -> TX
- TX -> RX
- CH_PD -> 3.3V
- VCC -> 3.3V
- GND -> GND
I recommend using the ESPlorer program created by 4refr0nt to create and save LUA files into your ESP8266. Follow these instructions to download and install ESPlorer:
- Click here to download ESPlorer
- Unzip that folder
- Go to the dist folder (here’s the path: ESPlorer-master\ESPlorer\dist)
- Run ESPlorer.jar. It’s a JAVA program, so you need JAVA installed on your computer.
- Open the ESPlorer
How to send commands to your ESP8266
When you open the ESPlorer you should see a window similar to the preceding Figure, follow these instructions to send commands to your ESP8266:
- Connect your FTDI programmer to your computer
- Select your FTDI programmer port (COM8, for example)
- Press Open/Close
- Select NodeMCU+MicroPtyhon tab
- Copy the following script into ESPlorer
For more detail: Retrieving Bitcoin Price Using ESP8266 WiFi Module