Skip to content

How to run

AutoClasse edited this page Jul 1, 2016 · 5 revisions

How to run Hemma on a Raspberry pi with Raspbian

Hemma is dependent of the following Python modules pyserial, passlib, web.py, and python-jose

This modules can be installed in raspbian with the following commands:

sudo apt-get install python-serial

sudo apt-get install python-passlib

sudo apt-get install python-webpy

sudo apt-get install python-pip

sudo apt-get install python-dev

sudo pip install python-jose

Get the code this can be done by cloning the git repository with the following command.

First go to the home folder (or any other folder that you prefer).

cd ~

Install git with the following command if not already done

sudo apt-get install git

Then clone with

git clone https://github.com/AutoClasse/Hemma.git

Now we have to create a database this is done with the Python script gentables.py.

python gentables.py

We need to tell Hemma where the mySensor serial gateway can be found. This is done by editing the SERIAL_PORT variable in the file hemmaconfig.py If you use a Arduino connected by an USB cable the serial interface will most likely appears as "/dev/ttyACM0".

SERIAL_PORT = "/dev/ttyACM0"

When you editing the file hemmaconfig.py you can also change the JWT_KEY to some random string.

now we can start Hemma with the following command

python hemma.py&

check the log file gateway.log the commands recived by the gateway will be printed in the log file if the serial port is correct configured.

To be able to log in to the web page we need to create a user this is done by

python adduser.py username password

Start the webserver with the following command:

python hemmaweb.py&

Clone this wiki locally