This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TIMAC --- Coordinator Gets Stuck with "Pending Addresses"

Other Parts Discussed in Thread: TIMAC, CC2530EM

I am using TIMAC with the example code.  If multiple devices attempt to join the network at the same time, the coordinator occasionally gets in a state where it doesn't let anyone in.  It acknowledges the association request(s), then the device(s) sends the data request for the short address, but the coordinator does not respond.  The is happening with multiple devices that are all doing this at approximately the same time.

This is a fairly easy issue to discover.  Make a star configuration, then reset the coordinator.  Assuming the devices are setup to automatically rescan + rejoin, this issue will happen over and over.  I don't know where in TIMAC the "pending addresses" is done.  If I can find it, I could try to force the coordinator to clear this beacon field ofor pending addresses or even write some code to ignore one device until the other is done with the association process.

I have the pib value of autoRequest set to false in case this helps with the mystery.   I am also using the CC2530EM.

Thanks,

Kevin

  • Kevin:

    The default sample applications is not setup to handle coordinator replacement or failure (Power)
    I am assuming this is what your are trying to test for.

    Are you ensuring a proper reset of the MAC and the pib?

    How many devices in your network?

    LPRF Rocks the world  

  • Right now I only have 6 nodes in the PAN because that is all I have for available hardware, but the cluster tree I am developing on top of TIMAC will allow the full 65k nodes.  I don't follow your comment about reset.  I may not have explained the situation well...I will give a step by step to show what I am doing and what is happening (occasionally).

    1) Pan Coord online and active in beacon mode.

    2) 4 devices are turned on and request association at approximately the same time (time difference dependant on how well I can push all the buttons at the same time...)

    3) Association request goes out from 4 devices.

    4) ACK sent back from PAN Coord to all devices.

    5) Data request sent from the 4 devices.

    6) No response, and the long addresses of the devices are listed in the beacon under pending addresses.

    7) Steps 3-6 loop.

    8) If I turn off all the devices and try just 1 device (which gets a new long address from reading an ADC channel), it completes association.

    9) At this point how do I get the PAN Coord to drop the pending addresses in the beacon?  Resetting is not an option.  The addresses must be stored somewhere....hopefully not at theTIMAC library level.

    Thanks again.

  • Hello, my name is Sergio

    I´m working using TIMAC 1.3.0 plus CC2530 and I´ve tried to, once the network is stablished, exchange the role of PAN Coordinator betwen a End Device and the original coordinator. So the scenario would be what follows:

    - Push S2 button at End Device and send message to the coordinator

    - Coordinator receives this message so is stops transmitting beacons and tries to synchronize

    - End Device Scan Channel and Start as a Coordinator

    - The old coordinator synchronizes with the new one

    This is what I want to do, but what I´ve tried doesn´t work .

    Could you give me some ideas?

    My mail, if someone interested: sergio_ab_84@hotmail.com

     

     

    Thank you so much in advance!

  • Your input was a great help TI.

     

    Set teh PIB transactionPersistenceTime to a lower value, by default it is 245, meaning the coordinator will "carry" pending addresses in the beacon for 245 beacons.

  • Thanks for your response.

     I succeeded stopping transmitting beacons at the coordinator by setting the PIB transactionPersistenceTime to a lower value and setting stopreq.beaconOrder = 15  MAC_MlmeStartReq(&stopreq);

    After this, the End Device that requested the Coordinator to stop beaconing, scans the channels and, if no beacons are detected, it becomes the new PAN Coordinator. So, the thing is that at this point of time, there are 2 coordinators stablished at the same channel, wich is not good. How could I proceed for stablishing the old coordinator as a End Device associated to the new Coordinator? How could I update the associated devices addresses table of the new coordinator with the rest of end devices addresses that were associated to the old coordinator?

    I would really appreciate any help because I´ve to finish this project in less than a week. Thaks for everything.

  • This is really driving me crazy :-s

    This is a summary about what I´ve done and results.

    1) Stop beaconing the first PAN Coordinator. OK

    2) The End Device wich requested the Coordinator to Stop Beaconing,  scans the channel and after this become the new PAN Coordinator. OK

    3) The other Devices in the Network lose the synchronization for a while until the new Coordinator is set. They Associate to this new PAN Coordinator. OK

    4) The old PAN  Coordinator scans the channel but then starts in an infinite loop loosing sync and trying to resync. How could it be possible? If I turn the device off and on again then it associates perfectly!!!

    Please Help!!!

    Thank you so much!!!

     

  • Interesting problem and application.  Swapping the function of a device and coordinator, cool.  For association tables, the only way I can think of to pass this information is to do one of 2 things.  Either have the old coordinator pass the information with data packets to the device that is about to become the new coordinator...or...have the new coordinator issue a command that forces everyone to say "hello" so the table can be created.  Does your new coordinator have the same short address as the old coordinator?

    it really depends on how you are doing your association tables.  I ended up doing something different than the example code with TIMAC so I may not be much help with that one.

    For getting the old coodinator to sync up as a device, the quick and dirty way to do this is to use the command, MAC_MlmeResetReq (TRUE).  This, along with any variables you might have, will reset the RF portion of the SoC.  This command is talked about in the TIMAC manual.  If this doesn't do it, throw in these commands too.  I am sure they will work, because I called them when I reset the RF portion of the SoC.    MAC_InitDevice();     MAC_InitCoord();     MAC_InitBeaconDevice();  MAC_InitBeaconCoord();

    Just curious....when you resync to the new coordinator, do you have to do it within 4 beacons so the MAC_MLME_SYNC_LOSS_IND isn't called?

  • Thanks for answering Kevin

    What I do for resync is very simple. After the old coordinator stops beaconing, all the devices get the MAC_MLME_SYNC_LOSS_IND. This is the code for solving

         case MAC_MLME_SYNC_LOSS_IND: 
                                  
                   if (change_coord==1){    //  This variable is set to 1 when a device request to become the new Coordinator. By this way, when it looses synchronization, this will be the device that will scan the channel for becoming Coord 

                      change_coord=0;
                      HalLcdWriteString ( "Scanning Channel...", HAL_LCD_LINE_3); 
                      MAC_MlmeSetReq(MAC_ASSOCIATED_PAN_COORD,FALSE); //No esta asociado a la PAN
                      msa_IsStarted=FALSE;
                     
                     
                      MSA_ScanReq(MAC_SCAN_PASSIVE, msa_BeaconOrder);  //Scans the channel for becoming the new Coordinator
                    
                   }
                  
                   else   // All the other devices will be trying to resync until the new Coordinator is Set
                   {
                      MSA_SyncReq();
                      MSA_AssociateReq(); // In order to create the association table
                   }

    On the other hand I´ve tried to do what you sugest for starting the old Coordinator as a Device, but it doesn´t work. I´m sure I´m missing something. This is the code that I´ve used.

     

          MAC_InitDevice();
          MAC_InitCoord();

          MAC_InitBeaconDevice();
          MAC_InitBeaconCoord();
         
          MAC_MlmeResetReq(TRUE);

      //********

    MAC_MlmeSetReq instances for setting BO,SO,Channel...

    **********

          MSA_ScanReq(MAC_SCAN_PASSIVE, MSA_MAC_BEACON_ORDER + 1)

    As I said before, this code doesn´t work, I don´t receive any MAC_MLME_SCAN_CNF...

     

    Any idea about what´s going on? I don´t know what to do!!!!

  • When a device in my network loses 4 consecutive beacons from the coordinator, MAC_MLME_SYNC_LOSS_IND is called.  From that case statement I call MSA_Init(), which reinitializes the RF registers.

    MAC_InitDevice();    

    MAC_InitCoord();    

    MAC_InitBeaconDevice();
    MAC_InitBeaconCoord();

    MAC_MlmeResetReq(TRUE);

     msa_BeaconOrder = ....

    msa_SuperFrameOrder = ...

    MSA_ScanReq(MAC_SCAN_PASSIVE, MSA_MAC_BEACON_ORDER + 1); 

     

    Are you doing it in the same order...if so it should work.  Make sure you do not start a scan until after everything else is done.  You shouldn't have to change any PIB values, I think the reset + inits will load the default PIBs.  Do getting the node to join the network you just have to retrace your steps on how it is done in the first place.  For me, it means calling MSA_Init().  If you are still stuck, feel free to post the source code and I will take a look later today.