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.

CC1310: Problem in setting the transmission time of wmbus, OMS, C1 modes

Part Number: CC1310
Other Parts Discussed in Thread: WMBUS

Hi,team;

Using SDK: wmbus_ cc13x0_ rtos_ 2_ 0_ 0,T1_ C1 routine, change to 10S to send data once, and call wmbus_ apl_ setClock();  during initialization; 

Set the system clock to local time, and start hanging up at 8:00 pm. After 11.30 pm, data will not be sent. By the afternoon of the next day, transmission has not yet been turned on. Excuse me, what's the matter? Where do I need to configure the time to time to periodically send data?

  • Please provide more details regarding what exactly you are doing in your code.

    Are you using any of the code examples that are available with the stack? If yes, which one, and what exactly do you change in these examples.

    Siri

  • Okay, I'll provide it to you later,thank you

  • The following is part of the routine code, only changing the sending time. In addition, a task with the same priority has been established,

    Call "wmbus_apl_getClock()"every 8S,And print through serial port.

    Later tests found that At "loc_meterTask()" in "wmbus_hal_mcu_sleep((E_HAL_MCU_SLEEP_MODE_t) ge_sleepMode)",if Adding printing before and after, when data transmission stops, printing here also stops, as if the task is permanently dormant. The time when the other print task is still working, but the output timestamp has been stopped sending.

    /*! Init start strucutre for meter device */
    s_apl_mtrInitAttr_t gs_meterInitAttr =
    {
    {
    /* Frequency offset for the carrier. */
    CUSTOMER_FREQ_OFFSET,
    /* Device address */
    &gs_addr,
    /* Telegram storage */
    gac_telegramStorage,
    /* Size of the telegram storage */
    MAX_PAYLOAD_LEN
    },
    /* Encryption key */
    gt_key,
    /* Collector address. */
    &gs_collector,
    /* Set the device to connected. Only if the device is a meter device.
    Otherwise this field is ignored. */
    true,
    /* Periodical interval for sending data. Only if the device is a meter
    device. [s] */
    10U
    };
    
    /*----------------------------------------------------------------------------*/
    static void loc_meterTask(UArg arg0, UArg arg1)
    {
    /* Initialises the hal. */
    if(wmbus_hal_init() == E_HAL_STATUS_SUCCESS)
    {
    /* Initialize the sandman module. */
    sf_sandman_init(&loc_stackSleep, &loc_stackWakeUp);
    /* Initialize APL */
    if(E_WMBUS_STATUS_SUCCESS == wmbus_apl_mtr_init(&gs_meterInitAttr))
    {
    /* Set the WMBUS mode. */
    wmbus_setMode(WMBUS_MODE_C1);
    
    /* Set mode 7 as default mode */
    wmbus_apl_mtr_setEncryptionMode(E_WMBUS_ENCRYPTION_MODE_5);
    while(true)
    {
    
    if(gb_stackActive)
    {
    
    sf_mcu_rtc_run();
    /*
    Run the application layer.
    In general, the function wmbus_apl_mtr_run must be called as often as
    possible, since it is responsible to handle all operations of the
    WMBUS Stack.
    */
    wmbus_apl_mtr_run();
    
    /* Handle event */
    wmbus_hal_bsp_handleEvent();
    
    }
    else
    {
    /* It is possible to let the device go to sleep. */
    wmbus_hal_mcu_sleep((E_HAL_MCU_SLEEP_MODE_t) ge_sleepMode);
    } /* if() .. else */
    } /* while */
    }/* if */
    else
    {
    /* Stack initialization failed. Add your error handling here. */
    while(1);
    }
    }/* if */
    else
    {
    /* HAL initialization failed. Add your error handling here. */
    while(1);
    }/* if() .. else */
    }/* loc_meterTask() */

  • the code you have shown me are in the app_aplMeterRtos.c file.

    What build configuration are you using (you are forcing the mode to WMBUS_MODE_C1, but you do not say anything regarding about what predefined symbols you have in your project).

    Also, what are the changes you do to your collector, and what are the build configuration there?

    in addition to these changes, you have created another task, but without the exact knowledge regarding what you are doing in this task I cannot tell why things are not working.

    I strongly recommend that you do changes to the default application one step at the time, and test in-between.

    Start by only changing the sending interval, and see if things are still working.

    If that is OK, you can try to change the wmbus mode, and after you have confirmed that it is working, you can change encryption mode.

    Once you have confirmed that all this is working, you can add another task. 

    Remember that printing takes time, so this might alter the timing of your application. You can try to toggle some pins instead for debug purposes to make sure that your new tasks are running when you think they shall be running.

    Siri

  • Hi team,

    does wmbus have an API that configures the sending time interval, such as when to what time it can be sent, or do I need to manually turn it on and off myself.

  • To set the periodical interval of the meter device, you can use wmbus_apl_mtr_setInterval(uint32_t l_intervalSeconds).

    Details to the synchronous transmission interval can be found in EN13757-4.

    l_intervalSeconds is the Periodical interval in seconds. The interval must be a multiple of 2 seconds. Odd value will be decreased by one second. Maximum value is 86400 (24 hours). Use 0 to stop the synchronous transmission.

    Siri