Error in remote control enet AWS Example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error in remote control enet AWS Example

596 Views
etronic_arg
Contributor II

Hello, 

I was trying to run the SDK example "remote_control_enet".

I followed the excellent guide https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT-cloud-testing-

for-AWS-cloud-remote-control/ta-p/1111498.

I didn´t use the MIMXRT1060 but I used the FRDM-K64F and the SDK 2.9.0 instead.

The demo failed:

0 79 [main_task] Write certificate...
Initializing PHY...
1 1818 [main_task] Getting IP address from DHCP ...
2 13818 [main_task] IPv4 Address: 192.168.201.233
3 13818 [main_task] DHCP OK
4 13825 [AWS-RemoteCtrl] [INFO ][INIT][13825] SDK successfully initialized.
5 13832 [AWS-RemoteCtrl] [INFO ][Shadow][13832] Shadow library successfully initialized.
6 18934 [AWS-RemoteCtrl] [INFO ][MQTT][18934] Establishing new MQTT connection.
7 18943 [AWS-RemoteCtrl] [INFO ][MQTT][18943] Anonymous metrics (SDK language, SDK version) will be provided to AWS IoT. Recompile with AWS_IOT_MQTT_ENABLE_METRICS set to 0 to disable.
8 18960 [AWS-RemoteCtrl] [INFO ][MQTT][18960] (MQTT connection 20005778, CONNECT operation 20005958) Waiting for operation completion.
9 19221 [AWS-RemoteCtrl] [INFO ][MQTT][19221] (MQTT connection 20005778, CONNECT operation 20005958) Wait complete with result SUCCESS.
10 19234 [AWS-RemoteCtrl] [INFO ][MQTT][19233] New MQTT connection 20005058 established.
11 19242 [AWS-RemoteCtrl] [INFO ][MQTT][19242] (MQTT connection 20005778) SUBSCRIBE operation scheduled.
12 19242 [AWS-RemoteCtrl] [INFO ][MQTT][19242] (MQTT connection 20005778, SUBSCRIBE operation 200072c8) Waiting for operation completion.
13 19476 [AWS-RemoteCtrl] [INFO ][MQTT][19476] (MQTT connection 20005778, SUBSCRIBE operation 200072c8) Wait complete with result SUCCESS.
14 19476 [AWS-RemoteCtrl] [INFO ][MQTT][19476] (MQTT connection 20005778) SUBSCRIBE operation scheduled.
15 19476 [AWS-RemoteCtrl] [INFO ][MQTT][19476] (MQTT connection 20005778, SUBSCRIBE operation 200072c8) Waiting for operation completion.
16 19725 [AWS-RemoteCtrl] [INFO ][MQTT][19725] (MQTT connection 20005778, SUBSCRIBE operation 200072c8) Wait complete with result SUCCESS.
17 19738 [AWS-RemoteCtrl] [INFO ][MQTT][19738] (MQTT connection 20005778) MQTT PUBLISH operation queued.
18 49748 [AWS-RemoteCtrl] [INFO ][MQTT][49748] (MQTT connection 20005778) UNSUBSCRIBE operation scheduled.
19 49748 [AWS-RemoteCtrl] [INFO ][MQTT][49748] (MQTT connection 20005778, UNSUBSCRIBE operation 20005898) Waiting for operation completion.
20 49748 [iot_thread] [ERROR][NET][49748] Error -27648 while sending data.
21 49748 [AWS-RemoteCtrl] [INFO ][MQTT][49748] (MQTT connection 20005778, UNSUBSCRIBE operation 20005898) Wait complete with result NETWORK ERROR.
22 49749 [AWS-RemoteCtrl] [ERROR][Shadow][49749] Failed to unsubscribe from $aws/things/first_test/shadow/delete/accepted, error NETWORK ERROR.
23 49749 [AWS-RemoteCtrl] [INFO ][MQTT][49749] (MQTT connection 20005778) UNSUBSCRIBE operation scheduled.
24 49749 [AWS-RemoteCtrl] [INFO ][MQTT][49749] (MQTT connection 20005778, UNSUBSCRIBE operation 20005898) Waiting for operation completion.
25 49749 [iot_thread] [ERROR][NET][49749] Error -27648 while sending data.
26 49749 [AWS-RemoteCtrl] [INFO ][MQTT][49749] (MQTT connection 20005778, UNSUBSCRIBE operation 20005898) Wait complete with result NETWORK ERROR.
27 49750 [AWS-RemoteCtrl] [ERROR][Shadow][49750] Failed to unsubscribe from $aws/things/first_test/shadow/delete/rejected, error NETWORK ERROR.
28 49858 [AWS-RemoteCtrl] Failed to delete device shadow, stopping demo.

By debugging it, I realized that the function "AwsIotShadow_TimedDelete" in aws_shadow.c returned "AWS_IOT_SHADOW_TIMEOUT" after 30 seconds.

I replaced the original function call:

 /* Call the MQTT v2 blocking Shadow delete function. */
xShadowError = AwsIotShadow_TimedDelete( MQTT_AGENT_Getv2Connection( pxShadowClient->xMqttConnection ),
pxDeleteParams->pcThingName,
strlen( pxDeleteParams->pcThingName ),
xFlags,
shadowTICKS_TO_MS( xTimeoutTicks ) );

with:

xShadowError = AWS_IOT_SHADOW_SUCCESS;

and everything started to work.

It seems that calling the MQTT v2 blocking Shadow delete function didn't work.

What could be wrong?

Thank you!

0 Kudos
1 Reply

531 Views
danielchen
NXP TechSupport
NXP TechSupport

The default shadowDemoTIMEOUT is 30s.

Did you try to increase this value to 60 to see if it works?

 

Regards

Daniel

0 Kudos