Hello Guys,
I am using successfully listenmode branch of RFM69 for couples of low power node and gateway. Works great except one point, the moteino which is waiting for a burst is wake up even if the node is not on the same network. I several couple node/gateway with different networkId in the same area it is a big mess !
These code herafter is executed even if both node and gateway does not have the same networkID.
I assme that in these piece of code, the node "from" never receive the acknolegment "woke".
My question for the experts :
Is there a way to check if sender of the burst and receiver are on the same network in a simple way ?Jérôme
radio.listenModeStart();
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
// Woke up, check for a message
Serial.println("Woke up!");
uint8_t from = 0;
long burstRemaining = 0;
if (radio.DATALEN > 0) {
Serial.println("Received a message in listen mode");
Serial.println((char*)radio.DATA);
Serial.flush();
from = radio.SENDERID;
burstRemaining = radio.LISTEN_BURST_REMAINING_MS;
}
// Radio goes back to standby, ready for normal operations
radio.listenModeEnd();
if (from) {
while (burstRemaining > 0) {
LowPower.powerDown(SLEEP_60MS, ADC_OFF, BOD_OFF);
burstRemaining -= 60;
}
LowPower.powerDown(SLEEP_30MS, ADC_OFF, BOD_OFF);
radio.send(from, "woke", 4);
}