Dev Device

From AGILE IoT Wiki
Revision as of 08:35, 17 September 2018 by Cskiraly (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Compiling a single device

Sometimes it is necessary to add support for a single device in an already deployed system. Especially when deployment was done using dockerized containers, it is useful to be able to add a device to the system without rebuilding the containers. To add support, follow these steps:

1, Clone agile-core, which also contains the DeviceFactory with device implementations

git clone --recursive https://github.com/Agile-IoT/agile-core

Note: use recursive cloning, or `git submodule update —init`

2, Ensure build environment is installed and JAVA_HOME is set (compilation will fail if JAVA_HOME is unset with "fatal error: jni.h: No such file or directory").

3, Install build dependencies

scripts/install-agile-intefaces.sh

4, Compile the DeviceFactory

cd org.eclipse.agail.DeviceFactory 
mvn package

5, Develop your own device code (e.g. MyDevice.java) based on some of the examples in src/main/java/org/eclipse/agail/device/instance/

6, Compile your own device into java class

javac -extdirs target src/main/java/org/eclipse/agail/device/instance/MyDevice.java

7, Deploy this class in the plugin folder of an existing DeviceFactory