AnsweredAssumed Answered

[LPC54018] AWS Shadow Subscribe error

Question asked by Taeyoung Kim on Mar 5, 2018
Latest reply on Mar 22, 2018 by Brendon Slade

Hi,

I have LPC54018 IoT Module and I'm trying to run MCUXpresso IDE SDK demo

"lpc54018iotmodule_aws_led_wifi_qspi_xip".

 

I got a socket error during the demo.

Connection has been done successfully and trying to request subscribe but invalid socket error received (-30848).

 

How can I know the exact cause?

 

Thanks.

Taeyoung Kim.

 

 

-------------------------------------------------------------------------

 

0 0 [Tmr Svc] Starting key provisioning...
1 0 [Tmr Svc] Write root certificate...
2 1 [Tmr Svc] Write device private key...
3 12 [Tmr Svc] Write device certificate...
4 21 [Tmr Svc] Key provisioning done...
5 22 [Tmr Svc] Starting WiFi...
6 1719 [Tmr Svc] WiFi module initialized.
7 4865 [Tmr Svc] WiFi connected to AP thg-innv.
8 5956 [Tmr Svc] IP Address acquired 192.168.43.244
9 5965 [AWS-LED] [Shadow 0] MQTT: Creation of dedicated MQTT client succeeded.
10 5968 [AWS-LED] Sending command to MQTT task.
11 5970 [MQTT] Received message 10000 from queue.
12 5970 [MQTT] eMQTTConnectRequest
13 6224 [MQTT] Looked up xxxx
14 6430 [MQTT] TLS_Init
15 6431 [MQTT] TLS_Connect
16 28467 [MQTT] username: ?SDK=AmazonFreeRTOS&Version=V10.0.1&Platform=NXPLPC54018
17 28468 [MQTT] clientid: lpc54018-dev-01
18 28469 [MQTT] prvSendData
19 28470 [MQTT] prvMQTT_pkt_dump: size: 87


Dump 87 byte
00000000 10 55 00 04 4d 51 54 54 04 82 04 b0 00 0f 6c 70 |.U..MQTT......lp|
00000010 63 35 34 30 31 38 2d 64 65 76 2d 30 31 00 38 3f |c54018-dev-01.8?|
00000020 53 44 4b 3d 41 6d 61 7a 6f 6e 46 72 65 65 52 54 |SDK=AmazonFreeRT|
00000030 4f 53 26 56 65 72 73 69 6f 6e 3d 56 31 30 2e 30 |OS&Version=V10.0|
00000040 2e 31 26 50 6c 61 74 66 6f 72 6d 3d 4e 58 50 4c |.1&Platform=NXPL|
00000050 50 43 35 34 30 31 38 |PC54018. |

 

20 28553 [MQTT] [Broker0] socket recv: 4
21 28554 [MQTT] MQTT_ParseReceivedData
22 28555 [MQTT] prvMQTT_pkt_dump: size: 4


Dump 4 byte
00000000 20 02 00 00 | .... |

 

28 28565 [MQTT] [Broker0] socket recv: 0
29 28572 [AWS-LED] Command sent to MQTT task passed.
30 28573 [AWS-LED] [Shadow 0] MQTT: Connect succeeded.
31 28575 [AWS-LED] SHADOW_ClientConnect: 0
32 28577 [AWS-LED] thing name: lpc54018-dev-01
33 28579 [AWS-LED] Sending command to MQTT task.
34 28581 [MQTT] Received message 20000 from queue.
35 28582 [MQTT] eMQTTSubscribeRequest
36 28583 [MQTT] Initiating MQTT subscribe.
37 28583 [MQTT] Subscribe: Topic: $aws/things/lpc54018-dev-01/shadow/update/documents
38 28585 [MQTT] prvSendData
39 28585 [MQTT] prvMQTT_pkt_dump: size: 58


Dump 58 byte
00000000 82 38 00 02 00 33 24 61 77 73 2f 74 68 69 6e 67 |.8...3$aws/thing|
00000010 73 2f 6c 70 63 35 34 30 31 38 2d 64 65 76 2d 30 |s/lpc54018-dev-0|
00000020 31 2f 73 68 61 64 6f 77 2f 75 70 64 61 74 65 2f |1/shadow/update/|
00000030 64 6f 63 75 6d 65 6e 74 73 01 |documents.. |

 

40 28631 [MQTT] [Broker0] socket recv: 0
41 28739 [MQTT] [Broker0] socket recv: -30848
42 28740 [MQTT] socket err: mqtt disconnect
43 28741 [MQTT] prvSendData
44 28741 [MQTT] prvMQTT_pkt_dump: size: 2


Dump 2 byte
00000000 e0 00 |... |

 

45 28756 [MQTT] eMQTTClientDisconnected
46 28757 [MQTT] prvShadowMQTTCallback: MQTTEvent: 1
47 28758 [MQTT] [Shadow 0] Warning: got an MQTT disconnect message.
48 28758 [MQTT] About to close socket.
49 28807 [MQTT] Socket closed.
50 28808 [MQTT] Notifying task.
51 28814 [AWS-LED] Command sent to MQTT task failed.
52 28816 [AWS-LED] [Shadow 0] MQTT: Subscribe to callback topic failed.
53 28817 [AWS-LED] Shadow_RegisterCallbacks unsuccessful, returned 2.
54 28819 [AWS-LED] Failed to initialize, stopping demo.

Outcomes