|
|
# FREDOSAR Setup
|
|
|
This wiki describes how to set up the FREDOSAR Environment on a Raspberry Pi. Therefore a running image for a Pi must exist
|
|
|
so do [this](https://ressel.fh-salzburg.ac.at/FREDOSAR/Framework/wikis/raspi-setup) step before.
|
|
|
|
|
|
## Replace Security Libraries in Java
|
|
|
To run the org.fredosar.core.crypto Bundle the Security Libiraries of java must be replaced.
|
|
|
Therefore download them [here](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html).
|
|
|
|
|
|
And then copy them to the folder `/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/security` and replace the old ones.
|
|
|
|
|
|
|
|
|
## Deactivate Bluetooth
|
|
|
For using an EnOcean Pi the Bluetooth must be deactivated (only on Raspberry Pi3) because the Bluetooth module is also using the Serial /dev/ttyAMA0.
|
|
|
|
|
|
Open `sudo nano /boot/config.txt` and add at the end
|
|
|
```
|
|
|
dtoverlay=pi3-disable-bt
|
|
|
```
|
|
|
Then stop the service that is using Bluetooth modem with `sudo systemctl disable hciuart`
|
|
|
|
|
|
## Felix
|
|
|
Apache Felix is a community effort to implement the OSGi Framework and Service platform. More information [here](http://felix.apache.org/)
|
|
|
### Install Felix
|
|
|
First you must install the Felix Framework
|
|
|
```
|
|
|
mkdir FREDOSAR //in the home directory
|
|
|
cd FREDOSAR
|
|
|
wget http://www-eu.apache.org/dist//felix/org.apache.felix.main.distribution-5.6.4.tar.gz
|
|
|
tar xfvz org.apache.felix.main.distribution-*.tar.gz
|
|
|
rm org.apache.felix.main.distribution-*.tar.gz
|
|
|
```
|
|
|
The URL for downloading the Felix Framework can change for the newest version see [here](http://felix.apache.org/downloads.cgi) if the link is not working
|
|
|
### Add needed Bundles
|
|
|
To Run the Fredosar Software some Bundles must be added to the `bundle/` Folder in the Felix Framework:
|
|
|
|
|
|

|
|
|
|
|
|
Some of this Bundles are already in the folder and some must be downloaded.
|
|
|
Here is a list of them:
|
|
|
|
|
|
|Name|Link|
|
|
|
|--------|--------|
|
|
|
|org.apache.felix.configadmin|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.configadmin)|
|
|
|
|org.apache.felix.fileinstall|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.fileinstall)|
|
|
|
|org.apache.felix.framework.security|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.framework.security)|
|
|
|
|org.apache.felix.http.api|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.api)|
|
|
|
|org.apache.felix.http.base|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.base)|
|
|
|
|org.apache.felix.http.jetty|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty)|
|
|
|
|org.apache.felix.http.servlet-api|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.servlet-api)|
|
|
|
|org.apache.felix.log|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.log)|
|
|
|
|org.apache.felix.scr|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.scr)|
|
|
|
|org.apache.felix.cm|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.configadmin)|
|
|
|
|org.apache.felix.event|[Download](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.eventadmin)|
|
|
|
|
|
|
### Run Felix
|
|
|
To start the FREDOSAR Service change folder and start the jar file:
|
|
|
```
|
|
|
cd FREDOSAR/felix-framework-5.4.0 (can be different with newer versions)
|
|
|
screen java -jar bin/felix.jar
|
|
|
```
|
|
|
|
|
|
Here are some commands for screen:
|
|
|
Terminate screen with `Crtl+C`
|
|
|
Hide/detach from screen with `Crtl+A D`
|
|
|
Re-attach to screen: `screen -r (pid if multiple sessions are running)`
|
|
|
|
|
|
### Clean Felix
|
|
|
```
|
|
|
rm -rf ~/FREDOSAR/felix-framework-5.4.0/felix-cache
|
|
|
```
|
|
|
|
|
|
### Build all
|
|
|
|
|
|
```
|
|
|
#/bin/bash
|
|
|
dest="/cygdrive/c/osgi/framework/felix-framework-5.4.0/load/ /cygdrive/c/osgi/framework/copy-felix-framework-5.4.0/load"
|
|
|
root="/cygdrive/d/FH/GitLab/FREDOSAR"
|
|
|
prefix="at.entrust.fredosar"
|
|
|
|
|
|
projects="$root/Framework/core/ $root/Framework/mgmt/ $root/Service/io/xmpps/at.entrust.fredosar.service.io.xmpps.client $root/Application/aal/at.entrust.fredosar.application.aal.xmppforwarder $root/Application/aal/at.entrust.fredosar.application.aal.ruleengine $root/Application/tools/at.entrust.fredosar.application.tools.messagingws"
|
|
|
|
|
|
# Functions
|
|
|
BuildProject() {
|
|
|
cd $1;
|
|
|
mvn -q -T 8 clean package
|
|
|
for d in $dest
|
|
|
do
|
|
|
find . -name $prefix.*.jar -type f -exec cp {} $d \;
|
|
|
done
|
|
|
}
|
|
|
|
|
|
for groupdir in $projects
|
|
|
do
|
|
|
read -p "Build and upload $groupdir (y/N)" yna
|
|
|
yna=${yna:-N}
|
|
|
if [ $yna = "y" ]; then
|
|
|
BuildProject $groupdir
|
|
|
fi
|
|
|
done
|
|
|
```
|
|
|
|
|
|
## Install FREDOSAR
|
|
|
Create the folder `loaded` in the Felix Framework and copy all `fredosar.org.core`, `fredosar.org.mgmt` and the needed `fredosar.org.service` Bundles of the FREDOSAR Framework in this folder.
|
|
|
```
|
|
|
cd FREDOSAR/felix-framework-5.4.0
|
|
|
mkdir load
|
|
|
```
|
|
|
|
|
|
Hint: The Bundles `org.fredosar.service.io.mysql`, `org.fredosar.service.io.xmpp` and `org.fredosar.service.messaging.rabbitmq` may won't work because additional servers are needed |
|
|
\ No newline at end of file |