Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

software.raspberrypi

Pascal de Sélys edited this page Dec 19, 2018 · 28 revisions

Raspberry pi

Prerequisites

Configure raspbian

Change options in raspi-config

pi@raspberrypi:~ $ sudo raspi-config

Select "Interfacing" options and enable:

  • I2C
  • SSH

Select "Update" for update OS

Installation

Save you sd card 😏 use log2ram (1)

pi@raspberrypi:~ $ curl -Lo log2ram.tar.gz https://github.com/azlux/log2ram/archive/master.tar.gz
pi@raspberrypi:~ $ tar xf log2ram.tar.gz
pi@raspberrypi:~ $ cd log2ram-master 
pi@raspberrypi:~ $ chmod +x install.sh && sudo ./install.sh
pi@raspberrypi:~ $ cd ..
pi@raspberrypi:~ $ rm -r log2ram-master

Modify line "Before=" and add nginx.service

pi@raspberrypi:~ $ nano /etc/systemd/system/log2ram.service

piclog2ram

Install openbox (2)

pi@raspberrypi:~ $ sudo apt-get install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox

Install firefox and chromium (chromium will used only for the tests)

pi@raspberrypi:~ $ sudo apt-get install firefox chromium-browser

Install supervisor

pi@raspberrypi:~ $ sudo apt install supervisor

Install python 3

pi@raspberrypi:~ $ sudo apt install python3.5

Install virtualenv

pi@raspberrypi:~ $ sudo apt install python3-virtualenv 

Install nginx

pi@raspberrypi:~ $ sudo apt install nginx

clone the repository

pi@raspberrypi:~ $ git clone https://github.com/scwall/cocktail_engine.git

Configuration

Openbox Configuration (2)

pi@raspberrypi:~ $ sudo nano /etc/xdg/openbox/autostart

and replace its content with the following:

# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms
# Start firefox
firefox

.bash_profile Configuration (2)

pi@raspberrypi:~ $ sudo nano .bash_profile

add line

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor`

Firefox configuration

add all modules in firefox to the folder firefox_addons

nginx configuration

Create file cocktailengine in 'sites-available'

pi@raspberrypi:~ $ sudo touch /etc/nginx/sites-available/cocktailengine

Edit the file cocktailengine

pi@raspberrypi:~ $ sudo nano /etc/nginx/sites-available/cocktailengine

and paste the code below

server {

    listen 14050; server_name ~^.*$;
    root /home/pi/cocktail_engine/;
location /static {
        alias /home/pi/cocktail_engine/static/;
    }
location /media/ {
        alias /home/pi/cocktail_engine/media/;
    }
    location / {
satisfy any;
allow 192.168.0.1/24;
allow 192.168.1.1/24;
allow 127.0.0.1;
deny  all;
        auth_basic "Restricted Content";
        auth_basic_user_file /etc/nginx/.htpasswd;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        proxy_pass http://127.0.0.1:8000;
    }

}

Change the address ip "192.168.0.1" and "192.168.1.1 to your configuration router and the port at your convenience

Create symbolic link between 'site-available' and 'site-enabled'

pi@raspberrypi:~ $ sudo ln -s /etc/nginx/sites-available/cocktailengine  /etc/nginx/sites-enabled/cocktailengine

Source

Clone this wiki locally