MISC-TN-006: Implementing a full Industrial IoT system with SBCSPG, Eclipse Kura™, and Eclipse Kapua™

From DAVE Developer's Wiki
Revision as of 09:55, 14 February 2020 by U0009 (talk | contribs)

Jump to: navigation, search
Info Box
SBCSPG-1.jpg Applies to SBCSPG
Cloud-computing-banner.jpg Applies to IoT
Warning-icon.png This technical note was validated against specific versions of hardware and software. It may not work with other versions. Warning-icon.png


History[edit | edit source]

Version Date Notes
1.0.0 September 2019 First public release

Introduction[edit | edit source]

This and this Technical Note show how to connect two different DAVE Embedded Systems products to famous IoT cloud platforms, Amazon AWS and Microsoft Azure, respectively.

MISC-TN-006 will show instead how to implement an Industrial IoT system by following a different approach. In this case, open-source software stacks both on the edge device and on the cloud platform will be used. This choice is extremely flexible and allows implementing on-premise cloud infrastructure as well.

Specifically, on the edge device—the SBCSPG industrial gateway—Eclipse Kura™ 4.1.0 framework will be installed. On the cloud side, Eclipse Kapua™ 1.0.7 modular platform will be used.

From the software perspective, the basic configuration of the edge device is the same described here.

Setting up the cloud platform[edit | edit source]

For the sake of simplicity, Kapua platform was installed on a desktop PC running Debian Stretch distribution. The procedure is described here and it is quite straightforward, as it is based on the use of a Docker container. The following log shows how to start Kapua:


sysadmin@linuxbox:~/devel/kapua/kapua/deployment/docker/unix$ ./docker-deploy.sh
Deploying Eclipse Kapua...
compose_events-broker_1 is up-to-date
compose_es_1 is up-to-date
Starting compose_db_1 ... done
Starting compose_broker_1 ... done
Starting compose_kapua-console_1 ... done
Starting compose_kapua-api_1 	... done
Deploying Eclipse Kapua... DONE!
Run "docker-compose -f /home/sysadmin/devel/kapua/kapua/deployment/docker/unix/../compose/docker-compose.yml logs -f" for container logs

Configuring the edge device[edit | edit source]

The installation procedure of Kura framework on the edge device is pretty straightforward as well. Again, please refer to this document for more details. In this example, the Device Display-Name field was customized as follows:


Customization of the Device Display-Name field



Once the cloud connection is set up properly on the edge device, it should establish the connection with Kapua as shown in the following picture:


Connection to Kapua platform



On the cloud side, the connection status to the device is denoted by a green icon:


Connection to the device

Running a simple demo[edit | edit source]

To run a simple demo for uploading data to the cloud, the following steps can be carried out:

  • Creating and configuring a new Publisher
  • Installing and configuring the example publisher application available here.

The procedure is described here. Unlike the linked document, however, a new cloud connection was not created and the existing one was used instead. The resulting Publisher configuration looks like this:


Configuration of the publisher



After installing the publisher package by dragging and dropping the Eclipse Marketplace link into the Kura Packages section, it was configured as shown in the following image.


Configuration of the example publisher application



If everything was set up properly, every second the example publisher application will upload new data to the Kapua platform. This is visible in the log file on the SBCSPG device ...


root@sbcspg:~# tail -f /var/log/kura.log
2019-09-10T11:20:36,056 [pool-18-thread-1] INFO  o.e.k.e.p.ExamplePublisher - Published to message: org.eclipse.kura.cloudconnection.message.KuraMessage@1811109 with ID: null
2019-09-10T11:20:36,731 [DataServiceImpl:Submit] INFO  o.e.k.c.d.t.m.MqttDataTransport - Publishing message on topic: dave/sbcspg/W1/A1/$assetName with QoS: 0
2019-09-10T11:20:37,031 [pool-18-thread-1] INFO  o.e.k.c.d.DataServiceImpl - Storing message on topic: #account-name/#client-id/W1/A1/$assetName, priority: 7
2019-09-10T11:20:37,039 [pool-18-thread-1] INFO  o.e.k.c.d.DataServiceImpl - Stored message on topic: #account-name/#client-id/W1/A1/$assetName, priority: 7
2019-09-10T11:20:37,043 [pool-18-thread-1] INFO  o.e.k.e.p.ExamplePublisher - Published to message: org.eclipse.kura.cloudconnection.message.KuraMessage@1f6625b with ID: null
2019-09-10T11:20:37,731 [DataServiceImpl:Submit] INFO  o.e.k.c.d.t.m.MqttDataTransport - Publishing message on topic: dave/sbcspg/W1/A1/$assetName with QoS: 0
2019-09-10T11:20:38,032 [pool-18-thread-1] INFO  o.e.k.c.d.DataServiceImpl - Storing message on topic: #account-name/#client-id/W1/A1/$assetName, priority: 7
2019-09-10T11:20:38,040 [pool-18-thread-1] INFO  o.e.k.c.d.DataServiceImpl - Stored message on topic: #account-name/#client-id/W1/A1/$assetName, priority: 7
2019-09-10T11:20:38,044 [pool-18-thread-1] INFO  o.e.k.e.p.ExamplePublisher - Published to message: org.eclipse.kura.cloudconnection.message.KuraMessage@16ea991 with ID: null
2019-09-10T11:20:38,732 [DataServiceImpl:Submit] INFO  o.e.k.c.d.t.m.MqttDataTransport - Publishing message on topic: dave/sbcspg/W1/A1/$assetName with QoS: 0
2019-09-10T11:20:39,032 [pool-18-thread-1] INFO  o.e.k.c.d.DataServiceImpl - Storing message on topic: #account-name/#client-id/W1/A1/$assetName, priority: 7
2019-09-10T11:20:39,042 [pool-18-thread-1] INFO  o.e.k.c.d.DataServiceImpl - Stored message on topic: #account-name/#client-id/W1/A1/$assetName, priority: 7   
2019-09-10T11:20:39,047 [pool-18-thread-1] INFO  o.e.k.e.p.ExamplePublisher - Published to message: org.eclipse.kura.cloudconnection.message.KuraMessage@15edb4a with ID: null



... and in the web interface on cloud platform side as well:


Received data on Kapua platform side