ESP8266 esp-now comms stall after master device wakes from deep sleep

I'm sure the problem I am seeing is something experienced by others trying to get ESP8266 devices to communicate using esp_now. I have spent many hours searching for answers to no avail

The setup is relatively simple with two ESP8266 devices, 1 as MASTER (sends data) and 1 as SLAVE (receives data). Using Arduino 1.8.9 and v2.5.2 in the ESP8266 boards manager. The project is for a sensor that collects data and sends to the SLAVE.

The devices start up fine and the SLAVE creates a softAP, inits the esp_now, registers a recv callback and waits for data.

The Master inits esp_now, sets its own role as Controller and adds the Slave peer with role as Slave. It then loops and sends data every 10 secs. No encryption used on the esp_now setup

if at the end of the loop section I use a delay(10000) [let's call this mode 1] then the Slave receives and prints every send from the Master

However, if at the end of the loop section I use a deep_sleep for 10 secs [Let's call this mode 2] then when the device restarts and sends data it is not received/displayed by the Slave.

I have tried deleting the peer before the Master goes to sleep but still get the same results.

Interestingly with "mode 1" if the Master device is restarted then packets are also no longer received by the Slave.

If the Slave device is restarted using the reset button then it will receive and display one and only one packet of data from the Master.

The Master sets up the esp_now in the same way when it restarts.

It seems like the Slave is somehow blocking or not receiving packets.
I have used this great example as the basis of the Master

Any thoughts are welcomed and I guess a few straight forward questions

Does the Slave softAP hold any details for incoming packets about a device?

Does the esp_now "add_peer" store anything about the relationship at the Master

Does anyone know about/have any means to monitor whats happening on the softAP - I have tried setting debug out on via the IDE (WiFi.printDiag(Serial); and Serial.setDebugOutput(true):wink: without anything meaningful.

Hi

Further to the original POST I managed to circumvent the problems I was experiencing.

Since I was getting nowhere with the original strategy I changed tack so that I could make some progress. I abandoned the idea of the scan and send because the comms stalled and also the time taken was way too long (between 2 and 5 seconds). With this solution using ESP-NOW I am achieving around 250mS for the sensor from wake-up to deep sleep.

Just to recap my requirements, I needed a central node to accept readings from multiple battery-powered sensors. The central node was permanently powered and remained online whilst the sensors would deep sleep and wake every 10 mins to deliver their readings - total awake time is 250mS.

This central node, which I refer to as the controller, is connected to my WiFi network whilst at the same time listening for sensors using ESP-NOW. Note: the same channel must be used.

The sensor will scans for a controller only when power is first applied. The details are stored in the RTC memory to survive restarts. It broadcasts its presence and awaits a response from the controller. The WiFi channel is aligned and data readings are transmitted to the controller.

The controller forwards all the readings to a central data logging server and also maintains the latest sensor FW version. This allows sensors to update the FW from a central repository.

During power-up scan the sensor is awake for approx 5 secs and a FW update can take between 20 to 30 secs but since both are infrequent the battery is expected to last quite some time. I am currently monitoring how well the battery powered sensor lasts