DA16200MOD shadow disconnect and then reconnect after wakeup from sleep 3

I have observed that when DA16200 is in sleep 3 (with default DPM settings used) and wake up from sleep using external source, in logs I can see it disconnects from shadow and then it reconnects but this process takes around 12s to 13s. Please check below logs:-

Note: SDK version:

... " goto DPM SLEEP...ð
Wakeup source is 0x81
>>> Start DA16X Supplicant ...
>>> TIM STATUS: 0x00000010
>>> TIM : FAST

>>>DPM Mode = 1

[ Ver. 21.06 , 202106171700 , eoh ]


Using internal cert key by app_aws_certi.h

AWS_IOT on Station Mode for "143"


[ 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 is not registered. Will be registered with 8883 port


Wake mode [0x81] , type [1]
wakeup pin = 0

[dpmAPPManager] DM_NEED_INIT

AWS IoT SDK Version 3.0.1-


DIPANJAN : [AWS_DPM_App_Connect]

Shadow Init

WARN: [iot_tls_init:211] DPM Mode = 1
Shadow Connect
saved aws broker IP = ""
sock(#=0) connect return (rc=0)
DEBUG: [iot_tls_connect:267] TLS processing after socket setup
[app_tls_restore:221] restore tls session OK, state = 16
[app_tls_restore] not the mode of receiving packet
[app_tls_setup:699] tls restore OK, but not UC wakeup
[app_socket_connect_tls] not the mode of receiving packet...bypass
DEBUG: [iot_tls_connect:326] saving binded port num=8883
[app_tls_deinit:521] close (rc=0)
[aws_dpm_set_aws_server_ip:369] passed ip (="") invalid, and cleared
[app_tls_disconnect:1218] saved server's ip cleared
DEBUG: [iot_tls_destroy:438] IN
DEBUG: [iot_tls_destroy:440] OUT
ERROR: [AWS_DPM_App_Connect:260] Shadow Connection Error (-13)
ERROR: [AWS_DPM_App_Connect:418] Shadow Network Disconnected Error. go to retry connection: (rc=-13)
forced to disconnected
Free done
[AWS_DPM_App_Connect] reconnecting... (cnt=1)
Shadow Init

WARN: [iot_tls_init:211] DPM Mode = 1
Shadow Connect
aws broker URL = "a3lm5b0snjygjx-ats.iot.us-west-2.amazonaws.com"
new aws broker IP = ""
sock(#=0) connect return (rc=0)
TLS setup needed
DEBUG: [iot_tls_connect:267] TLS processing after socket setup
setup tls connection newly
DEBUG: [iot_tls_connect:326] saving binded port num=8883
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)

Sleep mode 3

[dpmAPPManager] DM_CHECK_RECV before DPM sleep


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

... " goto DPM SLEEP...>>> Sta

Kindly suggest if this is known behavior or any modification needed.
looking forward to your response, Thanks.

  • Hi There,

    If your DA16200MOD was disconnected from server or Wi-Fi AP before the wake-up by the external signal from MCU, it will need a new server connection. The 12-13 seconds to reconnect sounds like a reasonable time. 
    You can try and check reconnection time by changing AWS-local server as your country.
    From attached log, you can check aws broker URL = "a3lm5b0snjygjx-ats.iot.us-west-2.amazonaws.com""
    It means server is set to "us-west". Please try to change the server and check the reconnection time again.

    Kind Regards,

  • Hi,

    Thanks for your reply. This issue is solved when tried to follow the get-started example project of AWS-IOT and it worked properly. Shadow disconnect didn't occur every time after wakeup.



Reply Children
No Data