Hi guys,
your tutorials are awesome.
I’ve a question about the ESP-NOW protocol and the maximum number of allowed peers.
In my application I have to send just ONE byte from many peers to one single Master.
The Peers does not transmit all together at the same time, so the concurrency is quite low.
I’ve read the documentation and it says that the maximum allowed non encrypted peers is 20.
I’ve used your example with 2 peers and one Master in it works just fine.
My question is:
In the esp_now.h file is defined ESP_NOW_MAX_TOTAL_PEER_NUM 20.
If I change that value, let’s say to 100 and then recompile both Peers board and Master board, this is enough to let 100 peers to communicate to the Master?
What is then the real limit (I suppose the memory) for such type of changing?
Thank you for an answer.
Hi Michele.
Honestly I don’t know the answer for your question.
I’ve tested 5 ESP32 boards sending data to one board and it worked fine.
The documentation says that the maximum number of peers is 20.
But, in your case, each sender board only has one peer (the receiver).
So, in theory, the receiver would be able to receive from “infinite” boards as long as they don’t send packets at the same time (this is me guessing, I’m not sure if that’s the case in reality).
I haven’t tested such scenario, so I’m not sure if it will work.
Thanks for following our work.
Regards,
Sara
Thank you Sara for your answer.
From what I’ve understood from the code, it seems that the “peer” is the sender.
The reason why I’m saying that is because this chunk of code of the your sender example:
// Register peer
esp_now_peer_info_t peerInfo; // Warning for everybody: this variable MUST be publicly reachable !!!!
memcpy(peerInfo.peer_addr, broadcastAddress, 6);
peerInfo.channel = 0;
peerInfo.encrypt = false;
// Add peer
if (esp_now_add_peer(&peerInfo) != ESP_OK){
Serial.println(“Failed to add peer”);
return;
}
So, it seems that the terminlogy “peer” is for the sender. I’m wrong?
BTW, as side note, I’ve added also a warning in the code about the peer variable that if not set as public, could cause the error:
“E (1212) ESPNOW: Peer interface is invalid”
Hi Michelle.
From what I understand, the peer is the receiver (you add the receiver MAC address on the sender code).
The sender only has one peer that is the receiver board. However, I’m not sure if the sender board also becomes a peer of the receiver automatically …
This is what I understand, I might be wrong.
Thanks for telling me about the peer variable.
Regards,
Sara