AWS IoT MQTT for TI CC3235SF

0

Hi, I'm refering to below site: https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_ti.html I'm getting warnings in build related to include paths. (30 warnings, unable to attach screenshot)

I'm getting below error in terminal when build and no data on test MQTT: Device came up in Station mode [WLAN EVENT] STA Connected to the AP: TP-Link_BB81 , BSSID: e8:48:b8:61:bb:81 [NETAPP EVENT] IP acquired by the device 1 2535 [Tmr Svc] Write certificate...

2 5349 [Tmr Svc] [ERROR] Failed to destroy object. PKCS11_PAL_DestroyObject failed. 3 5349 [Tmr Svc] Write certificate...

4 5632 [Tmr Svc] Security alert threshold = 15

5 5633 [Tmr Svc] Current number of alertDevice disconnected from the AP on application's request s = 0

6 5650 [Tmr Svc] Running Demos.

7 5654 [iot_thread] [INFO ][DEMO][5654] ---------STARTING DEMO---------

8 5662 [iot_thread] [INFO ][INIT][5661] SDK successfully initialized.

Device came up in Station mode [WLAN EVENT] STA Connected to the AP: TP-Link_BB81 , BSSID: e8:48:b8:61:bb:81 [NETAPP EVENT] IP acquired by the device

Device has connected to TP-Link_BB81 Device IP Address is 192.168.0.105

9 9126 [iot_thread] [INFO ][DEMO][9126] Successfully initialized the demo. Network type for the demo: 1

10 9127 [iot_thread] [INFO] Creating a TLS connection to a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com:8883. 11 9691 [iot_thread] [INFO] Creating an MQTT connection to a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com. 12 9725 [pthread] [SimpleLinkSockEventHandler EVENT]: Unexpected Event: 2, Socket: 0 Reason: 0.

13 9734 [iot_thread] ERROR: -452 Socket receive failed.

14 9734 [iot_thread] [ERROR] Failed to receive data over network. bytesReceived=-1 15 9735 [iot_thread] [ERROR] A single byte was not read from the transport: transportStatus=-1. 16 9735 [iot_thread] [ERROR] CONNACK recv failed with status = MQTTRecvFailed. 17 9735 [iot_thread] [ERROR] MQTT connection failed with status = MQTTRecvFailed. 18 9735 [iot_thread] [ERROR] Failed to establish MQTT connection: Server=a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com, MQTTStatus=MQTTRecvFailed 19 9785 [iot_thread] [INFO] Demo failed at iteration 1. 20 9786 [iot_thread] [INFO] Short delay before starting the next iteration.... 21 14786 [iot_thread] [INFO] Creating a TLS connection to a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com:8883. 22 15206 [iot_thread] [INFO] Creating an MQTT connection to a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com. 23 15236 [pthread] [SimpleLinkSockEventHandler EVENT]: Unexpected Event: 2, Socket: 1 Reason: 0.

24 15245 [iot_thread] ERROR: -452 Socket receive failed.

25 15246 [iot_thread] [ERROR] Failed to receive data over network. bytesReceived=-1 26 15246 [iot_thread] [ERROR] A single byte was not read from the transport: transportStatus=-1. 27 15246 [iot_thread] [ERROR] CONNACK recv failed with status = MQTTRecvFailed. 28 15246 [iot_thread] [ERROR] MQTT connection failed with status = MQTTRecvFailed. 29 15246 [iot_thread] [ERROR] Failed to establish MQTT connection: Server=a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com, MQTTStatus=MQTTRecvFailed 30 15297 [iot_thread] [INFO] Demo failed at iteration 2. 31 15297 [iot_thread] [INFO] Short delay before starting the next iteration.... 32 20298 [iot_thread] [INFO] Creating a TLS connection to a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com:8883. 33 20808 [iot_thread] [INFO] Creating an MQTT connection to a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com. 34 20839 [pthread] [SimpleLinkSockEventHandler EVENT]: Unexpected Event: 2, Socket: 2 Reason: 0.

35 20848 [iot_thread] ERROR: -452 Socket receive failed.

36 20849 [iot_thread] [ERROR] Failed to receive data over network. bytesReceived=-1 37 20849 [iot_thread] [ERROR] A single byte was not read from the transport: transportStatus=-1. 38 20849 [iot_thread] [ERROR] CONNACK recv failed with status = MQTTRecvFailed. 39 20849 [iot_thread] [ERROR] MQTT connection failed with status = MQTTRecvFailed. 40 20850 [iot_thread] [ERROR] Failed to establish MQTT connection: Server=a2m3gcrxudnep8-ats.iot.ap-south-1.amazonaws.com, MQTTStatus=MQTTRecvFailed 41 20900 [iot_thread] [INFO] Demo failed at iteration 3. 42 20900 [iot_thread] [INFO] Short delay before starting the next iteration.... 43 25901 [iot_thread] [INFO] Demo run failed with 3 failed loops out of total 3 loops. RequiredSuccessCounts=2. 44 25901 [iot_thread] [INFO ][DEMO][25901] memory_metrics::freertos_heap::before::bytes::74448

45 25901 [iot_thread] [INFO ][DEMO][25901] memory_metrics::freertos_heap::after::bytes::60040

46 25902 [iot_thread] [INFO ][DEMO][25902] memory_metrics::demo_task_stack::before::bytes::2736

47 25902 [iot_thread] [INFO ][DEMO][25902] memory_metrics::demo_task_stack::after::bytes::1504

48 26903 [iot_thread] [ERROR][DEMO][26903] Error running demo.

Device disconnected from the AP on application's request 49 26915 [iot_thread] Wi-Fi Disconnected.

50 26920 [iot_thread] [INFO ][INIT][26920] SDK cleanup done.

51 26920 [iot_thread] [INFO ][DEMO][26920] -------DEMO FINISHED-------

Please guide in solving issue faced.

asked 2 years ago197 views
1 Answer
0

I've noticed in the logs that you followed the First Steps and changed IoT endpoint. Double check that you also added the Thing name clientcredentialIOT_THING_NAME and that you generated the demos/includes/aws_clientcredential_keys.h files with you device certs and private key.

If this looks ok, try to connect with your device certificate from your laptop with MQTT client of your choice, for example mosquitto_pub Test if you can establish an TLS connection:

openssl s_client -connect YOURIOTENDPOINT.iot.aws-region.amazonaws.com:8883 -CAfile AWSCAROOT.pem -cert YOURDEVCECERT.pem -key YOURDEVICEKEY.pem

if this works try to publish an MQTT message:

mosquitto_pub -t YOURTOPIC -m '{"msg":"Hello"}' --key YOURDEVICEKEY.pem --cert YOURDEVCECERT.pem --cafile AWSCAROOT.pem -h YOURIOTENDPOINT.iot.aws-region.amazonaws.com -p 8883 -d -i YOURCLIENTID

If you don't have the AWS CA AWSCAROOT.crt, you can download it here:

curl https://www.amazontrust.com/repository/AmazonRootCA1.pem > ca.pem

If this works, the AWS IoT is configured correctly. To further diagnose the problem, enable DEBUG logging on AWS IoT by following the steps in Configure AWS IoT logging and follow this guide to diagnose your connectivity problem Diagnosing Connectivity Issues

profile pictureAWS
EXPERT
Jan_B
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions