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: wmbus,OMS,C1模式发送时间设置问题

Part Number: CC1310
Other Parts Discussed in Thread: WMBUS

使用SDK:wmbus_cc13x0_rtos_2_0_0,T1_C1例程,改成10S发一次数据,初始化时调用wmbus_apl_setClock();设置系统时钟为本地时间,晚上8.多开始挂机,晚上11.30后就不发送数据了,到第二天下午也还没开启发送。请问这是怎么回事,需要在哪里配置几点到几点能周期性发送数据吗?

  • 您好,

    感谢您对TI产品的关注!为更加有效地解决您的问题,我需要多一些时间查看这个问题,稍后会为您解答

  • 请提供更多关于您在代码中到底在做什么的详细信息。

    您是否使用了堆栈中可用的任何代码示例?如果是,在这些例子中,你到底改变了哪一个,以及具体改变了什么。

  • 下面是部分例程代码,只改了发送时间。另外还建立了一个相同优先级的任务,每8S调用wmbus_apl_getClock(),并通过串口打印。后面测试发现,在

    loc_meterTask()里面的 wmbus_hal_mcu_sleep((E_HAL_MCU_SLEEP_MODE_t) ge_sleepMode);前后加上打印,当数据停止发送的时候,此处的打印也停止了,像是任务永久休眠了。另一个打印任务还在工作,但是输出的时间戳一直停止发送时的时间。

    /*! 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() */

  • 为更加有效地解决您的问题,我需要多一些时间查看这个问题,稍后会为您解答

  • 你给我看的代码在app_aplMeterTos.c文件中。

    您使用的构建配置是什么(您将模式强制为WMBUS_mode_C1,但您没有说明项目中的预定义符号)。

    此外,您对收集器做了哪些更改,其中的构建配置是什么?

    除了这些变化,你还创建了另一个任务,但如果不知道你在这个任务中做了什么,我就无法解释为什么事情不起作用。

    我强烈建议您一步一步地更改默认应用程序,并在其间进行测试。

    从只更改发送间隔开始,看看事情是否仍在进行。

    如果可以,您可以尝试更改wmbus模式,在确认其工作后,您可以更改加密模式。

    一旦您确认所有这些都在工作,您就可以添加另一个任务。

    请记住,打印需要时间,因此这可能会改变应用程序的时间安排。您可以尝试切换一些引脚来进行调试,以确保您的新任务在您认为应该运行时正在运行。

  • 你好,wmbus有配置发送时间区间的API吗,比如几点到几点可以发送,还是需要我自己手动开启关闭的吗。

  • 我将继续跟进您的问题,需要花费一些时间,谢谢。

  • 要设置仪表设备的周期性间隔,可以使用wmbus_apl_mtr_setInterval(uint32_t l_intervalSeconds).

    同步传输间隔的细节可以在EN13757-4中找到。

    https://www.ti.com.cn/cn/lit/ml/swra423/swra423.pdf?ts=1680156033397&ref_url=https%253A%252F%252Fwww.ti.com.cn%252Fsitesearch%252Fzh-cn%252Fdocs%252Funiversalsearch.tsp%253FlangPref%253Dzh-CN%2526searchTerm%253DEN13757-4%2526nr%253D50

    希望这个可以帮助到您

    l_intervalSeconds是以秒为单位的周期性间隔。间隔必须是2秒的倍数。奇数值将减少一秒钟。最大值为86400(24小时)。使用0停止同步传输。