OnEspNowError

Here we can discuss about the problem found
Post Reply
botman
Posts: 9
Joined: Thu Apr 01, 2021 3:04 pm

OnEspNowError

Post by botman »

I have been experimenting with EspNow communication with Annex 1.43 on the ESP32, specifically with EspNow transmissions from one M5stack to another M5stack. I found that I needed to set AP+STA mode on both M5stacks to get any successful communications via EspNow. I modified the example EspNow receiver program from the Annex documentation to print received messages to the TFT screen, and that seems to work fine. I found that running the example EspNow transmitter program (modified to send an incrementing number converted to a string) on the other M5stack was not reliably sending each message. Many message transmissions would fail, and then one or two would succeed. I tried to use OnEspNowError to catch the transmission error and retry with some success. It would catch transmission errors and allow me to retry, sometimes many times, until the transmission was successful. However after 21 transmission errors were detected, no more could be detected. For example, if the first message required 5 retries before a successful transmission, and the next required 10 retries, and a third message required 4 retries, that would be three successfully transmitted messages requiring 19 error detections and retries. If the fourth message failed two times (making total number of error detections equal to 21), additional failed messages would no longer be detected as errors. Restarting the transmitter program did not re-enable the error detection. Turning the power to the transmitting M5stack off and back on and restarting the EspNow transmission program made it correctly detect another 21 transmission errors and then stop detecting them again. Might this limitation on the total number of EspNow transmission errors detected be a bug in Annex 1.43 for the ESP32?
Post Reply