Closed manishmeganathan closed 3 years ago
Further understanding of the painlessMesh libraries method for checking mesh connectedness indicated that it is intended to check if another node is currently connected to the mesh. It does not allow checking itself, which now also seems to not be a great idea, as the mesh considers itself a part of the mesh until it discovers the larger existing mesh.
The solution to the problem mentioned in the previous comment seems to be to use the CONTROLNODE value to check if the CN is currently connected to the mesh. Because of the symmetric nature of the mesh, it applies the same way (more or less). This temporary solution assumes the CONTROLNODE variable is already available to the node. The handshake runtime suggested in #6 is required to retrieve that value dynamically.
FyrNode
class to poll the status of the node's connectedness.mesh.isConnected()
from the painlessMesh library to achieve this