Developer Portal Community

    Showing results for 
    Search instead for 
    Did you mean: 




    Hi all,

    I have been trying to implement the example code from the 'AwsSendDataOverMQTT' example which is found at this link.

    I have followed all of the instructions, however when I run the code, I get the error:

    Error in XDK110 Application Package

    PackageID: 153 (which corresponds to XDK Application)

    ModuleID: 50 (Corresponds to XDK_common_ID_Storage)

    Severity code: 2 (corresponds to Error)

    Error code: 159 (I couldn't find this error code)

    I am hoping someone can help me work out how to fix a storage error and what this error means. I have attached a clip of the console output. 




    10 REPLIES 10
    Occasional Contributor

    Re: AwsSendDataOverMQTT

    Hello Stallion

    Error came from Storage Module and Error code: 159 is due to "RETCODE_STORAGE_ERROR_IN_GETTING_FILE_STATUS".

    There is some problem while accessing the file from the sdcard.

    Have you placed the generated certificates, after converting to .der format along with config.txt file, in the SD Card?

    Please make sure file is available in sdcard.

    Once the application runs successfully, the files in the SD card are being converted to .bkp


    Re: AwsSendDataOverMQTT

    Hi Mahalingam,


    Thank you so much for your reply. I have since corrected some things that were causing these errors, I think there were a few things incorrect in this documentation.

    The things I did

    - When downloading the rootCA file from the link, the file format is '.pem', renaming the file with '.der' at the end, did not change the file format.

    - All of the files on the SD card are named WITHOUT their extensions. What I mean by this, is that the SD card has files:

    config, rootCA, xdk-priv and xdk-cert


    config.txt, rootCA.der, 'xdk-priv.der', 'xdk-cert.der'.

    Now with this modifications, the project is runnning past that error, and begins preparing the WPA2 connection. The console shows this information

    INFO | XDK DEVICE 1: WLAN_Enable : Preparing for Personal WPA2 connection
    INFO | XDK DEVICE 1: This is a CC3100R device
    INFO | XDK DEVICE 1: CHIP 0x4000000
    INFO | XDK DEVICE 1: ROM 0x3333

    for about 2 minutes, then suddenly I recieve an AppControllerEnable: Failed error. I have attached the console output. During this time, nothing appears to be printing to the AWS. I am hoping you can help me work out what is causing this error and how to fix it.


    Established Member

    Re: AwsSendDataOverMQTT

    Hi Stallion,

    To change certificate or key formats, it is not sufficient to just rename them, but to use a tool like the OpenSSL console for this purpose. There are online tools, but it is bad practice to expose private keys, especially to 3rd parties.

    Run the OpenSSL console to convert the certificates and keys to DER

    openssl x509 -outform der -in Downloaded-certificate.pem -out xdk-cert.der
    openssl rsa -outform der -in Downloaded-private.pem -out xdk-priv.der

    The root CA provided by AWS does not work directly with our SimpleLink network processor, so it needs the Starfield Class 2 CA. The CER extension is already in DER format, so just rename this certificate to rootCA.der

    In our next workbench release we will provide this updated certificate.

    The handshake takes over one minute to complete, if this step fails, it is probably due to issues in the certificate chain.

    • A successful handshake may take over one minute
    • The Amazon Root Certificate does not work with the CC3100R device, as it does not get validation. For getting a successful connection you need the Starfield Class 2 Certificate. Sf-class2-root.cer
    • For some reason there is no SNI extension being sent by the CC3100R in the Client Hello Message, which is mandatory to present to AWS endpoints.
    • In the config.txt file, the MQTT client Id should not be the same as the AWS tenant ID (as suggested in the tutorial)
    • All other steps work as in the tutorial.
    • The sensor data payload has a bad formatting. Here removing the \“ around the numeric values will make the JSON parser interpret them as numbers and not strings

    Best regards,



    Re: AwsSendDataOverMQTT

    Hi Francisco,

    I had no problem changing the keys using git bash, as the tutorial explained. I downloaded the rootCA file that you linked and renamed it as you specified, however when I flash the application I get the same error as in the original post. As a result, a .bkp file for the rootCA certificate is not formed, while the other certificates do have one. A few questions about your last message

    - what is a 'handshake'?

    - Do you possibly have an image of the SNI extension in the client message which I am supposed to be recieving 

    - if the MQTT client id is not the 'xyz' of '', then what is it supposed to be?

    Another question, are we supposed to be replacing the certificates from the project in XDK workbench (C:\Users\mitch\XDK-Workspace\AwsSendDataOverMQTT\source\config) with those that are generated from AWS, or is this done automatically by the project?