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, we will be using open-source software stacks both on the edge device and on the cloud platformwill be used. This choice is extremely flexible and allows making use of implementing on-premise cloud infrastructureas 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.
==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 to test for uploading data to the cloud, the following steps can be carried out:*Creating a new Cloud Connection
*Creating and configuring a new Publisher
*Installing and configuring the example publisher applicationavailable [https://marketplace.eclipse.org/content/example-publisher-eclipse-kura-4xyhere]. 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:~# cat tail -f /etcvar/resolvlog/kura.log2019-09-10T11:20:36,056 [pool-18-thread-1] INFO o.e.k.e.p.ExamplePublisher - Published to message: org.eclipse.kura.confcloudconnection.message.KuraMessage@1811109 with ID: nullnameserver 82019-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.8cloudconnection.8message.8KuraMessage@15edb4a with ID: null
</pre>
[[File:TBD.png|thumb|center|600px|TBD]]
==Useful links==*http://www..opensourcerers.org/connecting-kura-to-kapua/and in the web interface on cloud platform side as well:   *https[[File://eclipse.github.io/kura/cloud-api/2Kapua-userreceived-guidedata.htmlpng|thumb|center|600px|Received data on Kapua platform side]]
dave_user, Administrators
5,191
edits