[Shadow] Failed to Initialize Wiced AWS library

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ToIn_1742091
Level 5
Level 5
10 solutions authored 5 solutions authored First solution authored

I have tried aws.iot.shadow.thing example of WICED 6.4 on Murata Type1LD EVB. The Make Target is this:

demo.aws.iot.shadow.thing_shadow-MurataType1LD download download_apps run

Type1LD is CYW43438+STM32F4.

After configuring the device via web browser Chrome, it automatically reboots and tries to connect with AWS, but wiced_aws_init() fails with 4 (WICED_ERROR) as its return value.  If I use Firefox, then there is no issue and could control the status from AWS IoT Core (could turn on/off the LED).

Chrome Version 83.0.4103.61 (Official Build) (32-bit) didn't work.

Firefox 76.0.1 (64-bit) worked.

Windows 10 Pro Version 10.0.17763 Build 17763

Hope this post can help other people who are seeing the same issue and hopefully there is a way to solve this on Chrome.

The UART output when failing is like this:

Joining : MyAP

Successfully joined : MyAP

Obtaining IPv4 address via DHCP

L1420 : dhcp_client_init() : DHCP CLIENT hostname = [WICED IP]

IPv4 network ready IP: 10.0.0.251

Setting IPv6 link-local address

IPv6 network ready IP: FE80:0000:0000:0000:029D:6BFF:FE59:D7AC

[Shadow] Reading Device's certificate and private key from DCT...

[Shadow] Failed to Initialize Wiced AWS library

0 Likes
1 Solution
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

You have done the correct changes in the code example. You are right that in your case it is failing before the connection gets established, so the location of AWS IoT server won't affect much. The example should ideally work for both the browsers. Their should be no issue if you configure your device via Chrome or Firefox.

Just wanted to make sure, have you copied the private key, client certificate and root certificate in the locations that are provided in the thing_shadow.mk file. You can refer the following snapshot:

pastedImage_0.png

You need to provide the private key and the client certificate in the location: resources/certificates/. Similarly, the Root CA certificate at apps/aws/iot. These are the certificates and key that you generated in the AWS IoT cloud. Make sure the names of certificates and private key remains the same as specified in the thing_shadow.mk file. WICED_AWS_INIT verifies these AWS IoT credentials. But, as the code example is working via Firefox, I guess you may have done these changes.

Thanks

View solution in original post

0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

I successfully ran the sample example shadow.c in demo.aws.iot.shadow.thing_shadow for CYW954907AEVAL1F platform. I have configured my WICED device via Chrome and I was able to initialize the WICED AWS library successfully. You can find the attached snapshot of the terminal for the same.

Can you provide the changes you did in the code example to get a better understanding of the problem? If possible, you can provide the application as well to resolve the issue.

Also, what server have you selected in AWS IoT? You can change the server to your nearest location in AWS IoT cloud. (for e.g. us-east-1 or ap-east-1). Make sure to do the required changes in the code example as well.

Thanks

Hello,

Thank you for your comment.

As I posted above, the application is demo.aws.iot.shadow.thing_shadow. I only changed endpoint on shadow.c and VALID_PLATFORM on thing_shadow.mk. No other changes made at all.

The location of AWS IoT server should not affect this since it is failing before making the connection. wiced_aws_init() is 100% local thing.

And again, the only difference between success case and NG case is the browser, Chrome or Firefox. And I hear from someone else saying Chrome worked fine on Windows10.

So, I am not sure what specific environment is causing this issue, but just wanted to hear if there is known issue.

And at least, for those who are facing the same issue, this post can help to try Firefox.

0 Likes
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

You have done the correct changes in the code example. You are right that in your case it is failing before the connection gets established, so the location of AWS IoT server won't affect much. The example should ideally work for both the browsers. Their should be no issue if you configure your device via Chrome or Firefox.

Just wanted to make sure, have you copied the private key, client certificate and root certificate in the locations that are provided in the thing_shadow.mk file. You can refer the following snapshot:

pastedImage_0.png

You need to provide the private key and the client certificate in the location: resources/certificates/. Similarly, the Root CA certificate at apps/aws/iot. These are the certificates and key that you generated in the AWS IoT cloud. Make sure the names of certificates and private key remains the same as specified in the thing_shadow.mk file. WICED_AWS_INIT verifies these AWS IoT credentials. But, as the code example is working via Firefox, I guess you may have done these changes.

Thanks

0 Likes