Accesspoint - Station Communication Between Two ESP8266 MCUs





Introduction: Accesspoint - Station Communication Between Two ESP8266 MCUs

Hello Makers!

In my previous instructable I made a WiFi communication between two ESP8266 MCUs through a home WiFi router. As I saw from the comments there are Makers who would like to use ESP8266 MCUs far from the range of a router. So here is a bare minimum instructable about an accesspoint - station communication which don't needs WiFi network.

Step 1: What Do You Need.

Things you need:

  • 2 pcs ESP8266 based MCUs e.g. Wemos D1 mini
  • 2 pcs micro USB cables
  • and a PC with Arduino IDE

Step 2:

Everything you have to do:

  • Download the attached sketches
  • Open them in two independent Arduino IDEs
  • Upload them into two ESP8266 MCUs.

The AP has a fix IP address eliminating the IP conflict with your other projects.

The station uses this predefined IP to connect to the AP. The station triggers the AP with a message and the AP answers it.

Opening the serial monitors of each running Arduino IDEs you can see the flow of the messages and answers.

The built in LED flashes during the communication. It is only visualization you can eliminate flashing if you don't like it.

Step 3: How to Open Independent IDEs

How to start two independent Arduino IDEs?

  • At first click on the accesspoint_bare_01.ino. It will open the first Arduino IDE.
  • Connect the first MCU.
  • Set the new port appears in the Tools->Port menu to the first MCU.
  • Upload the sketch. It will be your accesspoint.
  • After that go back to the downloaded sketches and double click on station_bare_01.ino. It will open the second Arduino IDE.
  • Connect the second MCU.
  • Set the new port appears in the Tools->Port menu to the second MCU. (If your IDEs are independent then port will not change in the first IDE window.)
  • Uplod the sketch. It will be your station.



  • Science of Cooking

    Science of Cooking
  • Trash to Treasure

    Trash to Treasure
  • Paper Contest 2018

    Paper Contest 2018

We have a be nice policy.
Please be positive and constructive.




Hi Gyalu,

I just want to thank you in English.

Your article is so great :D

Hi 潘宗轅,

You are welcome!

Did you use it in your project?

Yes, I try to use ESP-01 instead of arduino nano and HC-05.

But there are some problems.

I need to send data once by client in 2ms.

But it's working too slowly by ESP-01 Wi-Fi, from time to time will pause.

I still don't know the reason why...

I am afraid ESP and the WiFi communication wil be slow to send and receive messages in every 2ms.

good day bro,

I am trying to use your code with two clients(+) and one station. I have uploaded the access point code in two esp8266 12e and made some modification, but no success so far. have you tried such thing?

Hi alharith,
I don't understand well what would you like to do, but if you want to connect more esp into one network, then you need only one accesspoint and you can connect more (max five) stations to it.
So I don't know why do you need two accesspoints.

Hey Gyalu1,

yeah you are right! I mixed up programs. I got it working now, thanks to you. I have noticed in many websites that 5 stations is your maximum. but I might try to wake some and put some in sleep to solve this problem.

Dear Mr Gyalu,

Hi , this is Vijay .

Thanks for the excellent tutorial.

I am working out to send the digital Input status of the accesspoint to client.

Ex D0 input status of accesspoint is to be sent to client on WiFi.

Client should read status of D0 ( High or low ) and should switch ON or OFF its D0 output.

Can you please guide on this code ?

Hi Vijay,
try something similar in the AP program. Replace the existing "client.println...." command with the next:
In the client:
String answer = client.readStringUntil('\r');
int APD0status = answer.toInt();
digitalWrite(D0, APD0status);
Write the results step by step to the serial moditor and you will see what you have to modify.

Hi Gyalu !

Thanks a lot .

It is working fine.

Only change I did , was output no D7 instead of D0 in client code.