• AVR Freaks

Hot!Miwi PAN coordinator sends same ACK seq number to two different RFDs

Author
gilo
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2010/08/12 06:04:47
  • Location: 0
  • Status: offline
2019/04/23 02:19:23 (permalink)
0

Miwi PAN coordinator sends same ACK seq number to two different RFDs

Hi,
We are running Miwi v4.1 on a pic18 as a PAN coordinator and pic18f25k22 as RFDs (battery dependent devices) that are communicationg in a star topology. RFDs can be up to 5 devices and a single PAN coordinator. Network is non-beacon enabled. Wireless is working perfectly 99% of the time, but every few hours the coordinator indicates that an RFD is not pinging it (data requesting) anymore.
After few weeks of major effort to nail the scenario i managed to capture it with Zena sniffer. Looking at the sniffing results might give a great clue about the issue.
In the attached file "zena_capture_bad" you can see that sequence number of the ACKs broadcasted from coordinator to both RFDs (MACs: 0xe3dfe2de and 0x935f935e) are the same. In the attached file "zena_capture_good" (in a normal operation) you can see that sequence number of the ACKs from coordinator to both RFDs (MACs: 0xe3dfe2de and 0x935f935e) are different, which i believe should work like that. It looks like some issue in miwi stack. Can please assist me to find the error? 
Thanks,
Gilo

Attached Image(s)

#1

2 Replies Related Threads

    gilo
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2010/08/12 06:04:47
    • Location: 0
    • Status: offline
    Re: Miwi PAN coordinator sends same ACK seq number to two different RFDs 2019/04/24 01:09:10 (permalink)
    0
    I did some research and found that if two different RFDs send MAC_COMMAND_DATA_REQUEST with same seq number, the PAN coordinator rejects at least one of them (does not set the Packet as Valid).
     
    The right code section for that is in the isr:
     
                      for(i = 0; i < ACK_INFO_SIZE; i++)
                      {
                        if( AckInfo.Valid && (AckInfo.Seq == RxPacket[BankIndex].Payload[1]) )
                        {
                          AckInfo.startTick = MiWi_TickGet();
                          break;   
                        }
                        if( (ackInfoIndex == 0xFF) && (AckInfo.Valid == FALSE) )
                        {
                          ackInfoIndex = i;
                        }
                      }
                       
                      if( i >= ACK_INFO_SIZE )
                      {
                        if( ackInfoIndex < ACK_INFO_SIZE )
                        {                 
                          AckInfo[ackInfoIndex].Valid = TRUE;
                          AckInfo[ackInfoIndex].Seq = RxPacket[BankIndex].Payload[1]; 
                          AckInfo[ackInfoIndex].startTick = MiWi_TickGet();
                        }
     
                         
                        RxPacket[BankIndex].flags.bits.Valid = TRUE;
                      }
     
    What i am misunderstanding here is why Packets with same seq number from 2 different RFDs (different addresses) are rejected.
    Is there any patch for that?
     
    Thanks,
    #2
    gilo
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2010/08/12 06:04:47
    • Location: 0
    • Status: offline
    Re: Miwi PAN coordinator sends same ACK seq number to two different RFDs 2019/05/16 04:33:57 (permalink)
    0
    So, i put a randomization function at the application layer of each RFDs.
    Every 5 data requests, each RFD draws a random number (from TMR0L) as a sequence number.
    Now it looks fine.
    Thanks.
    Gil
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5