"DM_RTC_WAKEUP" observed while DA16200MOD is already in sleep mode

Hi there,

I'm using DA16200MOD with AWS SDK version: DA16200_DA16600_SDK_v3.2.4.0_AWS_0 integrated in DA16200_DA16600_SDK_FreeRTOS_v3.2.4.0.

I have observed that when DA16200MOD is in sleep (SLEEP mode 3) with DPM settings (as below), device automatically wake-up after (approx. 20 mins).

DDPS Enable -NO

DPM Keep Alive Time- (Default 30000 ms)

DPM User Wakeup Time(0~86400 Sec.)- (Default 0 Sec.)

DPM TIM Wakeup Count(1~65535 dtim) - 75

Kindly let me know is there any settings I need to check or is it known behavior?

For your reference, I am attaching the logs.


rtc_timeout (tid:5)

Wakeup source is 0x82
>>> Start DA16X Supplicant ...
>>> TIM STATUS: 0x00000010
>>> TIM : FAST
DPM Mode = 1
[APP_SERIAL_COMM_COMMANDROUTERTASK] InputStreamBuffer created
[APP_SERIAL_COMM_RESPONDERTASK] OutputStreamBuffer created

===========================================

[ AWS-IOT Doorlock ]

[ Ver. 21.06 , 202106171700 , eoh ]

============================================


Using internal cert key by app_aws_certi.h


AWS_IOT on Station Mode for "143"

sleepMode: 3, rtcTime: 0


===========================================

[ Set Sleep mode : 3 , RTC time : 0 ,useRTM : 1 ]

============================================


[New Thread("DM_T_aws_shadowdpm") Start for DPM APP]


=============================================

[dpmAppThreadCreate] DPM mode checked...
"DM_IR_aws_shadowdpm" got dpm data size (12)
"DM_ER_aws_shadowdpm" got dpm data size (308)
Wake up from DPM Sleep

=============================================

"aws_shadowdpm" already registered to port #1883 for DPM process

sendDPMAppMSGQ...


============================
Wake mode [0x82] , type [1]
Wake up .... RTC timer
============================

[dpmAPPManager] DM_NEED_INIT
DM_INIT


AWS IoT SDK Version 3.0.1-

[Make AWS-Thing-Name]

[Built-name] AWS Thing name : [143] (len=3)

[dpmAPPManager] DM_NEED_CONNECTION
DM_NEED_CONNECTION

Shadow Init
WARN: [iot_tls_init:210] DPM Mode = 1
Shadow Connect
saved aws broker IP = "35.163.143.95"
sock(#=0) connect return (rc=0)
DEBUG: [iot_tls_connect:266] TLS processing after socket setup
[app_tls_restore:215] restore tls session OK, state = 16
[app_tls_restore] not the mode of receiving packet
[app_tls_setup:698] tls restore OK, but not UC wakeup
[app_socket_connect_tls] not the mode of receiving packet...bypass
DEBUG: [iot_tls_connect:324] saving binded port num=1883
DEBUG: [_aws_iot_mqtt_internal_connect:565] TCP & TLS session restored: go to fast wake-up step
Shadow Connection(DPM) OK
bypass the duplicated subscribing to AWS server (retry:0, wakeup type:1)
autoreconnect_status 0
Subscribing... 0
finish connection (rc=0)
[dpmAPPManager] DM_RTC_WAKEUP
DM_WAKEUP_TIMER


Sleep mode 3

[dpmAPPManager] DM_CHECK_RECV before DPM sleep
DM_FINISH_DEVICE

[dpmAPPManager] RTC_READY_POWER_DOWN
[dpm_keepalive_timer_register] RTC interval (=1200 secs), mode (=0)

... " goto DPM SLEEP...>þ
Wakeup source is 0x82
>>> Start DA16X Supplicant ...
>>> TIM STATUS: 0x00000001
>>> TIM : UC
DPM Mode = 1
[APP_SERIAL_COMM_COMMANDROUTERTASK] InputStreamBuffer created
[APP_SERIAL_COMM_RESPONDERTASK] OutputStreamBuffer created

===========================================

[ AWS-IOT Doorlock ]

[ Ver. 21.06 , 202106171700 , eoh ]

============================================


Using internal cert key by app_aws_certi.h


AWS_IOT on Station Mode for "143"

sleepMode: 3, rtcTime: 0


===========================================

[ Set Sleep mode : 3 , RTC time : 0 ,useRTM : 1 ]

============================================


[New Thread("DM_T_aws_shadowdpm") Start for DPM APP]


=============================================

[dpmAppThreadCreate] DPM mode checked...
"DM_IR_aws_shadowdpm" got dpm data size (12)
"DM_ER_aws_shadowdpm" got dpm data size (308)
Wake up from DPM Sleep

=============================================

"aws_shadowdpm" already registered to port #1883 for DPM process

sendDPMAppMSGQ...


============================
Wake mode [0x82] , type [2]
Wake up .... Recv Packet
============================

[dpmAPPManager] DM_NEED_INIT
DM_INIT


AWS IoT SDK Version 3.0.1-

[Make AWS-Thing-Name]

[Built-name] AWS Thing name : [143] (len=3)

[dpmAPPManager] DM_NEED_CONNECTION
DM_NEED_CONNECTION

Shadow Init
WARN: [iot_tls_init:210] DPM Mode = 1
Shadow Connect
saved aws broker IP = "35.163.143.95"
sock(#=0) connect return (rc=0)
DEBUG: [iot_tls_connect:266] TLS processing after socket setup
[app_tls_restore:215] restore tls session OK, state = 16
wake up read first . . .
Fail to read data: NETWORK_DISCONNECTED_ERROR (rc=-13)
DPM wake-up NETWORK_DISCONNECTED_ERROR
[app_tls_deinit:519] close (rc=0)
ERROR: [_aws_iot_mqtt_internal_connect:541] connect failed (socket or tls): re turn error: rc = -13
[aws_dpm_set_aws_server_ip:351] passed ip (="") invalid, and cleared
[app_tls_disconnect:1219] saved server's ip cleared
DEBUG: [iot_tls_destroy:437] IN
DEBUG: [iot_tls_destroy:439] OUT
ERROR: [AWS_DPM_App_Connect:2075] Shadow Connection Error (-13)
ERROR: [AWS_DPM_App_Connect:2314] Shadow Network Disconnected Error. go to ret ry connection: (rc=-13)
forced to disconnected
Free done
[AWS_DPM_App_Connect] reconnecting... (cnt=1)
Shadow Init
WARN: [iot_tls_init:210] DPM Mode = 1
Shadow Connect
aws broker URL = "a3lm5b0snjygjx-ats.iot.us-west-2.amazonaws.com"
new aws broker IP = "54.201.54.85"
sock(#=0) connect return (rc=0)
TLS setup needed
DEBUG: [iot_tls_connect:266] TLS processing after socket setup
setup tls connection newly
DEBUG: [iot_tls_connect:324] saving binded port num=1883
DEBUG: [_aws_iot_mqtt_internal_connect:594] aws mqtt connect OK
DEBUG: [_aws_iot_mqtt_internal_connect:618] send the connect packet : OK
DEBUG: [_aws_iot_mqtt_internal_connect:639] wait for the CONNACK: OK
Shadow Connection(DPM) OK
autoreconnect_status 0
Subscribing... 0
finish connection (rc=0)
[dpmAPPManager] DM_RECV_WAKEUP
DM_WAKEUP_RECV

DEBUG: [aws_dpm_wakeup_ready:174] DPM read len=0

force to sleep

Sleep mode 3

[dpmAPPManager] DM_CHECK_RECV before DPM sleep
DM_FINISH_DEVICE

[dpmAPPManager] RTC_READY_POWER_DOWN
[dpm_keepalive_timer_register] RTC interval (=1200 secs), mode (=0)

... " goto DPM SLEEP...>à

Regards,

Dipanjan

Parents Reply
  • Hi Dipanjan,

    AWS IoT platform follow default SDK's DPM configuration.
    DPM Keep Alive Time means interval with AP for maintain connection.
    DPM User Wakeup Time means interval with Cloud Server for maintain connection. but AWS IoT use RTC Wakeup Time instead of DPM User Wakeup Time.
    RTC Wakeup Time of AWS IoT module was defined the vale of AWS_CONFIG_KEEP_INTERVAL_MIN/DEF/MAX in aws_user_conf.h file.
    From your log RTC Wakeup Time is set 1200sec.
    DPM TIM Wakeup Time means interval received packet checking during sleep.
    If you want to change DPM sleep time interval, then change AWS_CONFIG_KEEP_INTERVAL_MAX which is by default 1740.
    AWS_CONFIG_KEEP_INTERVAL_MAX is called at aws_dpm__App_sample_thread in app_dpm_sample.c file.

    Kind Regards,
    OV_Renesas

Children