Dev Device

From AGILE IoT Wiki
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

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


4, Compile the DeviceFactory

cd org.eclipse.agail.DeviceFactory 
mvn package

5, Develop your own device code (e.g. 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/

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