Skip to content

paller42/orcc-iot

Repository files navigation

Orcc-IoT

Orcc-IoT is an adaptation of the Open RVC-CAL Compiler to IoT system design. The motivation of the project is described in this paper. This repository contains Orcc-IoT code, example projects and enough instructions to get you started.

The rest of this document deals with the installation and basic configuration of Orcc-IoT. The following table links to additional documents that guide you in dataflow-based application design after you installed Orcc-IoT.

Prerequisites

Note that Orcc-IoT was successfully deployed on different versions of Eclipse but a new Eclipse release normally requires recompilation. In order to adapt to a different Eclipse version, edit orcc/eclipse/plugins/pom.xml and update this line <url>http://download.eclipse.org/releases/2020-12</url> with the P2 repository of the Eclipse version in question.

Compile & install

cd orcc/eclipse/plugins

mvn package

Launch Eclipse, then select Help/Install new software. Click on the Add button, select Local then select the orcc/eclipse/plugins/net.sf.orcc.site/target/repository subdirectory. Select the Orcc package and go ahead with the installation using the Install new software wizard.

Import the examples

In Eclipse, click File/Import/Existing Projects into Workspace. Click the Select root directory option then select the examples/xcf/ahu-simple directory. Import the project in that directory then go into the src folder of the project and open HVACExample-simple.xdfdiag. You should see something like this:

example-network

Generating and running example code

The example projects demonstrate Orcc-IoT's ability to cut the signal-flow graph into partitions and to generate executable code for each partition. Implementation language/software stack for each partition may be different. The partitions - hence the architecture of the target system - are described by the XCF file whose structure is specified in the paper. In short, the XCF file specifies the computing elements of the target systems, the expected implementation language/stack for each partition and the connections among the partitions. The existing code generators do not use the connection information contained in the XCF file.

The project provided the following code generators suitable for IoT implementations.

  • C code generator that creates code with Linux library dependencies
  • Plain Java code generator suitable for edge devices
  • Java code generator with Spring flavor supporting Azure cloud deployment suitable for server functionality

Configuring the Azure deployment

Prerequisites:

You also have to give Docker sudo rights.

In order to enable the integration between the Spring/Java code generator and the Azure cloud, several configuration values must be provided. Orcc-IoT currently requires inserting these values into the azurecreds.properties file. An example version of this file has been provided in the project with the name of src/azurecreds.properties.example. Make a copy of this file as src/azurecreds.properties.

Then edit the scripts/azure_create_acr.sh shell script and replace the configuration values (RESOURCE_GROUP ... COSMOSDB_ACCOUNT_NAME) with your identifiers. Then execute the script:

az login

./azure_create_acr.sh

This will create the artifacts in the Azure cloud that the Spring/Java code generator relies on. The script also dumps keys and connection strings that you have to insert into your version of azurecreds.properties. Make sure that you use URL escaping in case of special characters ('/', etc.) when inserting keys to URIs like ampqs:// or mongodb://.

Generating the code

The multi-node code generation is performed by the IoT heterogeneous compiler backend. This backend parses the XCF file and invokes the appropriate backends for each node.

Let's see an example that exercises the C and the Spring/Java code generator.

Right-click on str_ahu_c.xcf in the example project and click on Run as/Run configurations. Fill the dialog like the following (use an output folder that suits your directory structure).

run-configurations

Click on the Run button and the IoT compiler will invoke the C backend twice and the Spring/Java code generator once and will generate 3 software projects under the output folder's partitions subdirectory.

Compiling/deploying the partitions

Enter the partitions/server_0 subdirectory then do:

az login

mvn install

This will compile the Spring/Java server module, create the necessary queues (event hubs in Azure parlance), create a Docker build and deploy that Docker image into the Azure cloud.

Log in to the Azure portal and look for the container instances resource called hvacexamplesimplesubnetwork2. Under the Properties menu item, you will find the public IP address of the container instance.

Now enter both the fan_power and the air_temp_0 subdirectories and compile the C projects in each.

Prerequisites:

cmake .

make

Start the C instances as:

bin/subnetwork1 <IP address>:8080

bin/subnetwork3 <IP address>:8080

where is the public IP address of the container instance you noted in the previous step.

If everything worked correctly, air_temp_0 instance sends data to the cloud instance and fan_power instance receives data from the cloud instance.

Additional resources:

  1. Basic concepts of ORCC-IoT
  2. Compile with ORCC-IoT
  3. Native Actors
  4. Native Actor Implementation

About

A signal-flow IoT code generator prototype based on the Orcc design environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published