找回密码
 立即注册

微信扫码登录

查看: 113|回复: 5

关于sampleSensor 休眠状态下的zcl poll checkin

[复制链接]

2

主题

2

回帖

28

积分

英勇黄铜

积分
28
发表于 2026-8-9 21:35:27 | 显示全部楼层 |阅读模式 来自 中国
information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: TLSR8258
SDK及版本: telink_zigbee_sdk-3.7.2.0
你好,

我在跑TLSR8258的sampleContactSensor例程,在sampleSensor_zclCheckInStart中我把绑定的判断去掉,直接向sampleGW发pollCtrl_checkIn, 然后sampleGW回复continue in normal operation,不修改poll rate。我发现一段时间后终端sampleContactSensor不再发出zcl poll checkin,也收不到网关发过来的zcl poll checkin RSP。但MAC层的data request还在发。请问这是为什么?

void sampleSensor_zclCheckInStart(void)
{
       
  //  if (!zb_bindingTblSearched(ZCL_CLUSTER_GEN_POLL_CONTROL, SAMPLE_SENSOR_ENDPOINT)) {
           
        zcl_pollCtrlAttr_t *pPollCtrlAttr = zcl_pollCtrlAttrGet();

        if (!zclCheckInTimerEvt) {
                printf("!zclCheckInTimerEvt\r\n");
            zclCheckInTimerEvt = TL_ZB_TIMER_SCHEDULE(sampleSensor_zclCheckInTimerCb, NULL, pPollCtrlAttr->chkInInterval * POLL_RATE_QUARTERSECONDS);

            if (pPollCtrlAttr->chkInInterval) {
                    printf("pPollCtrlAttr->chkInInterval\r\n");
                sampleSensor_zclCheckInCmdSend();
            }
        }
   // }
}



void sampleSensor_zclCheckInCmdSend(void)
{
    epInfo_t dstEpInfo;
    TL_SETSTRUCTCONTENT(dstEpInfo, 0);
    dstEpInfo.dstAddrMode = APS_SHORT_DSTADDR_WITHEP;
    dstEpInfo.dstEp = SAMPLE_SENSOR_ENDPOINT;
    dstEpInfo.dstAddr.shortAddr = 0x0000;
    dstEpInfo.profileId = HA_PROFILE_ID;
    printf("sampleSensor_zclCheckInCmdSend\r\n");
    zcl_pollCtrl_checkInCmd(SAMPLE_SENSOR_ENDPOINT, &dstEpInfo, TRUE);
}


screenshot-1786281259075.png

27

主题

361

回帖

1147

积分

版主

积分
1147
发表于 2026-8-10 11:28:51 | 显示全部楼层 来自 江苏
本帖最后由 TL_YB 于 2026-8-10 11:32 编辑

可以在定时任务回调sampleSensor_zclCheckInTimerCb()中加log确认定时任务是否正常,是否进了return -1定时任务被终止了。

2

主题

2

回帖

28

积分

英勇黄铜

积分
28
 楼主| 发表于 2026-8-10 21:35:36 | 显示全部楼层 来自 中国
你好,我增加了此LOG,同时把drv_pm_lowPowerEnter中的sleeptime也打印出来了。
s32 sampleSensor_zclCheckInTimerCb(void *arg)
{
    printf("sampleSensor_zclCheckInTimerCb\r\n");
    zcl_pollCtrlAttr_t *pPollCtrlAttr = zcl_pollCtrlAttrGet();
    if (!pPollCtrlAttr->chkInInterval) {
            printf("!pPollCtrlAttr->chkInInterval\r\n");
        zclCheckInTimerEvt = NULL;
        return -1;
    }
    sampleSensor_zclCheckInCmdSend();
    return 0;
}
如下,发现是一段时间后,只有sampleSensor_zclCheckInCmdSend(),但没有收到网关发过来的ZCL_CMD_CHK_IN_RSP。抓包那边看从异常位置起,没有看到在ZCL层有从终端发出的zclCheckInCmdSend消息,但从终端下面的串口LOG看是有执行sampleSensor_zclCheckInTimerCb和sampleSensor_zclCheckInCmdSend的, 就很奇怪,此时异常发生后终端收不到网关应用层发过来的任何消息,我试过从网关发读,写命令过来给终端,终端都没有反应。请帮忙看看。
Retention:0
user_init
after bdb_init
BDB_INIT_STATUS_SUCCESS
sampleSensor_zclCheckInStart
sampleSensor_zclCheckInCmdSend
BDB_INI sampleSensor_zclCheckInStart
sleeptime:191
Retention:1
user_init
in user_init recovery from deep sleep with retention
sleeptime:283
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:181
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:272
Retention:1
user_init
in user_init recovery from deep sleep with retention
sleeptime:487
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:478
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclChec隝ntimerCb
sampleSensor_zclCheckInCdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:478
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:480
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:477
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:478
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimer鑒
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:478
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:479
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:477
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckI踮merCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:480
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:477
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:478
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimer鑒
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:478
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:476
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimer鑒
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:478
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:467
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:477
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:479
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:477
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:478
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimer鑒
sampleSensor_zclCheckInCmdSend
sampleSensor_pollCtrlCb
ZCL_CMD_CHK_IN_RSP
continue in normal operation
sleeptime:479
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:171
Retention:1
user_init
in user_init recovery from deep sleep with retention
sleeptime:243
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:244
Retention:1
user_init
in user_init recovery from deep sleep with retention
sleeptime:245
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:500
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:492
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:500
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:492
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:500
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:492
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:499
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:493
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:498
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:494
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:497
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:495
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:496
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:496
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:495
Retention:1
user_init
in user_init recovery from deep sleep with retention
sampleSensor_zclCheckIntimerCb
sampleSensor_zclCheckInCmdSend
sleeptime:498

27

主题

361

回帖

1147

积分

版主

积分
1147
发表于 2026-8-11 11:18:27 | 显示全部楼层 来自 上海
从log上看定时任务是没问题的,那么很有可能是发送消息失败了,比如发送队列push失败、内存申请失败等等。。。
我的建议是,
1、获取zcl_pollCtrl_checkInCmd()的返回值,判断是不是在tx push阶段就失败了
2、使用sdk demo做最小的应用修改,先做功能验证

2

主题

2

回帖

28

积分

英勇黄铜

积分
28
 楼主| 发表于 2026-8-11 22:37:04 | 显示全部楼层 来自 中国
感谢,问题解决了,前面改太多了。退回去使用sdk demo做最小的应用修改,功能验证OK。

27

主题

361

回帖

1147

积分

版主

积分
1147
发表于 2026-8-12 11:41:50 | 显示全部楼层 来自 上海
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2026-8-21 07:39 , Processed in 0.098100 second(s), 27 queries .

Powered by Discuz! X3.5

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表