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.
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
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. https://developer.bosch.com/web/xdk/awssenddataovermqtt.
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: MAC 126.96.36.199.2
INFO | XDK DEVICE 1: PHY 188.8.131.52
INFO | XDK DEVICE 1: NWP 184.108.40.206
INFO | XDK DEVICE 1: ROM 0x3333
INFO | XDK DEVICE 1: HOST 220.127.116.11
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.
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.https://ssl-ccp.secureserver.net/repository/sf-class2-root.cer 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.
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 'xyz.iot.ap-southeast-2-amazonaws.com', 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?