Learn to use your ESP8266 to connect to the internet and retrieve information from the web. In this tutorial I will teach you how to use the AT commands of your module, how to connect to a router, and then how to retrieve weather data from a website API.
Equipment Used:
RealTerm Serial/TCP Terminal:
http://sourceforge.net/projects/realt...
5V and 3.3V Power Supply:
https://www.sparkfun.com/products/10804
Wall Adapter Power Supply – 9VDC
https://www.sparkfun.com/products/298
FTDI to USB 3.3V Cable:
http://www.mouser.com/ProductDetail/F...
ESP8266 Wifi Module:
http://www.ebay.com/itm/ESP8266-ESP-0...
Steps To Connect and Get Information From API:
1. Power-up circuit
2. Reset ESP8266 module: AT+RST\r\n
3. Join Access Point: AT+CWJAP=”yourSSID”,”yourPassword”\r\n
4. Connect to API: AT+CIPSTART="TCP","api.openweathermap.org",80\r\n
5. Tell ESP8266 the length of the HTTP GET request string: AT+CIPSEND=85\r\n
6. Give ESP8266 the HTTP GET request string: GET /data/2.5/weather?q=San%20Francisco,us HTTP/1.0\r\nHost: api.openweathermap.org\r\n\r\n\r\n
Resources:
Wiki:
https://nurdspace.nl/ESP8266
Datasheet:
http://wiki.iteadstudio.com/images/4/...
OpenWeather Map API:
http://openweathermap.org/current