... | ... | @@ -29,7 +29,7 @@ Fire up a shell an login to your ENOSARPI with ssh (Username: pi, password: rasp |
|
|
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
|
|
|
```sh
|
|
|
pi@enosarpi:~/ENOSAR/felix-framework-5.4.0 $ ls -la
|
|
|
total 68
|
|
|
drwxr-xr-x 10 pi pi 4096 Jan 17 09:29 .
|
... | ... | @@ -52,7 +52,7 @@ In this tutorial, we will focos on the `load/` and `enocean_config/` directorys. |
|
|
|
|
|
Let us now start the framework. The output should look like this:
|
|
|
|
|
|
```bash
|
|
|
```sh
|
|
|
pi@enosarpi:~/ENOSAR/felix-framework-5.4.0 $ java -jar bin/felix.jar
|
|
|
____________________________
|
|
|
Welcome to Apache Felix Gogo
|
... | ... | @@ -87,75 +87,26 @@ 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
|
|
|
The next step is to find out the EnOcean ID of our PEHA switch. Press it and have a look at the console ouput. The EnOcean Bundel writes every unknown device to stdou, like here:
|
|
|
|
|
|
```sh
|
|
|
2017-02-28T12:26:12.072 [INFO--org.enosar.service.io.enocean.basedriver.impl.EnOceanBaseDriverENOSAR] Device 0x01846b3d not found.
|
|
|
```
|
|
|
|
|
|
In this setup the org.enosar.core.communication has the id 30. So we stop and start the Bundle with ID 30.
|
|
|
Remember the EnOcean ID *01846b3d*, we will now configure the device through 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.
|
|
|
|
|
|
```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
|
|
|
```
|
|
|
Goto Address Management and enter `pehaswitch` the name into the `Add new address object`
|
|
|

|
|
|
|
|
|
Press add.
|
|
|
|
|
|
Technology is `org.enosar.service.io.enocean` and receiver data must be `0x01846b3d.F60201.button`
|
|
|

|
|
|
|
|
|
Receiver data contains the ID of our EnOcean Device followed by a dot and the the RORG function code followed by the enosardevice button.
|
|
|
|
|
|
Press update and now our ENOSAR PI knows ho to handle the telegrams comming from our PEHA switch device.
|
|
|
|
|
|
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 |
|
|
### Code a EnOcean listener |