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 : FASTDPM 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_INITDM_INIT
AWS IoT SDK Version 3.0.1-
[Make AWS-Thing-Name]
[Built-name] AWS Thing name : [143] (len=3)
[dpmAPPManager] DM_NEED_CONNECTIONDM_NEED_CONNECTION
Shadow InitWARN: [iot_tls_init:210] DPM Mode = 1Shadow Connectsaved 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...bypassDEBUG: [iot_tls_connect:324] saving binded port num=1883DEBUG: [_aws_iot_mqtt_internal_connect:565] TCP & TLS session restored: go to fast wake-up stepShadow Connection(DPM) OKbypass the duplicated subscribing to AWS server (retry:0, wakeup type:1)autoreconnect_status 0Subscribing... 0finish connection (rc=0)[dpmAPPManager] DM_RTC_WAKEUPDM_WAKEUP_TIMER
Sleep mode 3
[dpmAPPManager] DM_CHECK_RECV before DPM sleepDM_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 : UCDPM Mode = 1[APP_SERIAL_COMM_COMMANDROUTERTASK] InputStreamBuffer created[APP_SERIAL_COMM_RESPONDERTASK] OutputStreamBuffer created
============================Wake mode [0x82] , type [2]Wake up .... Recv Packet============================
Shadow InitWARN: [iot_tls_init:210] DPM Mode = 1Shadow Connectsaved 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 = 16wake 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 clearedDEBUG: [iot_tls_destroy:437] INDEBUG: [iot_tls_destroy:439] OUTERROR: [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 disconnectedFree done[AWS_DPM_App_Connect] reconnecting... (cnt=1)Shadow InitWARN: [iot_tls_init:210] DPM Mode = 1Shadow Connectaws 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 neededDEBUG: [iot_tls_connect:266] TLS processing after socket setupsetup tls connection newlyDEBUG: [iot_tls_connect:324] saving binded port num=1883DEBUG: [_aws_iot_mqtt_internal_connect:594] aws mqtt connect OKDEBUG: [_aws_iot_mqtt_internal_connect:618] send the connect packet : OKDEBUG: [_aws_iot_mqtt_internal_connect:639] wait for the CONNACK: OKShadow Connection(DPM) OKautoreconnect_status 0Subscribing... 0finish connection (rc=0)[dpmAPPManager] DM_RECV_WAKEUPDM_WAKEUP_RECV
DEBUG: [aws_dpm_wakeup_ready:174] DPM read len=0
force to sleep
... " goto DPM SLEEP...>à
Regards,
Dipanjan
Hi Dipanjan,Thank you for posting your question online. Let me check on this and I will get back to you.Kind Regards,OV_Renesas
Hi,
I would like to let you know that I have found out that below these two MACROS:
Hi Dipanjan,Thank you for the reply.I have raised an internal ticket so our team can check your logs and share why are you facing this wake-up issue. I will get back to you as soon as possible.Kind Regards,OV_Renesas
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
Hey there,
Thanks for the information.