Skip to content

Habarama

AdrianFarmadin edited this page Jan 12, 2018 · 21 revisions

Habarama is a part of the Hogarama Project responsible for collecting data and controlling gadgets. It uses MQTT to interconnect the Raspberries and Hogajama to collect data from sensors.

Architecture

Build

docker build -t habarama Habarama/docker .

NOTE: For Raspberry build please first modify Dockerfile.

Usage

The following command will run Habarama with default configuration on the host machine:

docker run -p 8080:8080 habarama

Visit localhost:8080 to see the result.

NOTE: This is not the preferred method to get Habarama up and running. To properly run the container, please specify the configuration.

docker run \
       -p 8080:8080 \
       -v configuration-dir:/OpenHab/configurations \
       -d \
       habarama

Example configuration

The project repository contains a directory named with example configurations. This directory can be found under Hogarama/Habarama/docker/example and contains following configuration.

System info configuration

This configuration set up single OpenHab instant. The system-info-binding is used to displays informations about running system. The configuration can be found in configurations directory. To use this configuration simply mount this directory in container under /OpenHab/configurations.

docker run -p 8080:8080 -v <path_to_Hogarama>/Habarama/docker/example/configurations:/OpenHab/configurations -d habarama

MQTT configuration

This is an example with two OpenHab nodes connected to mqtt broker. After successful start you can see on each node uptime information from both nodes. First you need to start mqtt broker. Then you muss adjust configuration for both nodes to use the broker. Open mqtt/node1/openhab.cfg in your favorite text editor and on the line 517 replace <brokerIp> with IP address of mqtt broker. Repeat the same procedure for node2.

Start mqtt broker:

docker run -p 1883:1883 -p 9001:9001 -d toke/mosquitto

Start node1:

docker run -p 8080:8080 -v <path_to_Hogarama>/Habarama/docker/example/mqtt/node1:/OpenHab/configurations -d habarama

Start node2:

docker run -p 8090:8080 -v <path_to_Hogarama>/Habarama/docker/example/mqtt/node2:/OpenHab/configurations -d habarama

Raspberry Manual Installation

Raspberry Installation (Step by Step):

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="{SSID}"
        scan_ssid=1
        psk="{PASSWORD}"
        mode=0
        proto=WPA2
        key_mgmt=WPA-PSK
        pairwise=CCMP
        group=CCMP
        auth_alg=OPEN
        id_str="raspi"
        priority=1
}

Troubleshooting

libsigar-arm-linux.so for raspberry

wget http://sourceforge.net/projects/sigar/files/sigar/1.6/hyperic-sigar-1.6.4-src.tar.gz
tar -zxf hyperic-sigar-1.6.4-src.tar.gz
cd hyperic-sigar-1.6.4-src/bindings/java
ant

Path to libsigar-arm-linux.so file: sigar-bin/lib/libsigar-arm-linux.so. To test run: java -jar sigar-bin/lib/sigar.jar.