ESP to ESP Communication

Introduction: ESP to ESP Communication

About: Electrical Engineering student, seeking and sharing knowledge related to my field. Crazy about robotics and embedded system.

This tutorial will help you to replace other transceiver modules for any other project that includes wireless communication. We will use ESP8266 based board, one in WiFi-STA mode and the other in WiFi -AP mode, NodeMCU V3 is my choice for this project, you may use any other esp8266 board. To verify data transfer, I'm using buttons as input at one side and LEDs as output at other side, you can transmit any sensor data using this method.

Step 1: Components

  1. NodeMCU x2
  2. Buttons x4
  3. 3mm LEDs x4
  4. 1K resistor x8

Step 2: Circuit


Its a very basic circuit, you need to attach 4 input buttons with one NodeMCU, use 1k resistor to pull-up pins D0,D1,D2 and D3, by pressing button, respective pin should be pull-down.


Attach 4 LEDs at D0,D1,D2 and D3 pins respectively.

Check attached fritzing diagram.

Step 3: Programming

Download following sketches for server and client and upload in your nodeMCU/wemos or any other ESP8266 based board, LEDs are at client side and Buttons are at server side. I'm sending data in Json format, so you guys need to attach Json library in your arduino IDE, this library will also help you to deal with multiple parameters in your other projects.

Step 4: Your Attention Require

Hope this tutorial will help you in some way, kindly subscribe our youtube channel for more video tutorials.

IoT Challenge

Participated in the
IoT Challenge

Be the First to Share


    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    5 Discussions


    3 months ago

    Thanks for your tutorial.
    However in scheme connected wrong the LEDs.
    Because The thin tip inside the leds is always the positive tip.


    Question 6 months ago

    Is it normal that when connecting to eachother, the wifi for mobiles is unreachable?
    Maybe they are to close to eachother, or the signal is to strong that it obstructs wifi for mobiles.

    Second, the signal only works for the first ~15 seconds after flashing, then it needs to be flashed again. Is this normal?

    Greets :)


    9 months ago

    the two board do not comunication


    Reply 6 months ago

    It's probably because the ArduinoJson lib was updated from the version 5 to 6. Some sintaxes changed in de recieving process, you can access to change to the new sintaxes. There is a video explaining everything.


    1 year ago on Step 4

    Thanks for your tutorial. In this project, there should be a router in the middle or it is communication from one ESP to another with no router ?