I have created an AWS account, created a thing, a group a policy added the thing to the group and linked the policy but MQTT seems to still fail (see bold)
0 522 Tmr Svc WiFi module initialized.
1 1025 Tmr Svc Write certificate…
2 2387 Tmr Svc Device credential provisioning succeeded.
3 8727 Tmr Svc WiFi connected to AP HOME-FF08-2.4.
4 8732 Tmr Svc IP Address acquired 10.0.0.19
5 8736 Tmr Svc WiFi firmware version is: C3.5.2.5.STM
6 8741 Tmr Svc WiFi firmware is up-to-date.
7 8746 iot_thread INFO INIT 8746 SDK successfully initialized.
8 15450 iot_thread INFO DEMO 15449 Successfully initialized the demo. Net
work type for the demo: 1
9 15459 iot_thread INFO MQTT 15459 MQTT library successfully initialized.
10 15466 iot_thread INFO DEMO 15466 MQTT demo client identifier is PersonalSTM32L475IoT (length 20).
11 16850 iot_thread INFO MQTT 16850 Establishing new MQTT connection.
12 16861 iot_thread INFO MQTT 16860 Anonymous metrics (SDK language, SDK version) will be provided to AWS IoT. Recompile with AWS_IOT_MQTT_ENABLE_METRIC1
3 16875 iot_thread INFO MQTT 16875 (MQTT connection 0x100065f0, CONNECT operation 0x10006778) Waiting for operation completion. 14 16960 NetRecv ERROR MQTT 16960 (MQTT connection 0x100065f0) Unknown packet type 01 received. 15 16970 NetRecv ERROR MQTT 16970 (MQTT connection 0x100065f0) Error processing incoming data. Closing connection.
16 16981 NetRecv INFO MQTT 16980 (MQTT connection 0x100065f0) Network connection closed.
17 21887 iot_thread INFO MQTT 21887 (MQTT connection 0x100065f0, CONNECT operation 0x10006778) Wait complete with result TIMEOUT.
18 21899 iot_thread ERROR MQTT 21899 Failed to establish new MQTT connection, error TIMEOUT.
19 21908 iot_thread INFO MQTT 21908 Network connection closed on error.
20 21921 iot_thread INFO MQTT 21921 (MQTT connection 0x100065f0) Network connection destroyed.
I’d greatly appreciate any ideas / pointers that anyone might have
Thank you for reporting this and sharing logs. Can you provide more information on which Amazon FreeRTOS release you are using and if you had made any changes or trying the MQTT demo?
I am using the STM32L475 IoT node - though with what may be an old example of the AWS FreeRTOS demo code. In aws_demo_config.h I replaced the default demo CONFIG_GREENGRASS_DISCOVERY_DEMO_ENABLED with CONFIG_MQTT_DEMO_ENABLED in an attempt to create the simplest possible demo of MQTT connect / publish and subscribe.
Ended up answering my own question - I now understand the policy restricts which MQTT topics a Thing can publish and subscribe to. My policy had a bug - once fixed the demo works.