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_Running_AWS_Greengrass_Core_on_SBCSPG|This]] and [[SBCX-TN-003: Deploying modules to Azure IoT Edge_Deploying_modules_to_Azure_IoT_Edge-enabled SBCX with Visual Studio Codeenabled_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]].
This Technical Note (TN for short) will show instead how to implement an Industrial IoT system following ==Setting up the cloud platform==For the sake of simplicity, Kapua platform was installed on a different approachdesktop PC running Debian Stretch distribution. In this case, we will be using openThe procedure is described [http://www.opensourcerers.org/connecting-kura-to-source software stacks both on the edge device kapua/ here] and it is quite straightforward, as it is based on the cloud platform. This choice allows making use of on-premise cloud infrastructurea Docker container.The following log shows how to start Kapua:
Specifically,
<pre class="board-terminal">
rootsysadmin@sbcspglinuxbox:~# cat /etcdevel/resolvkapua/kapua/deployment/docker/unix$ ./docker-deploy.shDeploying Eclipse Kapua...compose_events-broker_1 is up-to-datecompose_es_1 is up-to-dateStarting compose_db_1 ..conf. donenameserver 8Starting compose_broker_1 .8.8.8doneStarting compose_kapua-console_1 ... doneStarting compose_kapua-api_1 ... doneDeploying 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.log2019-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: null2019-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: 02019-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: 72019-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: 72019-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: null2019-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: 02019-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: 72019-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: 72019-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: null2019-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: 02019-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: 72019-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:TBDKapua-received-data.png|thumb|center|600px|TBDReceived data on Kapua platform side]]
dave_user, Administrators
5,190
edits