Skip to content

EN: ELSA Installation

Christophe Dupriez edited this page Jan 2, 2019 · 8 revisions

Pre-requisite

If installing ELSA on a Raspberry Pi, please follow these instructions to configure it.

Python >= 2.7.8. Recommended : >= 2.7.13

Prepare directories

Using the main user executing programs launched at startup (for example "pi" for the RaspberryPi):

cd
mkdir akuino
cd akuino
git clone https://github.com/AKUINO/ELSA.git
git clone https://github.com/AKUINO/AKUINO-Hardware.git
mv AKUINO-Hardware hardware

Install dependencies

sudo apt-get install owfs ow-shell rrdtool
sudo apt-get install python-dev python-pip python-rrdtool python-ownet
sudo pip2 install unicodecsv web.py pyownet pySerial python-levenshtein pyBarcode ConfigParser argparse

Also install GRAFANA too, if you wish nice graphs...

sudo apt-get install grafana

Please also make sure that "(python-)serial" and "(python-)barcode" are not installed (either by pip2 or apt-get) as they compete with pySerial and pyBarcode in defining modules "serial" and "barcode".

OWFS configuration

You probably will have to specify how your 1-wire devices can be accessed (USB, I2C...)

    sudo nano /etc/owfs.conf

The file is rather self-documenting. We recommend for a PC (on RaspberryPi, I2C interface is most often used, not USB: device=/dev/i2c-1):

    # FAKE devices commented out
    ...
    server: usb = all
    ...
    mountpoint = /mnt/1wire
    allow_other

FUSE configuration may be updated too:

sudo nano /etc/fuse.conf :

In this file, just uncomment user_allow_other

Restart OWFS:

sudo service owserver restart

Type owdir to verify that 1-Wire is running adequately.

Hardware configuration

In ~/akuino/hardware, you should create a .ini file with the same name than your computer or (more dangerous) modify DEFAULT.ini. This file partially self documents the available options but documentation needs to be improved.

Execution priviledges

ELSA allows to shutdown (or reboot) the computer. To execute shutdown via sudo you need to edit a special file:

  1. Execute sudo visudo

  2. Add one line at the end of the opened file :

    pi      ALL = NOPASSWD: /sbin/shutdown
  • Replace pi above by the user name executing ELSA.

Auto-launch at startup

Create a file (for instance on Desktop)to be executed at every startups of the computer.

    nano ~/Desktop/ELSA.sh

with the following content (adapt file paths or port numbers along your needs):

    #!/bin/sh
    cd ~/akuino/ELSA
    #autorize python2 to bind on port "80" of TCP/IP network:
    sudo setcap 'cap_net_bind_service=+ep' /usr/bin/python2.7
    /usr/bin/python2.7 ELSA/elsa_web.py 80

The file must be made executable:

    chmod +x ~/Desktop/ELSA.sh

Finally, for the RaspberryPi, add a line to the file /home/pi/.config/lxsession/LXDE-pi/autostart to execute the script at startup:

    /home/pi/Desktop/ELSA.sh

On Ubuntu, press Alt-F2 and start the manager gnome-session-properties, choose to add a program and specify the path /home/pi/Desktop/ELSA.sh

Other session managers have a file where to add programs launched at startup.