... | @@ -24,3 +24,138 @@ Insert the sd card an boot your pi. |
... | @@ -24,3 +24,138 @@ Insert the sd card an boot your pi. |
|
|
|
|
|
### Connect to the ENOSAR Pi
|
|
### Connect to the ENOSAR Pi
|
|
|
|
|
|
|
|
Fire up a shell an login to your ENOSARPI with ssh (Username: pi, password: raspberry). The ENOSARPI is configured for DHCP, in this turtorial it got the IP 192.168.1.12.
|
|
|
|
|
|
|
|
ENOSAR uses OSGi an therefore you find the Apache Felix Framework on the pi. Already preinstalled.
|
|
|
|
|
|
|
|
Let us explore what is in the image. Change directory into the ENOSAR dir `/home/pi/ENOSAR/felix-framework-5.4.0` . Here you find the following structure
|
|
|
|
```bash
|
|
|
|
pi@enosarpi:~/ENOSAR/felix-framework-5.4.0 $ ls -la
|
|
|
|
total 68
|
|
|
|
drwxr-xr-x 10 pi pi 4096 Jan 17 09:29 .
|
|
|
|
drwxr-xr-x 4 pi pi 4096 Sep 13 14:20 ..
|
|
|
|
drwxr-xr-x 3 pi pi 4096 Sep 13 14:20 bin
|
|
|
|
drwxr-xr-x 2 pi pi 4096 Jan 17 09:47 bundle
|
|
|
|
drwxr-xr-x 2 pi pi 4096 Sep 13 14:20 conf
|
|
|
|
-rw-r--r-- 1 pi pi 987 Sep 13 14:20 DEPENDENCIES
|
|
|
|
drwxr-xr-x 7 pi pi 4096 Sep 13 14:20 doc
|
|
|
|
drwxr-xr-x 2 pi pi 4096 Sep 13 14:20 enocean_config
|
|
|
|
drwxr-xr-x 37 pi pi 4096 Feb 28 09:37 felix-cache
|
|
|
|
-rw-r--r-- 1 pi pi 11358 Sep 13 14:20 LICENSE
|
|
|
|
-rw-r--r-- 1 pi pi 1095 Sep 13 14:20 LICENSE.kxml2
|
|
|
|
drwxr-xr-x 2 pi pi 4096 Feb 28 09:37 load
|
|
|
|
-rw-r--r-- 1 pi pi 550 Sep 13 14:20 NOTICE
|
|
|
|
-rw-r--r-- 1 pi pi 1322 Feb 28 09:14 permissions.txt
|
|
|
|
drwxr-xr-x 2 pi pi 4096 Feb 28 09:38 store
|
|
|
|
```
|
|
|
|
In this tutorial, we will focos on the `load/` and `enocean_config/` directorys. The load directory contains all our bundles. Later we will upload our application bundle to this file. Every bundle in this folder is autloaded by the framework. The enocean_config directory contains our EnOcean configuration file.
|
|
|
|
|
|
|
|
Let us now start the framework. The output should look like this:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pi@enosarpi:~/ENOSAR/felix-framework-5.4.0 $ java -jar bin/felix.jar
|
|
|
|
____________________________
|
|
|
|
Welcome to Apache Felix Gogo
|
|
|
|
|
|
|
|
g! 2017-02-28 11:43:00.351:INFO::FelixStartLevel: Logging initialized @5208ms
|
|
|
|
2017-02-28 11:43:00.635:INFO:oejs.Server:FelixStartLevel: jetty-9.2.14.v20151106
|
|
|
|
2017-02-28 11:43:00.991:INFO:oejsh.ContextHandler:FelixStartLevel: Started o.e.j.s.ServletContextHandler@32e158{/,null,AVAILABLE}
|
|
|
|
2017-02-28 11:43:00.993:INFO:oejs.Server:FelixStartLevel: Started @5851ms
|
|
|
|
2017-02-28 11:43:01.151:INFO:oejs.ServerConnector:FelixStartLevel: Started ServerConnector@150155c{HTTP/1.1}{0.0.0.0:8080}
|
|
|
|
[INFO] Started Jetty 9.2.14.v20151106 at port(s) HTTP:8080 on context path / [minThreads=8,maxThreads=200,acceptors=1,selectors=2]
|
|
|
|
2017-02-28T11:43:01.683 [INFO--org.enosar.service.io.enocean.basedriver.impl.EnOceanBaseDriverENOSAR] initial host path : /dev/ttyAMA0
|
|
|
|
2017-02-28T11:43:02.574 [ERROR-org.enosar.service.io.enocean.impl.DeviceHandler] Error AddressService is null
|
|
|
|
DEBUG:org.enosar.core.communication 30> new addresserviceaware object
|
|
|
|
INFO:org.enosar.core.auth 23> granting communication access for bundle org.enosar.mgmt.modules to service org.enosar.service.io.http
|
|
|
|
INFO:org.enosar.core.messaging 29> adding subscriber - now containing 6
|
|
|
|
INFO:org.enosar.core.webserver 34> HTTPServiceTracker started
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/user Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/permission Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/update Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register static resource /enosar/ui - bundle20 Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/access Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/module Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/config Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/address Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/message Auth: true
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via / Auth: false
|
|
|
|
INFO:org.enosar.service.datastore.jsonfile 22> mapping service injected
|
|
|
|
DEBUG:org.enosar.core.datastore 26> injecting org.enosar.service.datastore.jsonfile with type persistent
|
|
|
|
INFO:org.enosar.core.communication 30> injected DSS JSONFileDataStoreServiceImpl
|
|
|
|
INFO:org.enosar.service.io.rabbitmq 27> trying to (re)connect to RabbitMQ server...
|
|
|
|
INFO:org.enosar.service.io.rabbitmq 27> ... RabbitMQ connected
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
Attention: currently there is a bug in the AddressService. To resolve it, you have to stop and start the org.enosar.core.communication bundle. Type lb to list all bundles
|
|
|
|
|
|
|
|
```bash
|
|
|
|
lb
|
|
|
|
START LEVEL 1
|
|
|
|
ID|State |Level|Name
|
|
|
|
0|Active | 0|System Bundle (5.4.0)|5.4.0
|
|
|
|
1|Active | 1|M2M Serial RXTX (2.1.9.OrangeLabs)|2.1.9.OrangeLabs
|
|
|
|
2|Active | 1|Apache Felix Bundle Repository (2.0.6)|2.0.6
|
|
|
|
3|Active | 1|Apache Felix Configuration Admin Service (1.8.8)|1.8.8
|
|
|
|
4|Active | 1|Apache Felix EventAdmin (1.4.4)|1.4.4
|
|
|
|
5|Active | 1|Apache Felix File Install (3.5.2)|3.5.2
|
|
|
|
6|Active | 1|Apache Felix Gogo Command (0.16.0)|0.16.0
|
|
|
|
7|Active | 1|Apache Felix Gogo Runtime (0.16.2)|0.16.2
|
|
|
|
8|Active | 1|Apache Felix Gogo Shell (0.10.0)|0.10.0
|
|
|
|
9|Active | 1|Apache Felix Http API (3.0.0)|3.0.0
|
|
|
|
10|Active | 1|Apache Felix Http Base (3.0.6)|3.0.6
|
|
|
|
11|Active | 1|Apache Felix Http Jetty (3.1.6)|3.1.6
|
|
|
|
12|Active | 1|Apache Felix Servlet API (1.1.2)|1.1.2
|
|
|
|
13|Active | 1|Apache Felix Log Service (1.0.1)|1.0.1
|
|
|
|
14|Active | 1|Apache Felix Declarative Services (2.0.2)|2.0.2
|
|
|
|
15|Active | 1|org.enosar.core.types (0.1.2)|0.1.2
|
|
|
|
16|Active | 1|org.enosar.service.io.enocean (0.1.2)|0.1.2
|
|
|
|
17|Active | 1|org.osgi:org.osgi.service.cm (1.5.0.201505202024)|1.5.0.201505202024
|
|
|
|
18|Active | 1|org.osgi:org.osgi.service.enocean (1.0.0.201501061602)|1.0.0.201501061602
|
|
|
|
19|Active | 1|org.osgi:org.osgi.service.event (1.3.1.201505202024)|1.3.1.201505202024
|
|
|
|
20|Active | 1|org.enosar.mgmt.ui (0.1.2)|0.1.2
|
|
|
|
21|Active | 1|org.enosar.core.config (0.1.2)|0.1.2
|
|
|
|
22|Active | 1|org.enosar.service.datastore.jsonfile (0.1.2)|0.1.2
|
|
|
|
23|Active | 1|org.enosar.core.auth (0.1.2)|0.1.2
|
|
|
|
25|Active | 1|org.enosar.core.interfaces (0.1.2)|0.1.2
|
|
|
|
26|Active | 1|org.enosar.core.datastore (0.1.2)|0.1.2
|
|
|
|
27|Active | 1|org.enosar.service.io.rabbitmq (0.1.2)|0.1.2
|
|
|
|
28|Active | 1|org.enosar.mgmt.timer (0.1.2)|0.1.2
|
|
|
|
29|Active | 1|org.enosar.core.messaging (0.1.2)|0.1.2
|
|
|
|
30|Active | 1|org.enosar.core.communication (0.1.2)|0.1.2
|
|
|
|
31|Active | 1|org.enosar.mgmt.modules (0.1.2)|0.1.2
|
|
|
|
32|Active | 1|org.enosar.core.log (0.1.2)|0.1.2
|
|
|
|
33|Active | 1|org.enosar.service.io.http (0.1.2)|0.1.2
|
|
|
|
34|Active | 1|org.enosar.core.webserver (0.1.2)|0.1.2
|
|
|
|
35|Active | 1|org.enosar.core.mapping (0.1.2)|0.1.2
|
|
|
|
```
|
|
|
|
|
|
|
|
In this setup the org.enosar.core.communication has the id 30. So we stop and start the Bundle with ID 30.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
stop 30
|
|
|
|
INFO:org.enosar.core.webserver 34> removed http service /enosar/address
|
|
|
|
g! start 30
|
|
|
|
DEBUG:org.enosar.core.communication 30> created service AddressServiceImpl
|
|
|
|
DEBUG:org.enosar.core.communication 30> new addresserviceaware object
|
|
|
|
DEBUG:org.enosar.core.communication 30> new addresserviceaware object
|
|
|
|
DEBUG:org.enosar.core.communication 30> new addresserviceaware object
|
|
|
|
INFO:org.enosar.core.auth 23> granting communication access for bundle org.enosar.mgmt.modules to service org.enosar.service.io.http
|
|
|
|
DEBUG:org.enosar.core.datastore 26> injecting org.enosar.core.communication with DSS by type persistent
|
|
|
|
DEBUG:org.enosar.core.datastore 26> injecting org.enosar.service.datastore.jsonfile with type persistent
|
|
|
|
INFO:org.enosar.core.communication 30> injected DSS JSONFileDataStoreServiceImpl
|
|
|
|
INFO:org.enosar.core.webserver 34> register servlet via /enosar/address Auth: true
|
|
|
|
|
|
|
|
```
|
|
|
|
Also restart the enocean bundle:
|
|
|
|
```bash
|
|
|
|
g! stop 16
|
|
|
|
INFO:org.enosar.core.auth 23> granting communication access for bundle org.enosar.mgmt.modules to service org.enosar.service.io.http
|
|
|
|
g! start 16
|
|
|
|
2017-02-28T11:49:52.657 [INFO--org.enosar.service.io.enocean.basedriver.impl.EnOceanBaseDriverENOSAR] initial host path : /dev/ttyAMA0
|
|
|
|
INFO:org.enosar.core.messaging 29> adding subscriber - now containing 6
|
|
|
|
DEBUG:org.enosar.core.communication 30> new addresserviceaware object
|
|
|
|
INFO:org.enosar.core.auth 23> granting communication access for bundle org.enosar.mgmt.modules to service org.enosar.service.io.http
|
|
|
|
```
|
|
|
|
|
|
|
|
Know everything should work and we can login into the webinterface. Fire up a browser an goto: http://192.168.1.12:8080. Login with user: admin and password admin. You should now see the webinterface of the ENOSAR Dashboard. |
|
|
|
\ No newline at end of file |