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.

Can SimpliciTI carry out the fuction I want?

Other Parts Discussed in Thread: SIMPLICITI

 To whom it may concern,

I wanna do an experiment with CC1110 and SimpliciTI. The experiment should achieve such result as below:

There are 1 AP, 2 REs(I call them R1 and R2), 1 ED.

At first R1 is transmitiing the packet while R2 is sleeping. Then, if I turn off R1(in practice, it simulate the stuation of   break down), R2 will be woken up and take on the responsibility of transmitting the data to ED.

At first, My idea is that I make R2 turn into the power mode 2 and wake up every two seconds with sleep timer, and I put the

 Init_SLEEP_TIMER();    SET_POWER_MODE(2);

before while (SMPL_NO_JOIN == SMPL_Init((uint8_t (*)(linkID_t))0)), but it cannot be woken up.

So my question is :

1 Whether the RE must SMPL_Init and Linkto successfully before it turn into the sleeping mode or not?

2 Whether I could only make it sleep before it implement the send() funcition and cannot reinit and relink it to the other node after it wakes up?

3 If the anwser to the question2 is negative, could you tell me how can I make the R2 init the SMPL_Init and linkto() again after it waken up, because I think that the way of just make it  intermittent sleep between then send action cannot save much energy.

4 How to make the R2 would not retransmit the packet if the R1 is still working well since R2 would wake up intermittently to listen the link from ED?

 Thanks very much for your consideration!

There are some codes in my procedure below:

#include "bsp.h"
#include "mrfi.h"
#include "bsp_leds.h"
#include "nwk_types.h"
#include "nwk_api.h"
#include "bsp_buttons.h"
#include "mydefine.h"
#include "string.h"

//YY
#include "stdio.h"
extern uchar display[4];

//YY
extern addr_t       sMyRAMAddress;
extern void initTempSensor(void);
extern INT8 getTemperature(void);
char temperature[10];
void initUARTtest(void);

static void linkTo(void);

//static void processMessage(uint8_t *msg, uint8_t len);
void toggleLED(uint8_t);
const __root uint8_t date[] = __DATE__;
const __root uint8_t time[] = __TIME__;

#define SPIN_ABOUT_A_SECOND   do { uint16_t spin; for (spin=20; spin; --spin) NWK_DELAY(0xFFFF); } while (0)



void Init_SLEEP_TIMER(void)
{
  WORCTL |= 0x00;    //1 period
  WOREVT1=0xFF;      
  WOREVT0=0x4C;
  EA = 1;
  IEN0 |= 0X20;     //

  WORIRQ |= 0X10;   //
}
void main (void)
{
  //YY

  BSP_Init();
  if (BSP_LED1_IS_ON())
  {
    toggleLED(1);
  }
  if(BSP_LED2_IS_ON())
  {
     toggleLED(2);
  }

  //初始化串口
  initUART(19200);
  UARTxISRopen();
  ENABLE_ALL_INTERRUPT();
 
  nixie_light_int();

  //YY
   while(1)
  { //Init_SLEEP_TIMER();
    while (SMPL_NO_JOIN == SMPL_Init((uint8_t (*)(linkID_t))0))
  {
    toggleLED(1);
    SPIN_ABOUT_A_SECOND;
  }


   linkID_t linkID1;
  uint8_t MSGleth = FRAMELENTH;
  while (SMPL_SUCCESS != SMPL_Link(&linkID1))
  {
    toggleLED(1);
    SPIN_ABOUT_A_SECOND;
  }
  uart_state_int();//

    Init_SLEEP_TIMER();
    SET_POWER_MODE(2);

  linkTo();
  //SET_POWER_MODE(2);


  }//
}//


static void linkTo()
{

  //YY

  while (1)
  {
    // send a message every second. this could be emulating a sleep.


         Uart_R.Buf[0] = 0x68;
      Uart_R.Buf[1] = 0xaa;
      Uart_R.Buf[2] = 'B';
      Uart_R.Buf[3] = 'C';
      Uart_R.Buf[4] = 'O';
                memcpy((void *)(Uart_R.Buf+5),&sMyRAMAddress,4);
             Uart_S = RXOVER;     
      
    if((Uart_S == RXOVER)||(Uart_S == TIMEROVER))
    {
      uart_state_int();
     if (SMPL_SUCCESS == SMPL_Send(linkID1, Uart_R.Buf, sizeof(Uart_R.Buf)))
      {
       
    toggleLED(2);

      }
    }
    if(SMPL_SUCCESS == SMPL_Receive(linkID1,AF_Data.RxBuf,&MSGleth))
    {
     //toggleLED(1);
     //processMessage(AF_Data.RxBuf,MSGleth);
    }
  }
}

void toggleLED(uint8_t which)
{
  if (1 == which)
  {
    BSP_TOGGLE_LED1();
  }
  else if ((2 == which) || (4 == which))
  {
    BSP_TOGGLE_LED2();
  }
  return;
}


#pragma vector = ST_VECTOR
 __interrupt void ST_ISR(void)
 {
  IRCON &=  ~0x80;
        WORIRQ &= ~0X01;
 }

 

  • Hi Chad,

    Unfortunately, the Range Extenders cannot sleep.  They are always active.  They don't technically connect to anything either, but they can coexist with an End Device.

    From the SimpliciTI Developers Notes

    6.2.3. Range Extender

    The Range Extenders are intended to extend the radio range on a network. These are always-on

    devices. The main function is to repeat frames effectively extending the sphere of influence of

    the frame sender. Currently networks are limited to 4 Range Extenders.

    Although not seen as a common use, Range Extenders may coexist with End Devices on the

    same hardware platform. They can host peer applications that realize sensors or actuators, or

    both on the network.  Range Extenders run in promiscuous mode will receive all packets within range.

     

    A suggestion though is that you can make the devices all End Devices and possibly relay the messages that way.

     

  • Hello,

    Thanks for your consideration. But I still two questions bothering myself:

    1 You mean that the RE must be active and I can replace the RE with the ED if I want to achieve the reslut I referred to above. But now that the souce code of RE and ED both include the same function SMPL_Init, why does the RE cannot sleep like the ED?i.e.  Why the ED can sleep by implementing the function SET_POWER_MODE(2)  after  the SMPL_Init and wake up with the sleep timer? Doesn't the ED also be restricted by the SMPL_Init ?

    2It seems that the CCA and Sleep mechanism has been carried out in the MRFI_Transmit,but I want the one of the REs wake up every five seconds to listen the frame from the ED and it will not transmit while the other RE is in proper work. Could I achieve the result by adding  the codes about CCA and Sleep in the SMPL_Init  block or after it?

    3According to your advice, should I realize my idea in the SMPL_Receive and SMPL_Send,i.e. make the ED receive the frame from the other ED and retransimt it to the AP? Wouldn't it be transmit back to the ED where it comes from again?

    uint8_t MRFI_Transmit(mrfiPacket_t * pPacket)
    {
      uint8_t ccaRetries;
      uint8_t returnValue;

      /* configure DMA channel for transmit */
      {
        uint8_t XDATA * pCfg;

        pCfg = MRFI_DMA_CFG_ADDRESS;
        *pCfg++ = /* offset 0 : */  HIGH_BYTE_OF_WORD( &(pPacket->frame[0]) );  /* SRCADDRH */
        *pCfg++ = /* offset 1 : */  LOW_BYTE_OF_WORD ( &(pPacket->frame[0]) );  /* SRCADDRL */
        *pCfg++ = /* offset 2 : */  HIGH_BYTE_OF_WORD( &X_RFD );  /* DSTADDRH */
        *pCfg++ = /* offset 3 : */  LOW_BYTE_OF_WORD ( &X_RFD );  /* DSTADDRL */
        *pCfg++ = /* offset 4 : */  RXTX_DMA_VLEN_XFER_BYTES_PLUS_1;
        *pCfg++ = /* offset 5 : */  RXTX_DMA_LEN;
        *pCfg++ = /* offset 6 : */  RXTX_DMA_WORDSIZE | RXTX_DMA_TMODE | RXTX_DMA_TRIG;
        *pCfg   = /* offset 7 : */  RXTX_DMA_SRCINC_PLUS_1 | RXTX_DMA_DESTINC_NONE | RXTX_DMA_IRQMASK | RXTX_DMA_M8 | RXTX_DMA_PRIORITY;
      }

      /* set number of CCA retries */
      ccaRetries = MRFI_CCA_RETRIES;


      /* ===============================================================================
       *    Main Loop
       *  =============
       */
      for (;;)
      {
        /* CCA delay */
        MRFI_DELAY(2000);

        RFIM &= ~IM_DONE;

        // LAF WORKAROUND: Go to IDLE to kill ongoing Rx. This means that CCA test below will
        // not do anything but I will leave the skeleton code until it is fixed properly.
        RFST = SIDLE;

        MRFI_DELAY(20);  // very conservative settling...
        DMAARM = ABORT | BV( MRFI_DMA_CHAN );
        DMAARM |= BV( MRFI_DMA_CHAN );
        RFST = STX;
        MRFI_DELAY(20);  // very conservative settling...
        if (MARCSTATE != RX)  // check for !Rx instead of RXTX_SWITCH
        {
          /* ------------------------------------------------------------------
           *    Clear Channel Assessment passed.
           *   ----------------------------------
           */
          RFIF &= ~IRQ_DONE;
          while (!(RFIF & IRQ_DONE));

          /* set return value for successful transmit and break */
          returnValue = MRFI_TRANSMIT_SUCCESS;
          break;

        }

        /* ------------------------------------------------------------------
         *    Clear Channel Assessment failed.
         *   ----------------------------------
         */

        /* if no CCA retries are left, transmit failed so abort */
        if (ccaRetries == 0)
        {
          /* set return value for failed transmit and break */
          returnValue = MRFI_TRANSMIT_CCA_FAILED;
          break;
        }

        /* decrement CCA retries before loop continues */
        ccaRetries--;
      }
      /*
       * =============================================================================== */

      MRFI_RxEnable();

      return( returnValue );
    }

    Thanks again! I really appreciate your help.

  • Hi.

    Do not have much experience with the RE in SimpliciTI, but a RE that is sleeping is not much of a range extender. However, i do not think there is anything within SimpliciTI that technically stops your from putting a range extender to sleep. Not quite sure what you need in this case though. You mention that R2 will wake up if R1 breaks down, but there is no method for R2 to know that R1 broke down. If you actually practically need the RE between the AP and ED to extend the range, having em both on would not hurt. A small system like this will not suffer much from having two REs active at all times. Simple implementation with sequence number in the packets can make the AP and ED know if they already received a message like this.

    Otherwise I would have explored the solution pointed out by Protagonist, replace the REs with relaying EDs which would imply that you have to paths in your system.

    Not sure if i understand your CCA related questions. CCA is a means to check if the radio channel is clear before trying to transmit to handle larger networks with a lot of traffic. It listens for activity and waits with the transmission until channel is clear. There is no sleep mechanism within MRFI_Transmit, it's a transmit function using CCA with random backoff between retires.

    Also, please upgrade to the latest version v1.1.0 that can be found here:
    http://www.ti.com/simpliciTI

    Hopefully this made things at least a little clearer and good luck with the development.

    Regards,
    Kjetil

  • Hi,guys,

    Thank you very much for your help. I am sorry that I didn't express my means clearly. It is really a simple experiment  for I only have eight module for the time being. My derictor wish me to realize the self-organization capabily with these modules. So I want to implement my idea with four of them, i.e, the ED can choose a new path to another RE when the RE it connected before have a screw loose, which I think should be the first basic step for a self-organizing network. 

    It seems that the SimpliciTI have not mechanism of self-organization, so I want to do some change in it.

    Anyway, I will look through the newest version of SimpiciTI referred to above and conceive some methods. If you have some advice about the design for self-organization capability, please let me know. I can't say thank you too much!