Program ESP8266 WiFi module with Arduino IDE:


The Arduino IDE software (short for Integrated Development Environment) is the foundation of what has made the Arduino platform so successful. With it, Makers can program a wide range of compatible microcontroller boards using Arduino’s relatively approachable programming language. Behind the scenes, the IDE software translates your instructions into a more complex code required for your board’s specific chip.
Aside from generally cleaning up a number of known bugs, the new update introduces a number of new tools and features.
One of the useful feature is board manager which allow use to add customized and diffrent board support in Arduino IDE.
In this tutorial we are going to add ESP8266 board in Arduino IDE and program it without and programmer simple using RX, TX pin.

Required :
1) ESP8266
2) Arduino UNO
3)connecting wires
4) Local wifi router

Step 1 :
For buy ESP8266 module here amezon link is given
Buy ESP8266 From Amezon
here I used ESP8266 12E

Step 2 : Install Arduino IDE. I used Arduino IDE v1.6.8

Step 3 : go to File > Preferences > Additional Board Manager URLs
paste this link in text field

 



 Step 4 : goto Tools > Board > Board Manger and search for "esp8266"
click on install button wait until board get install.

 


Step 5 : After successfully install board now take your arduino board remove controller. Now its only USB to UART converter with 5v and 3.3v power supply. Connect ESP8266 with Arduino board as shown in image.
as esp8266 datasheet mention it can work on 5v or 3.3v . but it affect on wifi range as 5v gives large range for module.

Step 6 :
Restar  Arduino IDE now connect arduino board with ESP8266 connection as in above diagram.
goto Tools > Board > Generic ESP8266 Module
 
default configuration is shown below image 


Step 7:
now install esp8266 library alredy made by developers with examples.
goto Skrtch > Include library > Manage libraries  Search for "ESP8266 webserver"
and install ESP8266WebServer library here I already installed it.


Step 8:
Goto File > Examples > ESP8266WebServer > AdvancedWebServer
made some changes in program. ssid and password.


Step 9 :
Note : ESP8266 is having 4 mode of operation 1)Genaral mode ,2) Boot mod, 3) Host mode, 4)AT command mode 
here we only deal with genaral mode and boot mode.
for load program in ESP8266 we have to go in boot mode for that Press and Hold FLASH button and then Press reset button  first release reset button then FLASH button. now your ESP8266 in boot mode

Step 10 : Upload program from Arduino IDE.

Step 11: For testing Web server open serial terminal at 115200 baud rate and get IP adress of server. outout of serial terminal like
......
Connected to MYtestWifi
IP address: 192.168.0.10
MDNS responder started
HTTP server started

Step 12 : goto your browser and hit IP address 192.168.0.10 ( it may vary from your router configuration ) you will see the web page stored in your ESP8266 module.
 Here we use simple HTML page but you can use CSS and java script too as they are executed at client site.
The best place to ask questions related to this core is ESP8266 community forum: http://www.esp8266.com/arduino.

Comments

  1. good one........

    ReplyDelete
  2. Hi, while uploading code it reporting me as

    esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

    pls clarify this...

    ReplyDelete

Post a Comment

Popular posts from this blog