Adding peer responders in ESP-NOW

sgarciav
Posts: 4
Joined: Mon Jul 08, 2024 7:25 pm

Adding peer responders in ESP-NOW

Postby sgarciav » Wed Jul 17, 2024 3:28 am

Hi all. I am working on a project that involves ESP-NOW. I have this working, but have a question regarding adding more peers to the ESP-NOW network.

What happens if I add a peer that I've added before?

Is the MAC address added again, creating a duplicate?

Is the add peer function ignored because the MAC address of the new responder is already in the list?

Does the function generate an error because adding an existing MAC to the peers list is not allowed?


Any of the above works for me, as I can handle each case, but I would like to know what happens when I add an existing responder MAC so that coding effort is not over done. Thank you.

MicroController
Posts: 1734
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Adding peer responders in ESP-NOW

Postby MicroController » Wed Jul 17, 2024 8:36 am

esp_now_add_peer(...):
Returns:
...
  • ESP_ERR_ESPNOW_EXIST : peer has existed

sgarciav
Posts: 4
Joined: Mon Jul 08, 2024 7:25 pm

Re: Adding peer responders in ESP-NOW

Postby sgarciav » Fri Jul 19, 2024 3:10 am

Thanks!

I looked up the error and found the documentation here:

https://docs.espressif.com/projects/esp ... p_now.html

It is almost halfway down the page. Much appreciated! Saga

Who is online

Users browsing this forum: No registered users and 189 guests