ESP_NOW Multi-casting
Posted: Sun Dec 20, 2020 8:00 am
Hello,
I am working on a project that uses several ESP32, which communicate with each other over ESP_NOW.
They are logically split in 2 groups, master and simple nodes. Initially nodes use broadcast to discover masters, and as masters respond, the node can save their mac addresses, and continue communication using unicast.
In some cases, I need to have a node multi-cast a message that only masters should receive.
I am not very sure if and how esp_now supports multicast, so I will explain briefly my approach, and wait for comments.
All master nodes at startup have their factory assigned mac changed to a locally assigned mac, and they all get the same second octet set to 0x2F. I also set second LSB of first octet to make the mac address LLA.
The simple nodes always use their factory assigned mac.
When a node wants to multicast, it uses this hard-coded mac as destination mac: ff::2f::ff::ff::ff::ff.
My assumption is that all devices that receive this need to have a second octet matching 0x2F to accept it.
At the moment it seems like all devices receive it regardless of second octet value.
My guess is that since the broadcast bit is set in this mac, the rest is ignored, and no filtering happens, the message is accepted by all. Correct? and if so, is there a way to created a multicast mask / group on esp_now?
Thank you
Alex
I am working on a project that uses several ESP32, which communicate with each other over ESP_NOW.
They are logically split in 2 groups, master and simple nodes. Initially nodes use broadcast to discover masters, and as masters respond, the node can save their mac addresses, and continue communication using unicast.
In some cases, I need to have a node multi-cast a message that only masters should receive.
I am not very sure if and how esp_now supports multicast, so I will explain briefly my approach, and wait for comments.
All master nodes at startup have their factory assigned mac changed to a locally assigned mac, and they all get the same second octet set to 0x2F. I also set second LSB of first octet to make the mac address LLA.
The simple nodes always use their factory assigned mac.
When a node wants to multicast, it uses this hard-coded mac as destination mac: ff::2f::ff::ff::ff::ff.
My assumption is that all devices that receive this need to have a second octet matching 0x2F to accept it.
At the moment it seems like all devices receive it regardless of second octet value.
My guess is that since the broadcast bit is set in this mac, the rest is ignored, and no filtering happens, the message is accepted by all. Correct? and if so, is there a way to created a multicast mask / group on esp_now?
Thank you
Alex