nRF24 / RF24Mesh

OSI Layer 7 Mesh Networking for RF24Network & nrf24L01+ & nrf52x devices
http://nrf24.github.io/RF24Mesh
GNU General Public License v2.0
422 stars 154 forks source link

Master unable to send to node, if AddressList list has been cleared #165

Closed systemofapwne closed 5 years ago

systemofapwne commented 5 years ago

Hello, whenever the AddressList has been cleared, e.g. when the master restarts (without saving in dhcplist.txt) but client still has a valid address, the client might be able to still send data to the master and the master receives it. Yet, the master is unable to send data back to the client, because it's AddressList is empty: The network header resolves to "from_nodeID = -1".

I have to add, that I use this nodejs wrapper of your lib (https://github.com/ludiazv/node-nrf24). But tracking down the error, it all went into the direction of RF24Mesh library.

Suggested fix: When the master receives from a node he has not yet in his AddressList, add him to the AddressList or force him to reaquire a new address (e.g. by causing RF24Mesh::checkConnection() to fail on the remote node) By the way: Checking connectivity via RF24Mesh::checkConnection() on the node will return true in such situations. So the node still thinks, he is properly connected, while it isn't (because just in one direction).

Avamander commented 5 years ago

This has been discussed a few times. The general consensus is that everyone has to implement a method of checking if you have a valid address, all misconfigurations are too complex to detect and fix in the space available on an Arduino, even ARP/IP can't deal with clients lying about address validity. Address validity check can be done by implementing a trivial ping-pong system you can also use for other purposes, like updating time on leaf nodes.

systemofapwne commented 5 years ago

I was not aware of this situation. In the mean-time I implemented a ping-pong system as a workaround, as you also have suggested. I just thought, adding a quick fix to the library itself, wouldn't hurt but I agree on the complexity.

Thank you for your reply!