EspNowFloodingMesh
EspNowFloodingMesh copied to clipboard
Feedback and questions about the future of this library
Hi,
I've just discovered this nice library and would love to use it. IMHO there are a few small issues but the first tests are very promising. What are your plans? Will you continue to use and improve this library? Will you accept pull requests?
Some questions
Time Sync
My current master node does not have an RTC so every time I reboot it, time starts at 0. So after rebooting the master I have to wait until the master's uptime is higher than it was before the reboot. Checking the timestamp is labeled as a security feature but I don't see how this improves the security. If I'm able to inject a valid encrypted message to the network the security is broken nevertheless. An attacker could use an arbitrary high timestamp to circumvent this check completely.
Do I miss something here? If not, I recommend removing the check for a valid time completely.
Mesh State Handling
I don't see a good way to check the state of the mesh from outside the library. espNowFloodingMesh_syncWithMasterAndWait
seems to be the only way to check if there was a connection to the mesh in the past. The variable syncronized
(btw, there is a h missing there…) looks promising but is never set to false
when there are no more time sync messages arriving and there is also no clean way to query the state from outside.
I'm not sure I did understand the code correctly as time sync seems to be optional. So the variable syncronized
not always represents the mesh state.
If I did interpret this correctly I would propose to add:
- a callback function which is called on mesh state changes (synced, sync loss)
- A function to query the connection state
Documentation
Digging through the code does help but comments are very sparse. What is the meaning for variables like syncronized
or isespNowFloodingMeshInitialized
?
Also, the callback method espNowFloodingMesh_RecvCB
seems to be undocumented. It is not too hard to get most of the information out of the source code of the SimpleMQTT library but IMHO this should be minimally documented here.
Please don't get me wrong… these are just my 2 cents and the library does look very promising.
Huge thank you for implementing flooding mesh (similar approach new BT mesh protocol has). Testing this library right now too.
@tht Time Sync might help to prevent message replay attack.