Page 1 of 1

Pairing with ESPNOW

Posted: Mon Jul 18, 2022 1:51 pm
by AyubowanPro
Hello,

I am new to ESPNOW and I don't now which configuration to choose.

Here is my setup:
There are receiver "a" and sender "A", receiver "b" and sender "B". Every senders must be able to connect to every receivers. But when a sender is connected to a receiver, the receiver must reject any connection/message from another sender.I just need a one way communication (from sender to receiver).

Example:
Receiver "b" is ON. Sender "A" is powered ON. "A" is looking for peers and found "b". "A" is connecting to "b". "A" and "b" are now paired and "A" is sending messages to "b".
Then, receiver "a" is now powered ON. Sender "A" and receiver "b" are already paired and not disturbed by receiver "a". "A" is still sending messages only to "b".
Finally, "B" is powered ON. It's looking for peers and found "b" and "a" but "b" is already paired to "A". So, "B" chooses "a" and after pairing, it communicates with it.

I don't want to hardcode MAC addresses. So, I think I have to give the receiver's MAC address to the sender (but I don't know how) ?
As ESPNOW is connectionless, I don't know how to implement the pairing process.
Maybe I found a trail: wifi access point. As I can configure it with WiFi.softAP(SSID,PASSWORD,.....,MAX_CONNECTIONS). If I set the parameter "max_connection" to 1 and the broadcast address of the sender to "0xFF 0xFF 0xFF 0xFF 0xFF 0xFF", maybe it could work as intended ?

Could you help me to choose the right path ?