3 Replies Latest reply on May 22, 2020 3:44 AM by AditiB_81

    [Shadow] Failed to Initialize Wiced AWS library


      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:

      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

        • 1. Re: [Shadow] Failed to Initialize Wiced AWS library


          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.



          1 of 1 people found this helpful
          • 2. Re: [Shadow] Failed to Initialize Wiced AWS library



            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.

            • 3. Re: [Shadow] Failed to Initialize Wiced AWS library


              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:

              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.