Bosch XDK to AWS
Risposta
18/08/18 10.55

Hello together,

I'm working in a project where I need to transmit the data from the XDK to the AWS IoT Cloud.For the beginning the humidity, temperature etc. would be fine. The main goal is to transmit much more data (external to the XDK connected machine data) to the cloud.

I read some threads in this community that right now there occure some problems by connecting the AWS cloud to the XDK. Franjo Stjepandic wrote in another Thread that right now the MQTTS is the problem and you can use MQTT paho instead. (With which I have no experience)

I tried to set up the template "AWSSendDataOverMqtt" with no success and unfortunately I can not find a deatiled description for this task. I got some errors compiling the project:

  1. transferCredential.DestinationFileName = AWS_ROOT_CA_FILE_NAME;
    --> Error: Symbol "AWS_ROOT_CA_FILE_NAME" could not be resolved

After flashing this error message continuosly occurs:

  1. INFO | XDK DEVICE 1: Error in XDK110 Application package
    INFO | XDK DEVICE 1: Package ID: 153 Module ID: 36 Severity code: 2 Error code: 12

 

Further information:

inside the AWS IoT "Überwachen", there the connections is called successfull (see images)

Is there anyone who already transmitted data to the AWS Cloud properly and can describe the way how it works? I would be really thankful!

 

 

best regards,

Maxi

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
20/08/18 14.22 come risposta a Maximilian Stäbler.
Hello Maximillian,

First, I would like to welcome you to the XDK community.

In regards to the older threads regarding connecting the XDK to AWS, these are deprecated since the latest XDK-Workbench 3.4.0 integrates Amazon's FreeRTOS. As such, MQTTS for connecting to AWS is available with the example AwsSendDataOverMQTT example, as you already noticed.

In regards to the example itself, the error you are receiving regarding "Symbol AWS_ROOT_CA_FILE_NAME could not be resolved" is thrown by the indexing system of the XDK-Workbench, which is unable to find the variable in the corresponding header file.

You can safely ignore this error if no additional error is thrown in the console of the XDK-Workbench and the build finishes successfully.

Regarding your other issue after flashing, it is more complicated since the package ID 153 is describing the used XDK application itself, but the error itself is a return code corresponding to a certain package such as Wi-Fi, MQTT, Sensors and so on. Therefore pinpointing the location without further information is currently difficult.

On that behalf, it would be very helpful if you could go more into detail about how you configured the example to connect to AWS. Did you used the provided config.txt file to configure the example, or did you used the fields in the AppController.h header file?

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
20/08/18 21.17 come risposta a Franjo Stjepandic.

Hello Franjo,

thanks for the warm welcome and the provided information.
Of course I can give you an closer description of what I did and where I had some problems. Please find the screenshots attached.

General: I use the Bosch Workbench on my Mac (Version 3.4.0). I also have the chance to use the workbench on a windows PC if that could prevent some problems. 

  • I opened a new XDK C-project and chose the AwsSendDataOverMQTT template

Opened AWS on my browser:

  • created a new IoT Object and downloaded the certificates (check picture 1)

Return to Bosch Workbench:

  • opened the config.txt file and changed the settings there (check picture 2)
  • copied the private key which i received from AWS into the xdk-cert.der file and the private key into the xdk-priv.der file.
  • configuered the WLAN settings in the AppController.h file as well as the SNTP server (0.pool.ntp.org)

On the AWS plattform I get a confirmation for a successfull connection (picture 3).

After these steps I cleaned the XDK and flash it but rececived the described errors (picture 4).

I hope my description is clear - if not let me know :)

 

My first question would obviously be if I did one or maybe more signifanct mistakes. Furthermore it would be interesting to know if you know a way tpo send an ongoing signal from the XDK to the AWS plattform (maybe through pushing buttons etc.) which makes it easier to check the connection.

Thanks in advance!

 

Maxi

 

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
21/08/18 14.19 come risposta a Maximilian Stäbler.
Hello Maximillian,

Thank you for the detailed explanation about your configuration process.

From the first glance, the configurations you made in the xdk-cert.der and xdk-priv.der files should be correct.
The other configuration, such as the Wi-Fi settings and SNTP should be made in the config.txt file. A configuration in the header file AppController.h will only have an effect, if the define APP_USE_CONFIG_FILE is set to false.

But I strongly recommend configuring the example with the config.txt file. Please note that the configuration file config.txt is not flashed via USB to the XDK. This file needs to be placed on an SD card formatted to FAT32 and then inserted into the XDK before flashing the example to it. Then the configuration from the file will be read and used to configure the example.

Furthermore, I guess if you follow these instructions you should see your XDK in your AWS IoT Cloud.

In regards to your question about testing the connection over a button. That would be possible in general, but the button functionality would need to be implemented on your own into the AwsSendDataOverMQTT example.

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
22/08/18 8.59 come risposta a Franjo Stjepandic.

Hello Franjo,

thanks for the information.
I applied alle the configurations in the config.txt file, formatted the SD card and copied the three files onto it.

After flashing the XDK I still receive the same error:

 INFO | XDK DEVICE 1: Error in XDK110 Application package.

 INFO | XDK DEVICE 1: Package ID: 153 Module ID: 36 Severity code: 2 Error code: 120

 INFO | XDK DEVICE 1: Error in XDK110 Application package.

 INFO | XDK DEVICE 1: Package ID: 153 Module ID: 36 Severity code: 2 Error code: 120

.
.
.

 

I tested the connection with the same certificates at the MQTT.fx program and had no problems subscribing to a topic, send JSON files etc.

In my opinion the certificates cause some problems because you need to change them from .pem to .der - is that a possible error?

Furthermore I have a question the subscription. Inside the .c file the default topic is "BCDS/XDK110/example/out" - is that right?

 

best regards,

Maxi

 

 

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
22/08/18 15.05 come risposta a Maximilian Stäbler.
Hello Maximillian,

I am always glad to help.

In your regard you might be correct. The XDK's Wi-Fi chip is only supporting certificates in the .der format.
As such, you would need to acquire the Root CA certificate, client certificate and private key directly in the .der format to use them. A conversion from .pem into .der might lead to issues.

Furthermore, did you use the .pem certificates while you tested the connection with the MQTT.fx program?

In regards to your questions about the topic, the sent data would be published under the topic BCDS/XDK110/example/out , as you already noticed.

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
23/08/18 14.37 come risposta a Franjo Stjepandic.

Hello Franjo,

yes I used the .pem certificates.

Actually the endings variate from certificat to certificat.

  • rootCA.pem
  • private.pem.key
  • certificat.pem.crt

I would be interested if you ever established a successfull connection ? Just to be sure that the template in general works with the latest "AWS version".

 

best regards,

Maxi 

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
24/08/18 15.27 come risposta a Maximilian Stäbler.
Hello Maximillian,

Unfortunately, I did not tested the example by myself yet.

But I guess that it should work out of the box with AWS, since the XDKs FreeRTOS operating system was upgraded to Amazon FreeRTOS 10 with the XDK-Workbench 3.4.0. Additionally, the Amazon FreeRTOS package also includes the implementation for MQTTS. The same implementation is used in the AwsSendDataOverMQTT example and should work with AWS.

Nevertheless, I will try the example by myself and see which configuration needs to be applied to use the AwsSendDataOverMQTT example.

In the meantime, I can only ask you for patience.

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
27/08/18 8.41 come risposta a Franjo Stjepandic.

Hi Franjo,

 

thank you for your effort!

I will try to solve the problem in the meantime as well.

 

best regards,

Maxi

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
04/09/18 15.41 come risposta a Maximilian Stäbler.
Dear Maximilian,

I have an update for you: I put some effort in testing the example and was able to reproduce your error. Finally, I receive the following error code:

INFO | XDK DEVICE 1: Package ID: 153 Module ID: 36 Severity code: 2 Error code: 120

In that regard, do you receive the error code 111 as well?

It seems to me like an AWS configuration error. I will check on this with a colleague of mine tomorrow and get back to you as soon as possible. Additionally, I will discuss with the developer team to provide more documentation about how to get the example running.

In the meantime the only thing I can do is ask you for patience.

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
04/09/18 21.06 come risposta a Franjo Stjepandic.

Hello Franjo,

 

thank you so muc for putting that much effort in "my" error topic.
Yes I can confirm the error message ypu received - I received the 111 error code it as well. 

I also double checked the certificates again - they worked perfectly with the mentioned mqtt.fx software and caused the mentioned error when formatting them into the demand Bosch format.

 

 

I look foreward to get further information from you!

 

thanks again and kind regards,

 

Maxi

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
05/09/18 14.15 come risposta a Maximilian Stäbler.
Hello Maximilian,

I am always glad to help.
Thank you for confirming the incoming return code 111, which points to a failed connection with the AWS MQTT broker.

In regards to the certificates, what kind of tool did you use to convert them from .pem.key and .crt.txt into the .der format?

Did you use OPENSSL or similar tools?

Also, did you configure the AWS policies and attached them, combined with the things, to the certificate?

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
06/09/18 15.16 come risposta a Franjo Stjepandic.
Hello Maximilian,

I have a new update on this issue. Unfortunately, I was not able to get the example running too.

In that regard, I will contact the responsible developer and request more information on this topic. Additionally, I will discuss with the team if we might be able to provide a complete how to for this example.

In the meantime, I apologize for the inconvenience and can only ask for your patience. I will immediately get back to you as soon as I know more.

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
29/10/18 12.01 come risposta a Franjo Stjepandic.

Hello Franjo,

 

do you have any new information about this topic?

Or could you solve this problem in the meantime ?

 

thank you in advance!

 

best regards , Maxi

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
30/10/18 16.02 come risposta a Maximilian Stäbler.
Dear Maximillian,

Unfortunately, I do not have new information yet.

But I am standing in contact with the developer team and assume that we might have soon a solution.

On that behalf, I would ask you once more for patience.

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
14/11/18 14.57 come risposta a Franjo Stjepandic.

Hi Franjo

I got compilation error. Pls advise. 

C:/Users/xxx/XDK-Workspace/AwsSendDataOverMQTT
Building file C:/Users/xxx/XDK-Workspace/AwsSendDataOverMQTT/source/AppController.c
C:/Users/xxx/XDK-Workspace/AwsSendDataOverMQTT
Building file C:/Users/xxx/XDK-Workspace/AwsSendDataOverMQTT/source/Main.c
Creating .out C:/Users/xxx/XDK-Workspace/AwsSendDataOverMQTT/debug/AwsSendDataOverMQTT.out
./../Libraries/FreeRTOS/debug/libFreeRTOS_efm32_debug.a(aws_mqtt_agent.o): In function `MQTT_AGENT_Init':
C:\XDK-Workbench\XDK\SDK\xdk110\Libraries\FreeRTOS/3rd-party/mqtt/aws_mqtt_agent.c:1869: undefined reference to `xQueueGenericCreateStatic'
C:\XDK-Workbench\XDK\SDK\xdk110\Libraries\FreeRTOS/3rd-party/mqtt/aws_mqtt_agent.c:1872: undefined reference to `xTaskCreateStatic'
collect2.exe: error: ld returned 1 exit status
application.mk:391: recipe for target 'C:/Users/xxx/XDK-Workspace/AwsSendDataOverMQTT/debug/AwsSendDataOverMQTT.out' failed
mingw32-make[1]: *** [C:/Users/xxx/XDK-Workspace/AwsSendDataOverMQTT/debug/AwsSendDataOverMQTT.out] Error 1

mingw32-make[1]: Leaving directory 'C:/XDK-Workbench/XDK/SDK/xdk110/Common'
Makefile:33: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2

 

Makefile 

export BCDS_FREERTOS_INCLUDE_AWS=1
 

 

Thanks in advance

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
15/11/18 11.00 come risposta a L CC.

Hi Franjo,

It failed to write config.txt to Wifi Memory

  SL_FS_ERR_INVALID_HANDLE (-17)

 

It is possible to know what the available space & list of files in Wifi Memory

 

Thanks

 

0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
15/11/18 23.04 come risposta a L CC.
Hello L CC,

do I understand you correctly that your current issue only belongs to your latest post about the config.txt file?

If this is the case, this could be a decoding issue with the file config.txt .

Please check your config.txt file encoding by following these steps:
  1. Open the config.txt file on your SD Card with the windows editor.
  2. Once it is opened, open the editor's menu and click on save as
  3. A popup window should open. On the bottom drop down menu encoding choose ASCI
  4. save the config.txt file onto your SD card.
As final step, I recommend you to first clean, then build your project again and try to flash it to your XDK once more.

If you assume it being a storage size issue, may I ask you how big your saved config.txt file is?

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Voti)
RE: Bosch XDK to AWS
Risposta
10/09/19 2.00 come risposta a Franjo Stjepandic.

Hello Team,

 

I'm getting the below error, could you please let me know what's this error code? I have tried mqtt.fx with .pem format files and works fine there but with .der files and copying to SD card, does not work. I belive I have followed the steps, converted all certs to .der, activated and attached policies.

 

 INFO | XDK DEVICE 1: Connected to WPA network successfully

 INFO | XDK DEVICE 1: IP address of device  172.20.10.9

 INFO | XDK DEVICE 1:               Mask    255.255.255.240

 INFO | XDK DEVICE 1:               Gateway 172.20.10.1

 INFO | XDK DEVICE 1:               DNS     172.20.10.1

 INFO | XDK DEVICE 1: WLANPersonalWPA2Connect : Connected to WPA network successfully. 

 INFO | XDK DEVICE 1: SntpSentCallback : Success

 INFO | XDK DEVICE 1: SntpTimeCallback : received

 INFO | XDK DEVICE 1: AppControllerFireTask : AWS MQTT connection to the server is in progress... Might take upto a couple of minutes 

 INFO | XDK DEVICE 1: AppControllerFireTask : AWS MQTT connection to the broker failed 

 INFO | XDK DEVICE 1: Error in XDK110 Application package.

 INFO | XDK DEVICE 1: Package ID: 153

 INFO | XDK DEVICE 1: Module ID: 39

 INFO | XDK DEVICE 1: Severity code: 2

 INFO | XDK DEVICE 1: Error code: 117

0 (0 Voti)