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.

RTOS/CC1310: 15.4 Stack Sensor_sendMsg fails some times

Part Number: CC1310

Tool/software: TI-RTOS

Hi,

I'm developing an application based on the sensor and coordinator beacon example.

My config:

* APIMAC_GENERIC_ETSI_863_PHY_133 (200 kbps)

* Beacon order: 7 (614 ms interval);

* Superframe order: 7;

* Reporting interval: 100 ms;

* Polling interval: 10 minutes(Is big because I only send 1 byte of information from the coordinator and I send in the beacon payload);

I am reporting with an interval of 100ms and polling with an interval of 10 minutes and some times the Sensor_sendMsg fails a few times(4-6 typically) sequentially. I'm using only one sensor to don't get collisions. Any idea why this happens? In what cases the Sensor_sendMsg return false?


Best regards,

  • Hello Renato,

    Can you tel me what is the Return Code from this API. Usually this problem occurs when sending data to fast to the MAC, the mac's queue will get full and will return with a buffer full error message.

    You can increase the allocated space for this queue/buffer, this can be done by increasing the number of MAC_CFG_TX_MAX in the mac_cfg.c file.

    The other option can be to decrease the reporting interval, and give the MAC more time to process the messages.

    Regards,
    AB
  • The return code is 241 - 0xF1 - ApiMac_attribute_diagTxUnicastFail

    I will try to increase the MAC_CFG_TX_MAX. What value do you recommend?
  • Hi AB,

    I increased the MAC_CFG_TX_MAX to 20 and the MAC_CFG_TX_DATA_MAX to 10, but the sensor still fails some times. Is any way to clean the MAC's queue?

    Best regards,
  • Is any way to clean the MAC's queue?

    Best regards,

  • I change the MAC_CFG_TX_MAX, MAC_CFG_TX_DATA_MAX and the reporting to 200 ms. The sensor doesn't give anymore the error. But I don't understand why the sensor accumulates messages if is the only one in the network, any way to wait until can send the message?

    Message accumulation:

    I want this because the coordinator is waiting for the sensor messages every 200ms, and if some message that takes more than 250ms from the last one, the coordinator give fail to that sensor because of security reasons.

  • Hello Renato,

    Would any of these security issues be fixed using our new secure commissioning?

    I believe that this method would decrease battery life dramatically.

    Try decreasing the superframe interval, maybe this would help a bit.

    Regards,
    AB
  • Hi AB,

    The decreasing of superframe don't help. Accumulates 3 messages and send, all the time. I set the sensor and the coordinator to order 7 and superframe to 6.

    Is possible to stop and start to send beacon packets when I want in the collector side? I know that the sensor will give indicate sync loss.

    Regards,

  • If what you is to only send one message at a time. You can configure this and only let the sensor send one msg at a time.

    Stopping the network will not help you with your problem.

    Regards,

    AB

  • I´m not talking on the sensor side. I´m talking the beacon that the collector send from time to time defined by the beacon order to keep the synchronization. If I set the beacon payload length to 0 he keeps sending the beacons.

         code example:  ApiMac_mlmeSetReqUint8(ApiMac_attribute_beaconPayloadLength, 0).

    I´m asking if is possible to disable the beacon packets and keep the communication only with the sensor packets like in the non-beacon mode and enable again when I want.

    The boards use Helical Wire antennas, using another type of antenna can help?

    Regards.

  • Hello,

    You can potentially increase the BEACON Interval by re starting the network with a new beacon order.

    But I would highly advise against it since this will cause the sensor to loose sync and make them go into orphan mode.

    For what you want beacon mode is not advisable, why do you not use non beacon?

    Another option is to decrease the beacon order to 1, this will make fast enough where the sensor will not stack the messages.

  • I use the beacon mode because I use the beacon payload to change the sensors reporting interval and that way I get a lower consumption on the sensor side.

    Decrease the beacon order to 1 will decrease the battery life.

    I have only one more question, In the sensor code I have the "Beacon Notify Indication callback" to get and know when the collector sends the beacon payload, but in the collector, I don't see any way to know when he sends the payload, Is any way to know that? This could help me because I could check if the sensor was sending some message between the collector beacons messages.

    Best regards.

  • Hello Renato,

    No, there is no way to access this from the application perspective. These callbacks are inside the stack code since they are very time sensitive. However you could potentially know when it will happen by doing the following "hack".

    If you want to know the sequence number of the bacon you can read the attribute “ApiMac_attribute_bsn”. Unfortunately there are no callbacks or events sent back to the application when the beacon has been sent.

    If you really really want to get a callback from the stack when the CAP of the beacon interval is done you can override the periodTimer callback on the global variable “macBeacon” but you will have to make sure you make a copy of the original callback and then call that copy from your callback in the application. Please note that this is a very hacky thing to do.

  • Hi AB,

    I think I did what you said and worked, but I copied the "macDataTxBeaconComplete" instead of the “macBeacon”. Changing the "macBeacon" don't do anything. You are saying something like this?

    My code in the collector.c :

    /*!
     Beacon Callback
    
     */
    static void beaconCB(uint8_t data) {
        macDataTxBeaconCompleteOriginal(data);
    
        /* My code goes here */
    }
    
    /*!
     Sets the beacon callback function
    
     */
    static void setBeaconCallback(void) {
        macDataTxBeaconCompleteOriginal = macDataTxBeaconComplete;
        macDataTxBeaconComplete = beaconCB;
    }
  • looks correct to me.