ESP32 Now Multiple User

Enclosed is my variation on the master and slave programs used in the examples for the Multiple slave option. I have taken out a lot of the print statements and included a 'slave name' addressing system for sending data to each slave individually as well as added in some error detection.. The programs assume that the user knows the number of slaves that are used

<< ESP32 NOW MULTIPLE MASTER >>

  1. The number of slaves is preset by the designer (Max 20 as per esp_now.h)
  2. The slave names are stored for direct addressing of data. The Mac address is not used in the slave name
    The program recognizes that the string Slave is included in the slave name
  3. On startup the slaves are scanned and paired. If all pair "SlaveConnected" is set to True
  4. Data can be sent separately to each slave via "SendData(String Name,uint8_t data)"
  5. If the data is not sent successfully then "SlaveConnect" is set false
  6. If this happens then a rescan starts, this allows restoring a slave without touching the master
  7. Only communication from Master to Slave is supported
  8. Encryption is not used in this example

<< ESP32 NOW MULTIPLE SLAVE>>

  1. This program is the same for each slave
  2. The slave SSID name must include the string "Slave" and be unique for each slave
  3. Only communication from Master to Slave is supported
  4. Encryption is not used in this example

I hope you find this of use

ESP32_Now_Slave_Multiple.ino (2.25 KB)

ESP32_Now_Master_Multple.ino (6.84 KB)

RodMcM:
Enclosed is my variation on the master and slave programs used in the examples for the Multiple slave option.

Thanks for sharing.

Can you please add a link to the source of the examples

...R