Skip to content

Commit 6b76eb3

Browse files
author
Marcelo Aquino
committed
fix a possible parent repeater loop
1 parent 64dae74 commit 6b76eb3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

libraries/MySensors/MyGateway.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void MyGateway::begin(rf24_pa_dbm_e paLevel, uint8_t channel, rf24_datarate_e da
4747
}
4848

4949
nc.nodeId = 0;
50+
nc.parentNodeId = 0;
5051
nc.distance = 0;
5152
inclusionMode = 0;
5253
buttonTriggeredInclusion = false;

libraries/MySensors/MySensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ boolean MySensor::process() {
287287
if (repeaterMode && command == C_INTERNAL && type == I_FIND_PARENT) {
288288
if (nc.distance == 255) {
289289
findParentNode();
290-
} else {
290+
} else if (sender != nc.parentNodeId) {
291291
// Relaying nodes should always answer ping messages
292292
// Wait a random delay of 0-2 seconds to minimize collision
293293
// between ping ack messages from other relaying nodes

0 commit comments

Comments
 (0)