Firmware reboots on connecting to MQTT Broker

Solved
sumantp's picture
sumantp
Junior(0)

I see this log on the UART after reset:-

 

 

Starting WICED v3.5.2
Platform BCM94343W_AVN initialised
Started ThreadX v5.6
Initialising NetX_Duo v5.7_sp2
Creating Packet pools
WWD SDIO interface initialised
WLAN MAC Address : B0:38:29:3D:3C:5D
WLAN Firmware : wl0: Nov 25 2015 12:57:14 version 7.45.45.1 (r602358) FWID 01-1920c040
Please wait, connecting to network...
(To return to SSID console screen, hold USER switch for 5 seconds during RESET to clear DCT configuration)
Joining : CB_HOME
Successfully joined : CB_HOME
Obtaining IPv4 address via DHCP
DHCP CLIENT hostname WICED IP
IPv4 network ready IP: 192.168.1.15
Setting IPv6 link-local address
IPv6 network ready IP: FE80:0000:0000:0000:B238:29FF:FE3D:3C5D
[MQTT] Connecting to broker 54.209.1.110 ...

Thing Name: Avnet0460
Shadow State Topic: $aws/things/Avnet0460/shadow/update
Shadow Delta Topic: $aws/things/Avnet0460/shadow/update/delta
Reading the certificate and private key from DCT...
[MQTT] Connecting to MQTT Broker...
Reading the certificate and private key from DCT...
[MQTT] Connecting to MQTT Broker...
Reading the certificate and private key from DCT...
[MQTT] Connecting to MQTT Broker...

Starting WICED v3.5.2
Platform BCM94343W_AVN initialised
Started ThreadX v5.6
Initialising NetX_Duo v5.7_sp2
Creating Packet pools
WWD SDIO interface initialised
WLAN MAC Address : B0:38:29:3D:3C:5D
WLAN Firmware : wl0: Nov 25 2015 12:57:14 version 7.45.45.1 (r602358) FWID 01-1920c040
Please wait, connecting to network...
(To return to SSID console screen, hold USER switch for 5 seconds during RESET to clear DC

 

So the firmware restarts when it is trying to read the certificate and connect to the MQTT Broker, and fails three times.

I have already created a certificate in the Amazon AWS and programmed the certificate and private key from the initial SoftAP mode. Before that I had to reflash the firmware using the "Avnet IoT Starter Kit App Reflash v2.zip" file mentioned here. Everything worked till then, but the firmware keeps on resetting whenever it is trying to connect to the MQTT broker.

Please let me know where the problem is.

PeterF's picture
PeterF
Moderator(16)

Sumant

From your description, you are running the default "AWS Shadow" application after successfully entering required certificate, private key and Wifi access point info from SoftAP mode. Your module successfully connects to your CB_HOME wireless A/P and the software connects to the MQTT message broker (54.209.1.110) but the certificate/key authentication is failing, with the software then reseting after 3 attempts to authenticate your certificates.  

Disregard the reset after 3 attempts to authenticate, - this is normal behavior.
The issue appears to be that you do not have your AWS IoT setup correctly.

A couple've notes when checking your setup within the AWS IoT console:
- Your Thing (Device), Certificate and Policy should all be visible within your AWS IoT console
- Make sure your Thing is attached to whichever certificate was written to the MCU's DCT flash memory
- There also needs to be a Policy attached to this certificate.
- Verify Thing and Policy attachment to your Certificate by selecting the active certificate and then checking the right-hand detail panel for that certificate. - You should see Thing and Policy attached to your certificate. If Thing or Policy are missing in this view,  
- It is recommended that your server connection be the US East (N. Virginia) AWS server

I can provide the applicable AWS IoT screenshots if this is not clear...

Regards
Peter