Communication between multiple ESP8266


What i would like to accomplish is to have one esp8266 that can communicate bidirectionally with four other esp8266. It also needs to be able to connect to the internet to fetch the weather and time.

I have tried using UDP, but the problem i have having is that if i create multiple UDP servers, they no longer function.

What is the best way to accomplish this?

Thanks! -

Havnt been able to figure this out yet.. Any help appreciated

What do they need to say to each other? Maybe you could use MQTT? There is an Arduino esp8266 library called pubsubclient that works well.


I just need to send an array of about 20 bytes..

That library looks promising, thanks

James, the capacitor guy, has an intro article and a few follow-ups here:

MQTT Introduction and Tutorial Part One

You can set up your own broker with mosquitto, or use a publicly-available MQTT broker.

One hang-up that gets a lot of people is that if you use a public MQTT broker, make your Client ID unique. If you use the Client IDs in the examples, you will get in connection battles with every other person out there trying the examples!! Your device will always be connecting and then getting un-connected.

I read about mosquito before, but what I was reading seemed to indicate i needed a raspberry pi for mosquito... I'm trying to do this without additional hardware...


So I've gotten the mqtt client up and running and I can get all the ESPs to communicate, but in the example it shows just one byte or string being sent, what I want is an array of bytes.

I read through the guide on the page you linked, but although he said he was going to go over sending more complex data, he hasn't gotten around to it yet.

it seems I am only getting junk when I try to read the payload data that is transmitted from one client to another...

I have been using two ESP's, one configured as an access point and the other configured as a client connected to the access point formerly created. I am able to send the data successfully but not receiving it on the client side. I have used direct AT commands for configuration and sending data. Following are the AT commands I sent in order mentioned at the access point:
AT+CIPSTART=,"UDP","ID of client",2222
AT+CIPSEND=,no: of bytes

Every command gets executed properly as I receive "OK" and no errors and finally get a '>' prompt to type in my data (Using RealTerm software). After I give the data, I get the "SEND OK" reply! So, that's working fine!

On the client side, before I send data from AP, I connect it to the AP and get an IP. Following are the commands I execute in sequence:
AT+CIFSR //to check IP

Both are executing the "AT+PING" command well! Why am I then not getting the sent data on the client side? It should basically start with the "+IPD" string right? I use two ESP's with versions: and! I hope that it is not a problem as both support the above used AT command set.