T3低功耗保活gpio唤醒后高功耗

Wi-Fi 设备、Wi-Fi 低功耗设备、Wi-Fi BLE 双模设备、Ethernet设备、Ethernet+Wi-Fi设备等
leslieli
Posts: 134

T3低功耗保活gpio唤醒后会有20s左右的高功耗后再进lowvoltage 是怎么回事

chaser
Posts: 75

Re: T3低功耗保活gpio唤醒后高功耗

gpio唤醒.png

保活功耗下,gpio唤醒正常,功耗正常。下面是我写的代码:

code.png

注意:

  1. T3 保活低功耗当前默认 dtim10, wifi 中断唤醒, 也就是连上路由后唤醒周期为 1s
  2. 当未连接上路由时候, 切换为 rtc 唤醒,rtc 周期设置为 1s, 唤醒周期为 1s
chaser
Posts: 75

Re: T3低功耗保活gpio唤醒后高功耗

麻烦把使用gpio唤醒逻辑简单描述下,同时把功耗测试数据提供下,我们可以针对分析下。

leslieli
Posts: 134

Re: T3低功耗保活gpio唤醒后高功耗

chaser 2024年 Nov 6日 20:56

麻烦把使用gpio唤醒逻辑简单描述下,同时把功耗测试数据提供下,我们可以针对分析下。

gpio.png

我把唤醒加入gpio_irq_init 了

key init0.png

这个是初始化

keyevent.png

这个是线程

key isr.png

这个是中断回调

正常休眠.png

这是正常dtim10的功耗

开始高功耗.png

案件后开始高功耗

高功耗.png

正常功耗和高功耗对比

leslieli
Posts: 134

Re: T3低功耗保活gpio唤醒后高功耗

chaser 2024年 Nov 6日 20:56

麻烦把使用gpio唤醒逻辑简单描述下,同时把功耗测试数据提供下,我们可以针对分析下。

我补充一下 就是 上面的例程 我把中断回调放空 不进行任何处理依旧会有这个问题

leslieli
Posts: 134

Re: T3低功耗保活gpio唤醒后高功耗

leslieli 2024年 Nov 7日 11:26
chaser 2024年 Nov 6日 20:56

麻烦把使用gpio唤醒逻辑简单描述下,同时把功耗测试数据提供下,我们可以针对分析下。

我补充一下 就是 上面的例程 我把中断回调放空 不进行任何处理依旧会有这个问题

日志是看到 应该是从stop send reply net_begin_send_arp_reply开始一直搞然后send reply net_begin_send_arp_reply 后 功耗下去的

chaser
Posts: 75

Re: T3低功耗保活gpio唤醒后高功耗

完整日志发出来看下, 指明异常时间点

leslieli
Posts: 134

Re: T3低功耗保活gpio唤醒后高功耗

chaser 2024年 Nov 7日 14:52

完整日志发出来看下, 指明异常时间点

[14:57:58.962]收←◆key_cb
[14:57:59.135]收←◆[11-07 14:58:00 ty D][78a][user.c:152] key1 process normal key
[11-07 14:58:00 ty E][78a][user.c:2102] tkl_adc_init success
tkl_adc_to_pin_func adc:1,25
buff[0]:840mv

[14:57:59.323]收←◆[11-07 14:58:00 ty E][78a][user.c:2111] tkl_adc_read_voltage success
[11-07 14:58:00 ty E][78a][user.c:2120] tkl_adc_deinit success
[11-07 14:58:00 ty E][78a][user.c:2128] volt_average=0
[11-07 14:58:00 ty E][78a][user.c:2137] multiplier=4.000000,flow_volt=3360.000000,battery_val=3360
[11-07 14:58:00 ty D][78a][tuya_dp.c:65] report_bit:1082130433,max_num_dp0
[11-07 14:58:00 ty D][78a][smart_frame.c:4347] rept chan:1
[11-07 14:58:00 ty D][78a][smart_frame.c:428] dp<1> check. need_update:1 pv_stat:3 trig_t:0 dp_rept_type:0 force_send:1 prop_tp:0
[11-07 14:58:00 ty D][78a][smart_frame.c:434] dp_cntl bool:0, dp_data bool:1
[11-07 14:58:00 ty D][78a][smart_frame.c:582] is_need_update:1, is_dp_passive:0, pv_stat:2, uling_cnt:0
stop send reply net_begin_send_arp_reply
[11-07 14:58:00 ty D][78a][smart_frame.c:428] dp<111> check. need_update:1 pv_stat:3 trig_t:1 dp_rept_type:0 force_send:1 prop_tp:3
[11-07 14:58:00 ty D][78a][smart_frame.c:582] is_need_update:1, is_dp_passive:0, pv_stat:2, uling_cnt:0
[11-07 14:58:00 ty D][78a][smart_frame.c:2787] dp rept_type:0, data:{"1":true,"111":"high"}
[11-07 14:58:00 ty D][78a][mqc_app.c:800] Send MQTT Msg.P:4 N:30325 Q:1 Data:{"dps":{"1":true,"111":"high"}}
[11-07 14:58:00 ty T][78a][com_protocol.c:885] Data To MQTT AND V=2.3
[11-07 14:58:00 ty D][78a][tuya_svc_mqtt_client.c:423] packet id: 17
[11-07 14:58:00 ty D][78a][smart_frame.c:4347] rept chan:1
[11-07 14:58:00 ty D][78a][smart_frame.c:582] is_need_update:1, is_dp_passive:0, pv_stat:2, uling_cnt:0
[11-07 14:58:00 ty D][78a][smart_frame.c:905] Send dp:101, RAW:{"101":"AAfoCwcOOgAAAQ=="}, retrans:1
[11-07 14:58:00 ty D][78a][smart_frame.c:2787] dp rept_type:1, data:{"101":"AAfoCwcOOgAAAQ=="}
[11-07 14:58:00 ty D][78a][mqc_app.c:800] Send MQTT Msg.P:4 N:30326 Q:1 Data:{"dps":{"101":"AAfoCwcOOgAAAQ=="}}
[11-07 14:58:00 ty T][78a][com_protocol.c:885] Data To MQTT AND V=2.3
[11-07 14:58:00 ty D][78a][tuya_svc_mqtt_client.c:423] packet id: 18
[11-07 14:58:00 ty T][639][smart_frame.c:2315] mqtt async dp cb 0
[11-07 14:58:00 ty D][639][smart_frame.c:2328] msg_data:{"dps":{"1":true,"111":"high"}}, mqtt async dp
[14:57:59.426]收←◆ cb:0
[11-07 14:58:00 ty T][639][smart_frame.c:3288] DP ID 1 Set To 3
[11-07 14:58:00 ty D][639][smart_frame.c:224] set short dp rate rule, dpID:1, curr_t:1730962680, rept_cnt:1.
[11-07 14:58:00 ty D][639][smart_frame.c:232] set long dp rate rule, dpID:1, curr_t:1730962680, rept_cnt:0.
[11-07 14:58:00 ty D][639][smart_frame.c:241] set all dp rate rule, dpID:1, curr_t:1730962680, rept_cnt:0.
[11-07 14:58:00 ty T][639][smart_frame.c:3288] DP ID 111 Set To 3
[11-07 14:58:00 ty D][639][smart_frame.c:224] set short dp rate rule, dpID:111, curr_t:1730962680, rept_cnt:1.
[11-07 14:58:00 ty D][639][smart_frame.c:232] set long dp rate rule, dpID:111, curr_t:1730962680, rept_cnt:0.
[11-07 14:58:00 ty D][639][smart_frame.c:241] set all dp rate rule, dpID:111, curr_t:1730962680, rept_cnt:0.
tcp_increase_rx_win_cnt 1
force cleared 1
[11-07 14:58:00 ty T][78a][smart_frame.c:3288] DP ID 101 Set To 3

[14:57:59.528]收←◆[11-07 14:58:00 ty D][78a][smart_frame.c:224] set short dp rate rule, dpID:101, curr_t:1730962680, rept_cnt:1.
[11-07 14:58:00 ty D][78a][smart_frame.c:232] set long dp rate rule, dpID:101, curr_t:1730962680, rept_cnt:0.
[11-07 14:58:00 ty D][78a][smart_frame.c:241] set all dp rate rule, dpID:101, curr_t:1730962680, rept_cnt:0.

[14:58:04.342]收←◆[11-07 14:58:05 ty D][746][tuya_devos_health.c:71] feed watchdog

[14:58:14.378]收←◆[11-07 14:58:15 ty D][746][tuya_devos_health.c:71] feed watchdog

[14:58:19.811]收←◆send reply net_begin_send_arp_reply

从key_cb 开始 到reply 结束 是一个唤醒后高功耗的日志

leslieli
Posts: 134

Re: T3低功耗保活gpio唤醒后高功耗

leslieli 2024年 Nov 7日 14:59
chaser 2024年 Nov 7日 14:52

完整日志发出来看下, 指明异常时间点

[14:57:58.962]收←◆key_cb
[14:57:59.135]收←◆[11-07 14:58:00 ty D][78a][user.c:152] key1 process normal key
[11-07 14:58:00 ty E][78a][user.c:2102] tkl_adc_init success
tkl_adc_to_pin_func adc:1,25
buff[0]:840mv

[14:57:59.323]收←◆[11-07 14:58:00 ty E][78a][user.c:2111] tkl_adc_read_voltage success
[11-07 14:58:00 ty E][78a][user.c:2120] tkl_adc_deinit success
[11-07 14:58:00 ty E][78a][user.c:2128] volt_average=0
[11-07 14:58:00 ty E][78a][user.c:2137] multiplier=4.000000,flow_volt=3360.000000,battery_val=3360
[11-07 14:58:00 ty D][78a][tuya_dp.c:65] report_bit:1082130433,max_num_dp0
[11-07 14:58:00 ty D][78a][smart_frame.c:4347] rept chan:1
[11-07 14:58:00 ty D][78a][smart_frame.c:428] dp<1> check. need_update:1 pv_stat:3 trig_t:0 dp_rept_type:0 force_send:1 prop_tp:0
[11-07 14:58:00 ty D][78a][smart_frame.c:434] dp_cntl bool:0, dp_data bool:1
[11-07 14:58:00 ty D][78a][smart_frame.c:582] is_need_update:1, is_dp_passive:0, pv_stat:2, uling_cnt:0
stop send reply net_begin_send_arp_reply
[11-07 14:58:00 ty D][78a][smart_frame.c:428] dp<111> check. need_update:1 pv_stat:3 trig_t:1 dp_rept_type:0 force_send:1 prop_tp:3
[11-07 14:58:00 ty D][78a][smart_frame.c:582] is_need_update:1, is_dp_passive:0, pv_stat:2, uling_cnt:0
[11-07 14:58:00 ty D][78a][smart_frame.c:2787] dp rept_type:0, data:{"1":true,"111":"high"}
[11-07 14:58:00 ty D][78a][mqc_app.c:800] Send MQTT Msg.P:4 N:30325 Q:1 Data:{"dps":{"1":true,"111":"high"}}
[11-07 14:58:00 ty T][78a][com_protocol.c:885] Data To MQTT AND V=2.3
[11-07 14:58:00 ty D][78a][tuya_svc_mqtt_client.c:423] packet id: 17
[11-07 14:58:00 ty D][78a][smart_frame.c:4347] rept chan:1
[11-07 14:58:00 ty D][78a][smart_frame.c:582] is_need_update:1, is_dp_passive:0, pv_stat:2, uling_cnt:0
[11-07 14:58:00 ty D][78a][smart_frame.c:905] Send dp:101, RAW:{"101":"AAfoCwcOOgAAAQ=="}, retrans:1
[11-07 14:58:00 ty D][78a][smart_frame.c:2787] dp rept_type:1, data:{"101":"AAfoCwcOOgAAAQ=="}
[11-07 14:58:00 ty D][78a][mqc_app.c:800] Send MQTT Msg.P:4 N:30326 Q:1 Data:{"dps":{"101":"AAfoCwcOOgAAAQ=="}}
[11-07 14:58:00 ty T][78a][com_protocol.c:885] Data To MQTT AND V=2.3
[11-07 14:58:00 ty D][78a][tuya_svc_mqtt_client.c:423] packet id: 18
[11-07 14:58:00 ty T][639][smart_frame.c:2315] mqtt async dp cb 0
[11-07 14:58:00 ty D][639][smart_frame.c:2328] msg_data:{"dps":{"1":true,"111":"high"}}, mqtt async dp
[14:57:59.426]收←◆ cb:0
[11-07 14:58:00 ty T][639][smart_frame.c:3288] DP ID 1 Set To 3
[11-07 14:58:00 ty D][639][smart_frame.c:224] set short dp rate rule, dpID:1, curr_t:1730962680, rept_cnt:1.
[11-07 14:58:00 ty D][639][smart_frame.c:232] set long dp rate rule, dpID:1, curr_t:1730962680, rept_cnt:0.
[11-07 14:58:00 ty D][639][smart_frame.c:241] set all dp rate rule, dpID:1, curr_t:1730962680, rept_cnt:0.
[11-07 14:58:00 ty T][639][smart_frame.c:3288] DP ID 111 Set To 3
[11-07 14:58:00 ty D][639][smart_frame.c:224] set short dp rate rule, dpID:111, curr_t:1730962680, rept_cnt:1.
[11-07 14:58:00 ty D][639][smart_frame.c:232] set long dp rate rule, dpID:111, curr_t:1730962680, rept_cnt:0.
[11-07 14:58:00 ty D][639][smart_frame.c:241] set all dp rate rule, dpID:111, curr_t:1730962680, rept_cnt:0.
tcp_increase_rx_win_cnt 1
force cleared 1
[11-07 14:58:00 ty T][78a][smart_frame.c:3288] DP ID 101 Set To 3

[14:57:59.528]收←◆[11-07 14:58:00 ty D][78a][smart_frame.c:224] set short dp rate rule, dpID:101, curr_t:1730962680, rept_cnt:1.
[11-07 14:58:00 ty D][78a][smart_frame.c:232] set long dp rate rule, dpID:101, curr_t:1730962680, rept_cnt:0.
[11-07 14:58:00 ty D][78a][smart_frame.c:241] set all dp rate rule, dpID:101, curr_t:1730962680, rept_cnt:0.

[14:58:04.342]收←◆[11-07 14:58:05 ty D][746][tuya_devos_health.c:71] feed watchdog

[14:58:14.378]收←◆[11-07 14:58:15 ty D][746][tuya_devos_health.c:71] feed watchdog

[14:58:19.811]收←◆send reply net_begin_send_arp_reply

从key_cb 开始 到reply 结束 是一个唤醒后高功耗的日志

[15:04:44.120]收←◆[11-07 15:04:43 ty D][72c][astro_timer.c:407] astro timer is delete
cleared tcp_ps_flag.

[15:04:47.194]收←◆[11-07 15:04:47 ty D][746][tuya_devos_health.c:71] feed watchdog

[15:04:50.269]收←◆send reply net_begin_send_arp_reply

[15:04:57.434]收←◆[11-07 15:04:57 ty D][746][tuya_devos_health.c:71] feed watchdog

[15:04:59.409]收←◆key_cb
[15:04:59.483]收←◆stop send reply net_begin_send_arp_reply

[15:05:07.469]收←◆[11-07 15:05:07 ty D][746][tuya_devos_health.c:71] feed watchdog

[15:05:17.505]收←◆[11-07 15:05:17 ty D][746][tuya_devos_health.c:71] feed watchdog

[15:05:21.091]收←◆send reply net_begin_send_arp_reply

[15:05:28.256]收←◆[11-07 15:05:28 ty D][746][tuya_devos_health.c:71] feed watchdog
这个是去掉其他的应用回调单纯只是进了中断函数的日志

chaser
Posts: 75

Re: T3低功耗保活gpio唤醒后高功耗

这个20s 是把dtim10 切到了 dtim1, 是因为sdk中把 gpio 唤醒认为是有多媒体要工作主动切换的逻辑。 晚些时候提供个库,你可以更新下验证是不是这个逻辑导致的。

Post Reply