Apache Edgent is for edge devices to analyze collected data by the device. Apache Edgent is a programming model and micro-kernel style runtime which can be embedded in gateways which makes it easy to process sensor streams on edge devices like Raspberry Pi and run local analytics, then send only useful information to server. Apache Edgent’s old name is Apache Quarks. The tool is excellent for combining Big Data and IoT but the project has horrible documentation. They have updated building and old way of using Ant and Gradle tooling is no longer functional. Developers of Edgent need to create a new workspace instead of reusing Gradle-based Edgent workspaces. Here is How To How To Install Apache Edgent on Raspberry Pi 3 B+.
Edgent communicates with the following message hubs:
- MQTT – The messaging standard for IoT
- Apache Kafka – An enterprise-level message bus
- Custom message hubs
- IBM Watson IoT Platform (cloud-based service on the top of MQTT)
We have Apache Kafka an MQTT as “OPEN & FREE” option. The project is probably developed by IBM on hope of IBM Watson on Raspberry Pi. Do not get angry for less documentation – we are enjoying free stuff. With present version, you actually can avoid installing the thing on Raspberry Pi. Installing on Pi is for fun or demo or fallback or whatever. Most importantly, we can do it on Android devices.
---
How To Install Apache Edgent on Raspberry Pi 3 B+
Please read the guide first before running commands. We have given alternate ways. You probably can practice on virtualbox to test then do in real. I do not think that Apache Edgent is production ready to run on hardware to mess it up.
We are using headless Raspberry Pi. We simply need to fork the Apache Edgent repository. We need to have these additional development software tools :
- Java 7 or Java 8
- Maven : Maven in the form of maven-wrapper or an installed version of Maven.
For developing Edgent applications we can utilize Edgent SDK/runtime jars and package application artifacts for deploying to an edge device or gateway for execution.
We know how to install Maven on Ubuntu server. For Raspberry Pi, you can actually install Maven with apt-get
, however, that will install all kinds of related things we do not need for this job. Of course that is easy.
Update :
1 | apt update -y && apt upgrade -y |
Remove open JDK 7 :
1 | sudo apt-get purge openjdk* |
Install version 8 :
1 | sudo apt-get install oracle-java8-jdk |
To about fuss with Java, you may skip above steps and look at this :
1 | http://pi4j.com/ |
Run :
1 2 3 4 | curl -s get.pi4j.com | sudo bash Then, add this to your bashrc file so it is always set: export PI4J_LIB=/opt/pi4j/lib/ echo "export PI4J_LIB=/opt/pi4j/lib/" >> ~/.bashrc |
Update :
1 | apt update -y && apt upgrade -y |
As we told you, you can install maven
with apt
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | apt install maven<> If you want to install from binary, that way will be like this : <pre> # download latest binary from maven website http://www.mirrorservice.org/sites/ftp.apache.org/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz # extract to /opt cd /opt tar -xzvf /path/to/apache-maven-3.2.5-bin.tar.gz vi /etc/profile.d/maven.sh # add export M2_HOME=/opt/apache-maven-3.2.5 export PATH=$PATH:$M2_HOME/bin # save & quit |
CD somewhere like /home/pi/Downloads
and download the tagged release version :
1 | https://github.com/apache/incubator-edgent |
Your steps will be like below :
1 2 3 4 | tar -xzvf apache-edgent-X.X.X-incubating-XXX.tgz Set EDGENT Home to <edgent_dir>/java8: export EDGENT=<edgent_dir>/java8 echo "export EDGENT=<edgent_dir>/java8" >> ~/.bashrc |
If you want with Maven then install the Edgent Java8 jars in the local maven repository :
1 2 3 4 | ./mvnw clean install # -DskipTests to skip tests # build the Edgent Java 7 and Android platform jars ./mvnw clean install -DskipTests -Pplatform-java7,platform-android ./mvnw clean install -Djava8.home=$JAVA_HOME -Ptoolchain,platform-java7,platform-android |
I felt, that maven way has problem of editing toolchains.xml
. You can read official doc. I bet, at this moment, this is best guide showing ways. I have not done much research on this Apache Edgent, but I am sure that it is interesting to send data to Apache Kafka running on own server.