OM40007 LPC54018-based IoT Module with Amazon FreeRTOS example error

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

OM40007 LPC54018-based IoT Module with Amazon FreeRTOS example error

1,316 Views
ricktseng
Contributor III

In the SDK example , lpc54018iotmodule_aws_aws_shadow_wifi_qspi_xip , I see some errors as below :

2769 1550441 [ShDemoUpdt] Successfully performed update.

2770 1555027 [Shd-IOT-0] Shd-IOT-0 changing desired state.

2771 1555029 [ShDemoUpdt] Performing Thing Shadow update.

2772 1555060 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

2773 1555255 [MQTT] Successfully added new reported state to update queue.

2774 1555257 [ShDemoUpdt] Successfully performed update.

2775 1555259 [ShDemoUpdt] Performing Thing Shadow update.

2776 1555260 [Shd-IOT-0] Shd-IOT-0 done changing desired state.

2777 1555292 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

2778 1555439 [ShDemoUpdt] Successfully performed update.

2779 1560027 [Shd-IOT-0] Shd-IOT-0 changing desired state.

2780 1560029 [ShDemoUpdt] Performing Thing Shadow update.

2781 1560060 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

2782 1590062 [ShDemoUpdt] [Shadow 0] Error while waiting for update accepted/rejected callback.

2783 1590063 [ShDemoUpdt] Update failed, returned 1.

2784 1590066 [Shd-IOT-0] Shd-IOT-0 done changing desired state.

2785 1590068 [Shd-IOT-0] Shd-IOT-0 changing desired state.

2786 1590070 [ShDemoUpdt] Performing Thing Shadow update.

2787 1600099 [MQTT] [Shadow 0] Warning: got an MQTT disconnect message.

2788 1600139 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic failed.

2789 1600141 [ShDemoUpdt] Update failed, returned 2.

2790 1600144 [Shd-IOT-0] Shd-IOT-0 done changing desired state.

2791 1600146 [Shd-IOT-0] Shd-IOT-0 changing desired state.

2792 1600148 [ShDemoUpdt] Performing Thing Shadow update.

2793 1600150 [ShDemoUpdt] [Shadow 0] MQTT: Subscribe to accepted topic failed.

 

It was running OK at beginning, please see below :

SEGGER J-Link GDB Server V6.42b - Terminal output channel

0 115 [Tmr Svc] Write certificate...

1 231 [Tmr Svc] Write device private key...

2 722 [Tmr Svc] Starting WiFi...

3 2366 [Tmr Svc] WiFi module initialized.

4 6573 [Tmr Svc] WiFi connected to AP jacaranda2.

5 6573 [Tmr Svc] IP Address acquired 192.168.1.151

6 6583 [MainDemoTask] [Shadow 0] MQTT: Creation of dedicated MQTT client succeeded.

7 6753 [MQTT] Looked up axyxxxxxxxxxx.iot.us-west-2.amazonaws.com as 34.211.251.xxx

<<< I mask out the information >>>

8 23854 [MainDemoTask] [Shadow 0] MQTT: Connect succeeded.

9 23992 [MainDemoTask] [Shadow 0] MQTT: Subscribe to accepted topic succeeded.

10 24130 [MainDemoTask] [Shadow 0] MQTT: Subscribe to rejected topic succeeded.

11 24157 [MainDemoTask] [Shadow 0] MQTT: Publish to operation topic succeeded.

12 24427 [MainDemoTask] [Shadow 0] MQTT: Unsubscribe from rejected topic succeeded.

13 24565 [MainDemoTask] [Shadow 0] MQTT: Subscribe to callback topic succeeded.

14 24568 [MainDemoTask] Shadow client initialized.

15 24571 [ShDemoUpdt] Performing Thing Shadow update.

16 24707 [ShDemoUpdt] [Shadow 0] MQTT: Subscribe to accepted topic succeeded.

17 24844 [ShDemoUpdt] [Shadow 0] MQTT: Subscribe to rejected topic succeeded.

18 24876 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

19 25024 [ShDemoUpdt] Successfully performed update.

20 25027 [Shd-IOT-0] Shd-IOT-0 changing desired state.

21 25029 [ShDemoUpdt] Performing Thing Shadow update.

22 25060 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

23 25208 [ShDemoUpdt] Successfully performed update.

24 25211 [Shd-IOT-0] Shd-IOT-0 done changing desired state.

25 30027 [Shd-IOT-0] Shd-IOT-0 changing desired state.

26 30029 [ShDemoUpdt] Performing Thing Shadow update.

27 30060 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

28 30233 [MQTT] Successfully added new reported state to update queue.

29 30260 [ShDemoUpdt] Successfully performed update.

31 30262 [ShDemoUpdt] Performing Thing Shadow update.

30 30261 [Shd-IOT-0] Shd-IOT-0 done changing desired state.

32 30295 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

33 30443 [ShDemoUpdt] Successfully performed update.

34 35027 [Shd-IOT-0] Shd-IOT-0 changing desired state.

35 35029 [ShDemoUpdt] Performing Thing Shadow update.

36 35060 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

37 35205 [MQTT] Successfully added new reported state to update queue.

38 35276 [ShDemoUpdt] Successfully performed update.

40 35278 [ShDemoUpdt] Performing Thing Shadow update.

39 35277 [Shd-IOT-0] Shd-IOT-0 done changing desired state.

41 35311 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

 

>>>>

The SDK is : 

Screen Shot 2019-11-03 at 11.54.18 AM.png

 

The IDE is :

MCUXpresso IDE v10.3.1 [Build 2233] [2019-02-20]

 

Once it fails , it will never be able to publish again. The only way to fix it is to terminate the debug session and start over again from beginning.. 

>>> Adding MQTT Fx Client

1CDD25E4-8E39-44B9-A635-CD2376E3999B.jpeg

My AWS iot thing is OK.. I can see the shadow update message from Mqtt Fx Client. As you can see from the attached log , the errors happened after many successful publishes. I could duplicate the error if I re-run the program. The time to get the error message is random. Sometimes it runs more than one hour to show the error , sometimes errors come out in 10 minutes.. Anyone see something like it ??

Thanks

Rick

Labels (1)
7 Replies

1,138 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Rick,

This behavior seems quite strange. I dont believe that there should be an error with the actual connection, because generally when there is an intermittent signal it will cause an error, but should try to reconnect again. 

I will try to reproduce this error with the earlier version of MCUXpresso. 

However I am currently using MCUXpresso 11.0.0 and the SDK version I have is 2.6.0. Could you please confirm the SDK version you are using as well? 

Also could you provide a small description of your process, what it is being updated? 

Best Regards,

Sabina

0 Kudos

1,138 Views
ricktseng
Contributor III

Hi Sabina,

Thanks for the reply. The SDK is 2.6.0(228 2019-06-04) : SDK_2.x_LPC54018-IoT-Module. The MCUXpresso is MCUXpresso IDE v10.3.1 [Build 2233] [2019-02-20]. This example is to update the AWS iot shadow state every 5 seconds:

{"state":{"desired":{"Shd-IOT-0":"red"}},"clientToken": "token-56156"}

{"state":{"reported":{"Shd-IOT-0":"red"}},"clientToken": "token-56360"}

The shadow Document :

Shadow state: ( from AWS console )

{   "desired": {     "Shd-IOT-0": "red"   },   "reported": {     "Shd-IOT-0": "red"   } }

I could see the update message from MQTT fx and AWS iot console. The messages are correct. However , as you could see from my post , the LPC54018 iot module will run into errors and not being able to publish message anymore.

Thanks

Rick

0 Kudos

1,138 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Rick,

I've gone ahead and tested this from my side and so far I do not experience the same behavior as you.

I am working with MCUXpresso 11.0.1 and the same SDK version 2.6.0.

I have connected to my AWS thing and are able to see the shadow update properly as you mention. However I have let this run for over an hour and have not seen the same results as you. 

Are you using semihosting or uart as your serial console? The semihosting console has been known to cause issues in the execution of applications. 

Does this happen in a debug session only or also without the debugger?

Were there any modifications made to the example?

I possible I would recommend to update your MCUXpresso IDE and try again. Let me know if the results are the same.

Best Regards,

Sabina

0 Kudos

1,138 Views
ricktseng
Contributor III

Hi Sabina,

Thanks for checking. I will try MCUXpresso 11.0.1 . 

I use semihosting :

[MCUXpresso Semihosting Telnet console for 'lpc54018iotmodule_aws_aws_shadow_wifi_qspi_xip JLink Debug' started on port 58215 @ 127.0.0.1]

I did not modify the example except the "clientcredential.h" ..

Thanks again... 

0 Kudos

1,137 Views
Sabina_Bruce
NXP Employee
NXP Employee

Not a problem. If you would like to test using the UART console. You can change the settings of the project by clicking the project itself. Then in quick start panel on the bottom left corner you will find quick settings-> SDK Debug console-> uart console. Rebuild and run your project.

Then open your preffered serial terminal such as teraterm.

Best Regards,

Sabina

1,137 Views
ricktseng
Contributor III

Hi Sabina ,

I follow your instruction to test using the UART console . The program run over one hour without issue. Thanks.

I do not use Teraterm. The MCUXpresso IDE has a terminal tab. I select /dev/cu.usbmodem on the setting- >serial port then I can see the output :

12525 6984367 [ShDemoUpdt] Performing Thing Shadow update.
12527 6984402 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.
12528 6984558 [ShDemoUpdt] Successfully performed update.
12529 6989124 [Shd-IOT-0] Shd-IOT-0 changing desired state.
12530 6989128 [ShDemoUpdt] Performing Thing Shadow update.
12531 6989161 [ShDemoUpdt] [Shadow 0] MQTT: Publish to operation topic succeeded.

Thanks for your help...

0 Kudos

1,138 Views
Sabina_Bruce
NXP Employee
NXP Employee

Glad that you were able to resolve this. Let me know if you have anyother questions.

Best Regards,

Sabina

0 Kudos