nRF24 / RF24Mesh

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

Is there a use case for a changing master node? #206

Closed 2bndy5 closed 2 years ago

2bndy5 commented 2 years ago

I was testing the exposed addrList in pyrf24 and hit a segmentation fault when I changed the mesh child node into a master node and explicitly called loadDHCP(). I already can see the problem because if the node's ID is not 0 upon calling mesh.begin(), then the addrList doesn't have any memory allocated.

code to reproduce segmentation fault ```cpp mesh.setNodeID(1); mesh.begin(); mesh.setNodeID(0); mesh.renewAddress(); mesh.loadDHCP(); ```

Is there a practical use case in which the master node of a mesh can change similar to how child nodes change?

This wouldn't be a hard problem to solve, but it would definitely involve increased compile size... One could probably just solve it by recalling mesh.begin() after mesh.setNodeID(0).

TMRh20 commented 2 years ago

I don't think there is really a use case for it, plus as you mentioned it would increase memory and program space usage just to support an unlikely scenario.

2bndy5 commented 2 years ago

I also had an idea a while back (when porting to pure python) to reserve a msg type that transfers the DHCP list to a new master node. The only case for that would be if you want a continuous network running while phasing in a firmware update.