Freetos Window simulator mqqt demo not working

Dan112 wrote on January 18, 2020:

I am new to aws iot .I am trying to practice the freetos mqqt demo using the quick flow. I followed the necessary guidelines.

This is the log output

0 0 [None] FreeRTOS_IPInit
1 0 [None] vTaskStartScheduler
The following network interfaces are available:
Interface 1 - rpcap://\Device\NPF_{04A8EAAD-9B49-4324-A5F2-30AB0B1955B6}
(Network adapter 'Microsoft' on local host)
Interface 2 - rpcap://\Device\NPF_{CBC19A6E-2960-42DB-93D2-87090D7906BA}
(Network adapter 'Intel® Ethernet Connection (5) I219-V' on local host)
Interface 3 - rpcap://\Device\NPF_{027BAD68-0960-4F2F-975D-E9D215C31DB0}
(Network adapter 'Microsoft' on local host)
Interface 4 - rpcap://\Device\NPF_{620AE471-515D-4D2F-96C4-E3B9C630339E}
(Network adapter 'Microsoft Corporation' on local host)
Interface 5 - rpcap://\Device\NPF_{E2513DCC-2585-44BC-ACB5-0C41F59D17CE}
(Network adapter 'Oracle' on local host)
Interface 6 - rpcap://\Device\NPF_{AFF9685C-1195-4AC1-9186-1100B8D52BBE}
(Network adapter 'Oracle' on local host)

The interface that will be opened is set by “configNETWORK_INTERFACE_TO_USE”, which
should be defined in FreeRTOSConfig.h
Attempting to open interface number 2.
Successfully opened interface number 2.
2 444 [IP-task] vDHCPProcess: offer 172.16.5.38
3 504 [IP-task] vDHCPProcess: offer 172.16.5.38
4 532 [IP-task] Write certificate…
5 552 [IP-task]
IP Address: 172.16.5.38
6 552 [IP-task] Subnet Mask: 255.255.255.0
7 552 [IP-task] Gateway Address: 172.16.5.1
8 552 [IP-task] DNS Server Address: 172.16.10.26
9 552 [iot_thread] [INFO ][DEMO][552] ---------STARTING DEMO---------
10 557 [iot_thread] [INFO ][INIT][557] SDK successfully initialized.
11 557 [iot_thread] [INFO ][DEMO][557] Successfully initialized the demo. Network type for the demo: 4
12 557 [iot_thread] [INFO ][MQTT][557] MQTT library successfully initialized.
13 557 [iot_thread] [INFO ][DEMO][557] MQTT demo client identifier is device_updates (length 14).
14 644 [iot_thread] DNS[0xDFC5]: The answer to ‘a1mkim7kwtxu3h-ats.iot.eu-central-1.amazonaws.com’ (18.197.42.184) will be stored
15 5647 [iot_thread] [ERROR][NET][5647] Failed to establish new connection. Socket status: -116.
16 5647 [iot_thread] [ERROR][MQTT][5647] Failed to establish new MQTT connection, error NETWORK ERROR.
17 5647 [iot_thread] [ERROR][DEMO][5647] MQTT CONNECT returned error NETWORK ERROR.
18 5647 [iot_thread] [INFO ][MQTT][5647] MQTT library cleanup done.
19 5647 [iot_thread] [INFO ][DEMO][5647] memory_metrics::freertos_heap::before::bytes::2086068
20 5647 [iot_thread] [INFO ][DEMO][5647] memory_metrics::freertos_heap::after::bytes::2059120
21 5647 [iot_thread] [INFO ][DEMO][5647] memory_metrics::demo_task_stack::before::bytes::1912
22 5649 [iot_thread] [INFO ][DEMO][5647] memory_metrics::demo_task_stack::after::bytes::1912
23 5649 [iot_thread] [ERROR][DEMO][5649] Error running demo.
24 5652 [iot_thread] [INFO ][INIT][5652] SDK cleanup done.
25 5652 [iot_thread] [INFO ][DEMO][5652] -------DEMO FINISHED-------

I doubled ckeck my aws iot end point and it’s correct.I defined my device name in the aws client credentials.
That’s my policy
{
“Version”: “2012-10-17”,
“Statement”: [
{
“Effect”: “Allow”,
“Action”: “iot:Connect”,
“Resource”: “arn:aws:iot:eu-central-1:1860633:*"
},
{
“Effect”: “Allow”,
“Action”: “iot:Publish”,
“Resource”: "arn:aws:iot:eu-central-1:1860
633:"
},
{
“Effect”: “Allow”,
“Action”: “iot:Subscribe”,
“Resource”: "arn:aws:iot:eu-central-1:1860*****633:

},
{
“Effect”: “Allow”,
“Action”: “iot:Receive”,
“Resource”: “arn:aws:iot:eu-central-1:1860*****633:*”
}
]
}

Any help will be appreciated.This is not even the main project,this is to get along before the main project and time is not on my side again.

alfred2g-aws wrote on January 21, 2020:

Hi Dan,

Thanks for your interest in amazon FreeRTOS!
As a quick look the Error number you received would be a socket timeout.
Can you confirm that you have a route to the server endpoint you are trying to access?
Can you confirm the server address you received from the DNS lookup is the one you actually want?

Regards,

Alfred