So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Blikin
#70750 I'm new to socket programming, so I may seem pretty naive. I am! I have a couple of nooby questions.
One: Can an Access point talk to another, or can it only talk to a client?
Can a client talk to more than one Access Point?

Two : This requires a bit of background explanation.
There are five houses in a row, along one side of a street. Four of them have Internet routers in them.
I have an idea for an application that would use an ESP8266 in each house. Each one would only be able to communicate with the one(s) next door, because of distance, walls, etc.
Let's call the 8266's A, B, C, D, E.
Each one would monitor an event in the house, and if triggered, it would send a message to its neighbour. Let's use an example.
1. MCU_B is triggered. It sends a message to A and C, so I guess at that moment, it has to be an Access Point (please correct me or suggest something better if I'm wrong)
2a. MCU_A and MCU_C beep. Resident_C presses the button, which resolves the matter.
2b. If nobody responds, MCU_B communicates with its local Internet router to send a message to a cell phone.
2c. If MCU_B is the one that does not have a local Internet router, it asks another MCU to send the message to the Internet.

As you see, each MCU must take on the role of Access Point (AP) when it suits, or Client while in idle mode.
I can't have a single AP, as it would not be able to communicate with stations more distant than its direct neighbour, so my mesh would probably be...
Master...Slave...Master...Slave...Master
or at other times,
Slave...Master...Slave...Master...Slave

So here's my question - is there any tried and trusted method of negotiation for the stations to decide who is slave and who is master?
Any thoughts? Ideas? Experience?