Automatically perform transport sanity check after a number of failed transmits #1449
Description
It has been observed that power surges can bring the radio (at least for genuine nRF24) in a state that it will no longer communicate over the air.
The MySensors stack does not detect this (nRF24); instead all attempts to send will result in NACKs until the radio is re-initialized.
MySensors already defines MY_TRANSPORT_SANITY_CHECK which does detect, and correct by reinitializing, the faulty radio state, but the sanity check is only started at a predefined interval. By default this interval is set to 15mins, so a lot of transmits can fail until the sanity check kicks in.
It would be a nice feature to automatically trigger a transport sanity check, also after a number of failed transmits.
The stack automatically starts looking for a (new) parent after a number of successive Tx failures, or restarts the counter in case of a static parent:
MySensors/core/MyTransport.cpp
Line 316 in 8f1f8ad
This would be a good place to trigger a transport sanity check.
Labeled as RF24, but other transports can also benefit from this feature.