change(ESP_NOW_Serial): No teardown on retry limit #10292
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
After max retries is met once the ESP_NOW_Serial_Class performs "end()" which removes the peer from ESP_NOW. Further messages to and from ESP_NOW_Serial are not received or sent. Peer should stay in ESP_NOW to re-establish connection even with data loss. This change will "retry and drop" the data piece by piece instead of aborting the connection. Description of Change
ESP_NOW_Serial "Peer" will not remove itself from ESP_NOW_Peer list when data sent is not received by a peer. ESP_NOW_Serial::end() is still called when ESP_NOW::send() fails Tests scenarios
Tests scenarios
Tested on a pair of M5Stack Stamp ESP32-C3.
Confirmed that transmission is able to continue after: disconnecting the Receiving module from power.
Attempting to send data.
Restoring power to Receiving module.
Previously, transmission halts as the cleanup/teardown in ESP_NOW_Serial::end() is triggered.
Related links
I did not create an issue for this.
Issue was NowSerial had to be re-initialized essentially for every byte without knowing if the peer was present/restored.
Workaround was to use broadcast address for TX and a separate ESP_NOW_Serial peer with MAC address for RX.