Open main menu

DAVE Developer's Wiki β

Changes

no edit summary
{{InfoBoxTop}}
{{AppliesToSBCSPG}}
{{AppliesTo SBC Lynx TN}}
{{AppliesToIoT}}
{{AppliesTo IoT TN}}
{{InfoBoxBottom}}
{{WarningMessage|text=This technical note was validated against specific versions of hardware and software. It may not work with other versions.}}
|-
|}
 
==Introduction==
[[MISC-TN-005:_Running_AWS_Greengrass_Core_on_SBCSPG|This]] and [[SBCX-TN-003:_Deploying_modules_to_Azure_IoT_Edge-enabled_SBCX_with_Visual_Studio_Code|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—[https://www.eclipse.org/kura/ Eclipse Kura™] 4.1.0 framework will be installed. On the cloud side, [https://www.eclipse.org/kapua/ 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 [[MISC-TN-005: Running AWS Greengrass Core on SBCSPG|here]].
 
==Setting up the cloud platform==
For the sake of simplicity, Kapua platform was installed on a desktop PC running Debian Stretch distribution. The procedure is described [http://www.opensourcerers.org/connecting-kura-to-kapua/ 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:
 
 
<pre class="board-terminal">
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
</pre>
 
==Configuring the edge device==
The installation procedure of Kura framework on the edge device is pretty straightforward as well. Again, please refer to [http://www.opensourcerers.org/connecting-kura-to-kapua/ this document] for more details. In this example, the ''Device Display-Name'' field was customized as follows:
 
 
[[File:Kura-device-display-name.png|thumb|center|600px|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:
 
 
[[File:Kura-cloud-connection.png|thumb|center|600px|Connection to Kapua platform]]
 
 
 
 
On the cloud side, the connection status to the device is denoted by a green icon:
 
 
[[File:Kapua-device-connection.png|thumb|center|600px|Connection to the device]]
 
==Running a simple demo==
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 [https://marketplace.eclipse.org/content/example-publisher-eclipse-kura-4xy here].
 
The procedure is described [https://eclipse.github.io/kura/cloud-api/2-user-guide.html 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:
 
 
[[File:Kura-publisher.png|thumb|center|600px|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.
 
 
[[File:Kura-publisher-example-application.png|thumb|center|600px|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 ...
 
 
<pre class="board-terminal">
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
</pre>
 
 
 
 
... and in the web interface on cloud platform side as well:
 
 
 
[[File:Kapua-received-data.png|thumb|center|600px|Received data on Kapua platform side]]
dave_user, Administrators
5,193
edits