Finding ESPNOW peers?

foodini
Posts: 3
Joined: Sat Sep 12, 2020 8:53 pm

Finding ESPNOW peers?

Postby foodini » Mon Oct 26, 2020 6:13 am

I have a project up and running that uses ESPNOW to allow multiple data gathering units to send telemetry, wirelessly, to a logging board that takes in everything and writes it to an SD card for later analysis. For the moment, I've hard-coded the MAC address of the gatherer into the code for the sensors, but if I ever make a few of these for friends, they'll need to be able to pair their sensors with their gatherer. I've considered doing it through a serial connection: if a sensor detects that its serial pins are connected to a peer, they wait for the peer to send a mac address, then store that address to use for all future sends. I solve the problem wirelessly, however, but unless I'm mistaken, I can't use ESPNOW to communicate w/o the address of the target - so I have a chicken-and-egg problem there.

What's the standard mechanism for sharing a recipient's MAC address with senders w/ ESPNOW?

boarchuz
Posts: 605
Joined: Tue Aug 21, 2018 5:28 am

Re: Finding ESPNOW peers?

Postby boarchuz » Mon Oct 26, 2020 7:43 am

You can communicate over the broadcast address (FF:FF:FF:FF:FF:FF) without knowledge of peers.

See the example here for a discovery implementation: https://github.com/espressif/esp-idf/tr ... ifi/espnow

Who is online

Users browsing this forum: No registered users and 80 guests