Author Topic: ListenMode and NetworkId  (Read 1606 times)

mielleriealphonse

  • NewMember
  • *
  • Posts: 9
  • Country: fr
ListenMode and NetworkId
« on: November 11, 2017, 04:52:14 AM »
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


Code: [Select]
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);
    }

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: ListenMode and NetworkId
« Reply #1 on: November 13, 2017, 01:25:38 PM »
Since networkID is used as part of the SYNC, I would expect that to filter out in hardware but I need to refresh my memory on how ListenMode bursts work.
Are you setting networkID in any special way?

mielleriealphonse

  • NewMember
  • *
  • Posts: 9
  • Country: fr
Re: ListenMode and NetworkId
« Reply #2 on: November 18, 2017, 02:57:11 PM »
I am setting the NetworkID "radio.initialize". I think it is not a special way.

I finally found a way to chek is the burst is comming from a sender on the same network:

As soon as the reciever is wake up by the sender, i send back a "woke" message to the sender with a request for ACK. If the sender is not on the same network as the reciever, it will not send the ACK. In this case I consider that the sender is not on the same network and the reciever goes to sleep.
If the ACK is recieved it mean that both are on the same network. That works pretty good !!

Jérôme


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: ListenMode and NetworkId
« Reply #3 on: November 18, 2017, 09:22:13 PM »
Well, glad it works for you! :)