With an ESP8266 board, the WiFiEsp library allows an Arduino board to connect to the Internet. It can serve as either a server accepting incoming connections or a client making outgoing ones. The WiFiEsp library is very similar to the Arduino WiFi and Ethernet libraries, and many of the function calls are the same.
Supports ESP SDK version 1.1.1 and above (AT version 0.25 and above). If you need to update the ESP firmware follow this guide.

The main WiFiEsp library features are:
  • APIs compatible with standard Arduino WiFi library.
  • Use of standard ESP firmware through AT commands (no need to flash a custom firmware).
  • Support hardware and software serial ports.
  • Configurable tracing for troubleshooting.

First of all you have to connect the ESP module to your Arduino board.
I have developed my own cheap ESP WiFi Shield using an ESP-01 module. Look at this Instructable on how to build it.

Now follow these set of articles to see how to use the WiFiEsp library for your projects.

Basic topics

Advanced topics


  1. Thanks for the very helpfull articles!
    Can you post other photos showing how to connect the ESP please?

  2. Your WiFiESP Library totally saved me from burning every ESP8266 module I'd bought, there's not a single other library out there (ah, ok, yours is only the 3rd one I've tried, but...) that would get my ESP8266 attached to my BT Home Hub Wifi router. Your lib + connectWPA sketch = instant success. Many thanks!

  3. Hi, does anybody have experience in controlling the ESP Module Power Up/down through the CH_PD pin connected to a dedicated arduino digital pin when using the WiFiesp library?

  4. Hi, my friend :)

    I find your library extremely useful and helpful but I would like to ask you if it's possible to make it work also with the TCP data packet transmission and reception since I would like to do so for a project that needs a more efficient and secure data transmission.

    Could you please implement TCP in your library and also add an example?

    That would be really appreciated.

    Thank you! Bye!

  5. Hi,

    Thankyou very much for your library! It is very usefull to integrate ESP8266 in Arduino projects. I'm trying to program a webserver to see data of some sensors connected trough SPI. I have a question regarding client detection: is there any interrupt or something like that is trigered when an user is connected to the IP of the webserver? my program crash just when I connect to the ip, even if I use a variable to "allow" the connection when no other task is performed...

    Thanks in advance!

  6. This comment has been removed by the author.

  7. This comment has been removed by the author.

  8. Hello, Good library!
    But in your example WebServerLed you forgot to set port 13 to OUTPUT.
    So, in Setup: pinMode(13,OUTPUT);
    Keep up the good work!

  9. Hi, finally a website with clarity. Great work. in the WebserverAP sketch, how can I add two buttons to the web page and perform some actions when either of the buttons are pressed ? [Matt]

  10. Hi, thanks for your work. Pls can this be achieved without using the shield? or can it be done using SparkFun Esp8266 wifi shield? Really hope you can help me. Thanks

  11. Hi, thanks so much for developing this library!
    It has been working perfectly although it doesn't seem to connect to Wifi networks with spaces in their SSID. Are there any way to tackle this? Thanks in advance


  12. Benvenuti nel nostro Shop & Blog

    Questo sito promuove le nuove tecnologie attorno ai sistemi di Videosorveglianza e sistemi di Antifurto. Tendiamo a presentare i sistemi Wireless "senza fili" per ridurre tempo e costi di installazione. Tutto è facile da installare e quindi ci rivolgiamo a tutti che amano il fai-da-te.

    Nel nostro Blog trovate un po di tutto e se vi registrate potete lasciare una Vostra testimonianza che è sempre benvenuta.

    Trovate articoli per la videosorveglianza cablata e wireless come DVR, NVR, telecamere Bullet e Dome IP, POE e WiFi. Sistemi di Antifurto wireless con Sirene e Sensori. Prodotti per Network come Router, Repeater, WiFi, cavi Rete, Gaming. Harddisk esterni, PowerLan, Convertitori, Adattatori. Articoli per Ufficio come sedie, scrivanie ed altri.

  13. Nice to read this article will be very helpful in the future, share more info with us. Good job! unlimited rural internet ohio

  14. I hope you will share such type of impressive contents again with us so that we can utilize it and get more advantage.
    unlimited wireless internet service for home

  15. This comment has been removed by the author.

  16. WebServerLed works only within my local network. Whatever I try in my router setup, the sketch keeps coming up with: Open a browser to, which is a private IP address. What can I do to access the module from anywhere?

  17. Good morning,
    Is it possible to use the gateway and or DNS and or subnet with this library?
    The line "WiFi.config(ip,gateway,subnet);" doesn't work and I need to configure at least the gateway to have control from outside my network.
    Thanks in advance for your help...

    1. you can call us regarding your problem we can fix your all problems.Visit our website our website thanks and regards

  18. Muchas gracias por tu trabajo!!, me salvo un monton el ejemplo WebServerAP.

  19. He also just added an SMTPClient to his library that I'm trying to figure out.. Looks really cool!

  20. ya its a really nice post thanks dear

  21. Thanks for sharing information.Dial our toll free number 1-866-606-3055 for instant online help with mywifiext.net local and login setup.

  22. Really I Appreciate The Effort You Made To Share The Knowledge. This Is Really A Great Stuff For Sharing. Keep It Up. Thanks for Sharing… LocalBest.com is best way in which shoppers look for organizations. For more information you can visit at localbest.com/

  23. I am trying the WebServer example from the library. I'm using a 3.3V Arduino Pro Mini. In the example sketch I changed the baud rate to 9600 since I'm using SoftwareSerial. This is an example of what I get when I connect with a browser. Near the end the output becomes gibberish.

    Setting ESP8266 baudrate to 9600...
    [WiFiEsp] Initializing ESP module
    [WiFiEsp] Initilization successful - 1.5.4
    Attempting to connect to WPA SSID: BEDDO
    [WiFiEsp] Connected to BEDDO
    You're connected to the network
    IP Address:

    To see this page in action, open a browser to

    [WiFiEsp] Server started on port 80
    [WiFiEsp] New client 1
    New client
    GET / HTTP/1.1
    Connection: keep-alive
    Cache-Control: max-age=0
    Upgrade-Insecure-Requests: 1
    User-Agent: Mozilla/5.0 (WindowsNT100;Wi64 x4 AplWeKi/57.6 KTM, ik Gck) hrme7.0363.03Saar/57.6
    AcptEnodng gip dflt
    ccptLaguge e-S,n;=09

    [WiFiEsp] TIMEOUT: 101

  24. i am very impressed, i must say. Thanks for sharing the information with us. Your idea is a very good. I am inspired with your post writing style & how continuously you describe this topic.
    if you are facing any problem with mywifiext.net setup page. you can read the mywifiext.net blog and get the solution.

  25. I have been trying unsuccessfully for a couple of days to get a UDP server that listens for data on a port to work. I haven't seen anything that says I can do this with WiFiEsp or the ESP8266. None of the examples for any mode of operation seem to work. I have found problems in the driver with commands not matching the AT command document.

    The main question is, can I listen on a UDP socket? The documentation doesn't seem to say I can. If so, how can I do this. I have SDK version 1.5.4, AT version, and WiFiEsp version 2.2.2 I have this working with an Ethernet shield, I just want to switch to WIFI.

  26. Hello,
    Good Morning,
    Your Article is full of standard information.We learn many new things from your post.
    Thanks for posting this article.
    Gunman Security Guard Service in Bahadurgarh