Closed 2bndy5 closed 2 years ago
I think this is a good idea, however I'm not sure we need to wait for serial input to try again, why not just loop the renew in automatically?
good idea. I'll adjust it to do that.
// Connect to the mesh
Serial.println(F("Connecting to the mesh..."));
if (!mesh.begin()) {
if (radio.isChipConnected()) {
while (mesh.renewAddress() == MESH_DEFAULT_ADDRESS) {
// mesh.renewAddress() will return MESH_DEFAULT_ADDRESS on failure to connect
Serial.println(F("Connecting to the mesh..."));
}
}
else {
Serial.println(F("Radio hardware not responding."));
while (1) {
// hold in an infinite loop
}
}
}
In testing the mesh examples on arduino, I found it kinda annoying to get up and reset the MCU when the examples don't connect during
setup()
. This is completely my fault since I added an infinite loop whenmesh.begin()
returned false (for unresponsive radio hardware reasons).Proposal
For any non-master node examples, change
to