-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential mesh.checkConnection() improvement #249
Comments
This would definitely be acceptable. Should it also safeguard from using The current implementation has an added prevention about calling The docs would need to be clarified as well. Something like:
Even though |
Yes, it should return immediately. Good call.
Yes that is probably a good idea as well I will do some more testing before putting in a PR, but I think this would be a good change. |
I especially like this bit. It seems much better suited to the name "mesh". |
Wondering if we should do a define or something, so the old behaviour is easier to get to? Like |
It is a good idea. Since it is a binary toggle, I think we could further eliminate the magic number used as a macro value #define RF24MESH_CONN_CHECK_PARENT 1
#define RF24MESH_CONN_CHECK_MASTER 0
#define RF24MESH_CONN_CHECK_TYPE RF24MESH_CONN_CHECK_PARENT
// To use old behavior:
// #define RF24MESH_CONN_CHECK_TYPE RF24MESH_CONN_CHECK_MASTER Then in function body #if RF24MESH_CONN_CHECK_TYPE == RF24MESH_CONN_CHECK_PARENT
// New behavior
#else
// Old behavior
#endif |
* mesh.checkConnection via parent not master - Adjust mesh.checkConnection function to verify connectivity with parent only. Leave old functionality in place with a #define - Suggestions in place per @2bndy5 closes #249 * Fix last commit - _nodeID not nodeID * review changes * trigger compile size reports for PRs Specifically for PRs that only change the lib src code and not examples. * doc review use doxygen references * [docs] clarify return value of checkConnection() * format RF24Mesh.h Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * review supported CMake options also defaults RF24_DRIVER to SPIDEV (per nRF24/RF24#971) * add reference to new config macro in checkConnection() doc. --------- Co-authored-by: Brendan <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Right now
mesh.checkConnection()
is a bit intensive on the network and especially the master node, because each node will, in turn, check its connection which requires an address lookup + reception + response from the master node.I am thinking about a change to the general
checkConnection()
function as follows:Essentially, each node would only be contacting their parent node directly with an auto-ack message. This way if say top nodes like 05 and 04 lose their connection for a short time, it could potentially take a bit longer for the mesh to partially fall apart in some cases, then reconverge. This might be a good thing, because other nodes should take up the top spots in a short period of time.
This will make it much easier for distant nodes to verify their connectivity as well.
This would leave it up to users to call getAddress(); if they want the old method of connection checking. The whole theory here is to make the mesh less dependent on the master node.
In any case, this is just up for discussion right now.
The text was updated successfully, but these errors were encountered: