jsproull / kriek

Kriek is the easiest to use brewing control software for the raspberry pi.
GNU General Public License v2.0
17 stars 6 forks source link

Install help #12

Open mikehickey opened 9 years ago

mikehickey commented 9 years ago

Dear John

Father Christmas brought me a pi this year! I have the intention of automating my a beer stand and fermentor with your excellent looking software. I think it will suit my current setup and brew method perfectly. I'm new to the pi so excuse my probably stupid question. I'll summarise may steps so far. 1) full format an sd card and install raspian via noobs- works great. 2) execute your auto install sh command from terminal window- lots then happens for about 10 minutes. 3) reboot the pi to terminal screen. 4) identify my pi IP address 5) try and log into http://myipaddress .6) I get an nginx error message. It at that point I'm stuck ! Do I need to execute any other command or script after the reboot?. As an alternative method I have also tried too burn the alpha2 image to sd card using win32diskimager but have failed there as well. Lots gets written onto the sd card but the pi won't boot from it. Sorry for my ignorance any any words of wisdom would be much appreciated . All the best and happy brewing Mike Liverpool uk

jsproull commented 9 years ago

Hey Mike,

There have been reports of issues with the auto install sh with the latest versions of some of the linux packages. I have been way too busy to really look at, but that being said I'd suggest just writing the pre-built alpha 2 image available here: https://github.com/jsproull/kriek/releases to the sd card and booting off of it.

I'm really going to try to find some time to update kriek. I have actually be reworking it so it should be alot faster.. Ironically it's taking me a long time to get that done. :)

Cheers, John

On Mon, Jan 5, 2015 at 4:46 PM, mikehickey notifications@github.com wrote:

Dear John

Father Christmas brought me a pi this year! I have the intention of automating my a beer stand and fermentor with your excellent looking software. I think it will suit my current setup and brew method perfectly. I'm new to the pi so excuse my probably stupid question. I'll summarise may steps so far. 1) full format an sd card and install raspian via noobs- works great. 2) execute your auto install sh command from terminal window- lots then happens for about 10 minutes. 3) reboot the pi to terminal screen. 4) identify my pi IP address 5) try and log into http://myipaddress .6) I get an nginx error message. It at that point I'm stuck ! Do I need to execute any other command or script after the reboot?. As an alternative method I have also tried too burn the alpha2 image to sd card using win32diskimager but have failed there as well. Lots gets written onto the sd card but the pi won't boot from it. Sorry for my ignorance any any words of wisdom would be much appreciated . All the bes t and happy brewing Mike Liverpool uk

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12.

mikehickey commented 9 years ago

Hi john

Many thanks for your speedy reply. I do appreciate the reply and the hours of hard work that must go into creating something like kreik for fellow brewers. Ill have another play around with the sd image in the next day or two. Im on a steep learning curve and havent really messed around in a terminal window since the days of floppy diks and early ms dos ! All the best and cheers

Mike

Sent from my iPad

On 5 Jan 2015, at 22:39, John Sproull notifications@github.com wrote:

Hey Mike,

There have been reports of issues with the auto install sh with the latest versions of some of the linux packages. I have been way too busy to really look at, but that being said I'd suggest just writing the pre-built alpha 2 image available here: https://github.com/jsproull/kriek/releases to the sd card and booting off of it.

I'm really going to try to find some time to update kriek. I have actually be reworking it so it should be alot faster.. Ironically it's taking me a long time to get that done. :)

Cheers, John

On Mon, Jan 5, 2015 at 4:46 PM, mikehickey notifications@github.com wrote:

Dear John

Father Christmas brought me a pi this year! I have the intention of automating my a beer stand and fermentor with your excellent looking software. I think it will suit my current setup and brew method perfectly. I'm new to the pi so excuse my probably stupid question. I'll summarise may steps so far. 1) full format an sd card and install raspian via noobs- works great. 2) execute your auto install sh command from terminal window- lots then happens for about 10 minutes. 3) reboot the pi to terminal screen. 4) identify my pi IP address 5) try and log into http://myipaddress .6) I get an nginx error message. It at that point I'm stuck ! Do I need to execute any other command or script after the reboot?. As an alternative method I have also tried too burn the alpha2 image to sd card using win32diskimager but have failed there as well. Lots gets written onto the sd card but the pi won't boot from it. Sorry for my ignorance any any words of wisdom would be much appreciated . All the bes t and happy brewing Mike Liverpool uk

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12.

— Reply to this email directly or view it on GitHub.

deba82de commented 9 years ago

Hello! I've tried a complete new installation of kriek on a fresh formatted SD card with the current wheezy raspbian (2014-12-24) release. Some of my performed commands were different to these described in the readme file:

sudo apt-get install libpq-dev python-dev postgresql-server-dev-9.1 postgresql postgresql-contrib nginx supervisor python-virtualenv -y sudo mkdir /opt/kriek sudo chown pi /opt/kriek virtualenv /opt/kriek/env-kriek

(I think the following command is necessary to activate the virtual-env) source /opt/kriek/env-kriek/bin/activate

cd /opt/kriek/env-kriek/bin/ ./pip install django==1.6 gunicorn psycopg2 django-suit djangorestframework south celery django-celery ./pip install wiringpi

sudo su - postgres createdb kriek psql -d kriek -c "CREATE user pi with password 'pi';" psql -d kriek -c "GRANT ALL PRIVILEGES ON DATABASE kriek to pi;"; exit

cd /opt/kriek/ git clone https://github.com/jsproull/kriek.git

In /opt/kriek/kriek/kriek/settings.py 'south' is commented out by a #, as mentioned by yappco in #9. This # needs to removed.

cd /opt/kriek/kriek ./manage.py syncdb create a user named 'pi' with password 'pi'

./manage.py schemamigration common --initial ./manage.py schemamigration brew --initial ./manage.py schemamigration ferm --initial ./manage.py schemamigration globalsettings --initial ./manage.py schemamigration status --initial

./manage.py migrate common ./manage.py migrate brew ./manage.py migrate ferm ./manage.py migrate globalsettings ./manage.py migrate status sudo ./manage.py collectstatic

sudo cp -R /opt/kriek/kriek/conf/ngnix/* /etc/nginx/ sudo cp -R /opt/kriek/kriek/conf/supervisor/conf.d/* /etc/supervisor/conf.d/

sudo sh -c "echo 'w1_gpio\nw1_therm\n' >> /etc/modules"

Regards, Dennis

adaptiman commented 8 years ago

Howdy John!

I've followed all of the steps to install on the latest Raspbian (including the modified steps listed by Dennis) and I get the NGINX splash screen - no application. Any suggestions?

David

jsproull commented 8 years ago

Hey David,

It sounds like gunicorn might not be running or that the nginx configuration wasn't copied over correctly. can you verify that the configuration files exist:

/etc/nginx/sites-enabled/kriek and /etc/supervisor/conf.d/gunicorn.conf and /etc/supervisor/conf.d/kriek.conf

That should be a good starting point to trouble shoot this! Cheers John

On Thu, Dec 24, 2015 at 12:12 AM, David Sweeney notifications@github.com wrote:

Howdy John!

I've followed all of the steps to install on the latest Raspbian (including the modified steps listed by Dennis) and I get the NGINX splash screen - no application. Any suggestions?

David

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-167043523.

adaptiman commented 8 years ago

John:

All of the files exist. Gunicorn is listening on 127.0.0.1:8000. Could this be the problem?

thanks,

d

Here's the gunicorn.conf file:

[program:gunicorn]
environment=PATH="/opt/kriek/env-kriek/bin"
command = /opt/kriek/env-kriek/bin/gunicorn kriek.wsgi:application -w 4 --timeout=300 --bind 127.0.0.1:8000
directory = /opt/kriek/kriek/
user = pi
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/gunicorn.log
stderr_logfile = /var/log/supervisor/gunicorn_err.log

Here's kriek.conf:

[program:kriek]
environment=PATH="/opt/kriek/env-kriek/bin"
command = /opt/kriek/env-kriek/bin/python /opt/kriek/kriek/daemon/kriek_local.py
directory =  /opt/kriek/kriek/
user = root
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/kriek.log
stderr_logfile = /var/log/supervisor/kriek_err.log

Here's kriek:

# define an upstream server named gunicorn on localhost port 8000
upstream gunicorn {
    server localhost:8000;
}

# make an nginx server
server {
    # listen on port 80
    listen 80;

    # for requests to these domains
    #server_name <YOUR_DOMAIN>.com www.<YOUR_DOMAIN>.com;

    # look in this directory for files to serve
    root /var/www/;

    # keep logs in these files
    access_log /var/log/nginx/kriek.access.log;
    error_log /var/log/nginx/kriek.error.log;

    # You need this to allow users to upload large files
    # See http://wiki.nginx.org/HttpCoreModule#client_max_body_size
    # I'm not sure where it goes, so I put it in twice. It works.
    client_max_body_size 0;

    # THIS IS THE IMPORTANT LINE
    # this tries to serve a static file at the requested url
    # if no static file is found, it passes the url to gunicorn
    try_files $uri @gunicorn;

    location /static {    
        autoindex on;    
        alias /var/www/static/;    
    }

    # define rules for gunicorn
    location @gunicorn {
        # repeated just in case
        client_max_body_size 0;

        # proxy to the gunicorn upstream defined above
        proxy_pass http://gunicorn;

        # makes sure the URLs don't actually say http://gunicorn 
        proxy_redirect off;

        # If gunicorn takes > 5 minutes to respond, give up
        # Feel free to change the time on this
        proxy_read_timeout 5m;
    proxy_connect_timeout  2m;
    proxy_send_timeout 2m;
    fastcgi_send_timeout 2m;
    fastcgi_read_timeout 2m;

        # make sure these HTTP headers are set properly
        proxy_set_header Host            $host;
        proxy_set_header X-Real-IP       $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
jsproull commented 8 years ago

No, that should be fine and nginx should proxy all the requests over to gunicorn on port 8000 which is running kriek. can you ensure that kriek_local.py is running? (ps -ef). strange times! :)

On Sat, Dec 26, 2015 at 2:24 PM, David Sweeney notifications@github.com wrote:

John:

All of the files exist. Gunicorn is listening on 127.0.0.1:8000. Could this be the problem?

thanks,

d

Here's the gunicorn.conf file:

[program:gunicorn] environment=PATH="/opt/kriek/env-kriek/bin" command = /opt/kriek/env-kriek/bin/gunicorn kriek.wsgi:application -w 4 --timeout=300 --bind 127.0.0.1:8000 directory = /opt/kriek/kriek/ user = pi autostart = true autorestart = true stdout_logfile = /var/log/supervisor/gunicorn.log stderr_logfile = /var/log/supervisor/gunicorn_err.log

Here's kriek.conf:

[program:kriek] environment=PATH="/opt/kriek/env-kriek/bin" command = /opt/kriek/env-kriek/bin/python /opt/kriek/kriek/daemon/kriek_local.py directory = /opt/kriek/kriek/ user = root autostart = true autorestart = true stdout_logfile = /var/log/supervisor/kriek.log stderr_logfile = /var/log/supervisor/kriek_err.log

Here's kriek:

define an upstream server named gunicorn on localhost port 8000

upstream gunicorn { server localhost:8000; }

make an nginx server

server {

listen on port 80

listen 80;
# for requests to these domains
#server_name <YOUR_DOMAIN>.com www.<YOUR_DOMAIN>.com;

# look in this directory for files to serve
root /var/www/;

# keep logs in these files
access_log /var/log/nginx/kriek.access.log;
error_log /var/log/nginx/kriek.error.log;

# You need this to allow users to upload large files
# See http://wiki.nginx.org/HttpCoreModule#client_max_body_size
# I'm not sure where it goes, so I put it in twice. It works.
client_max_body_size 0;

# THIS IS THE IMPORTANT LINE
# this tries to serve a static file at the requested url
# if no static file is found, it passes the url to gunicorn
try_files $uri @gunicorn;

location /static {
    autoindex on;
    alias /var/www/static/;
}

# define rules for gunicorn
location @gunicorn {
    # repeated just in case
    client_max_body_size 0;

    # proxy to the gunicorn upstream defined above
    proxy_pass http://gunicorn;

    # makes sure the URLs don't actually say http://gunicorn
    proxy_redirect off;

    # If gunicorn takes > 5 minutes to respond, give up
    # Feel free to change the time on this
    proxy_read_timeout 5m;
proxy_connect_timeout  2m;
proxy_send_timeout 2m;
fastcgi_send_timeout 2m;
fastcgi_read_timeout 2m;

    # make sure these HTTP headers are set properly
    proxy_set_header Host            $host;
    proxy_set_header X-Real-IP       $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

}

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-167355639.

adaptiman commented 8 years ago
ps -ef | grep kriek
root       553   543  2 19:21 ?        00:01:52 /opt/kriek/env-kriek/bin/python /opt/kriek/kriek/daemon/kriek_local.py
pi         554   543  0 19:21 ?        00:00:03 /opt/kriek/env-kriek/bin/python2 /opt/kriek/env-kriek/bin/gunicorn kriek.wsgi:application -w 4 --timeout=300 --bind 127.0.0.1:8000
pi         562   554  0 19:21 ?        00:00:00 /opt/kriek/env-kriek/bin/python2 /opt/kriek/env-kriek/bin/gunicorn kriek.wsgi:application -w 4 --timeout=300 --bind 127.0.0.1:8000
pi         566   554  0 19:21 ?        00:00:00 /opt/kriek/env-kriek/bin/python2 /opt/kriek/env-kriek/bin/gunicorn kriek.wsgi:application -w 4 --timeout=300 --bind 127.0.0.1:8000
pi         571   554  0 19:21 ?        00:00:00 /opt/kriek/env-kriek/bin/python2 /opt/kriek/env-kriek/bin/gunicorn kriek.wsgi:application -w 4 --timeout=300 --bind 127.0.0.1:8000
pi         575   554  0 19:21 ?        00:00:00 /opt/kriek/env-kriek/bin/python2 /opt/kriek/env-kriek/bin/gunicorn kriek.wsgi:application -w 4 --timeout=300 --bind 127.0.0.1:8000
postgres   588   479  0 19:21 ?        00:00:34 postgres: pi kriek 127.0.0.1(55213) idle                                                                                    
postgres   591   479  0 19:21 ?        00:00:03 postgres: pi kriek 127.0.0.1(55214) idle                                                                                    
postgres   592   479  0 19:21 ?        00:00:03 postgres: pi kriek 127.0.0.1(55215) idle                                                                                    
pi        1645   610  0 20:50 pts/0    00:00:00 grep --color=auto kriek
adaptiman commented 8 years ago

kriek_local.py is running as root. Would that make a difference?

jsproull commented 8 years ago

It has to run as root for the gpio operations so that's fine. It just seems like nginx isn't proxying it correctly. Let me do a quick install on a fresh sd card and I'll see what's up. On Dec 26, 2015 4:06 PM, "David Sweeney" notifications@github.com wrote:

kriek_local.py is running as root. Would that make a difference?

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-167363584.

adaptiman commented 8 years ago

Thank you! I have a PID controlled RIMS setup and want to use your library to control my mash temps. I want to extend it to also control manifold ball valves and burners.

adaptiman commented 8 years ago

Any luck at getting the build to work on a newer Raspbian installation?

jsproull commented 8 years ago

whoops. :) thanks for the gentle reminder. I'll do it today and let you know. sorry.. i blame all the xmas booze.

On Wed, Dec 30, 2015 at 10:25 AM, David Sweeney notifications@github.com wrote:

Any luck at getting the build to work on a newer Raspbian installation?

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-168019016.

jsproull commented 8 years ago

Hey David,

I have fixed up the install instructions on the main readme at https://github.com/jsproull/kriek

do you mind going through and trying it now? There are updated versions of some of the django packages which were causing issues. Also the default nginx site was interfering with the kriek install (that's why you were seeing the default nginx page instead of kriek).

I'm still updating the automatic script here, but the step by step instructions should work fine.

On Wed, Dec 30, 2015 at 10:47 AM, John Sproull john@redmenace.org wrote:

whoops. :) thanks for the gentle reminder. I'll do it today and let you know. sorry.. i blame all the xmas booze.

On Wed, Dec 30, 2015 at 10:25 AM, David Sweeney notifications@github.com wrote:

Any luck at getting the build to work on a newer Raspbian installation?

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-168019016.

thannemann commented 8 years ago

Hi John, I am getting back to playing with this from the first alpha you emailed me. I hope to try a boil with it soon. however I am trying to install and any of the install instructions with ./manage.py

fail with Traceback (most recent call last): File "./manage.py", line 8, in from django.core.management import execute_from_command_line ImportError: No module named django.core.management

is this caused by the changes to they djano update from above?

jsproull commented 8 years ago

Sounds like you haven't done a pip install of the requirements? On Dec 31, 2015 3:01 PM, "thannemann" notifications@github.com wrote:

Hi John, I am getting back to playing with this from the first alpha you emailed me. I hope to try a boil with it soon. however I am trying to install and any of the install instructions with ./manage.py

fail with Traceback (most recent call last): File "./manage.py", line 8, in from django.core.management import execute_from_command_line ImportError: No module named django.core.management

is this caused by the changes to they djano update from above?

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-168239919.

thannemann commented 8 years ago

Thanks John, I had run it but went back and double checked the CLI and noticed I had an error 104 peer reset in the middle of the requirements file. so I have re run the requirements install, and it appears it is working correctly now. l

adaptiman commented 8 years ago

I was able to install the software under the new instructions. Two things;

  1. Git is not installed by default on raspbian, so you may want to add it to the install packages.
  2. Postgres was really gorped up. It was installed with the apt-get, but not running, and the scripts to create weren’t working because the data directory hadn’t been created.

I’ll play with the install and report back. Do you have any documentation for which GPIO pins control the One-Wire bus? I saw that you installed WiringPi. How do I connect the Pi to my devices?

David Sweeney Department of Information Technology Division of Student Affairs Texas A&M University sweeney@tamu.edumailto:sweeney@tamu.edu

From: John Sproull [mailto:notifications@github.com] Sent: Wednesday, December 30, 2015 12:42 PM To: jsproull/kriek kriek@noreply.github.com Cc: Sweeney, David sweeney@tamu.edu Subject: Re: [kriek] Install help (#12)

Hey David,

I have fixed up the install instructions on the main readme at https://github.com/jsproull/kriek

do you mind going through and trying it now? There are updated versions of some of the django packages which were causing issues. Also the default nginx site was interfering with the kriek install (that's why you were seeing the default nginx page instead of kriek).

I'm still updating the automatic script here, but the step by step instructions should work fine.

On Wed, Dec 30, 2015 at 10:47 AM, John Sproull john@redmenace.org wrote:

whoops. :) thanks for the gentle reminder. I'll do it today and let you know. sorry.. i blame all the xmas booze.

On Wed, Dec 30, 2015 at 10:25 AM, David Sweeney notifications@github.com wrote:

Any luck at getting the build to work on a newer Raspbian installation?

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-168019016.

— Reply to this email directly or view it on GitHubhttps://github.com/jsproull/kriek/issues/12#issuecomment-168052609.

jsproull commented 8 years ago

Hey David, good to hear. What version of Raspbian are you running? I'm going to have to go back and have a look again. I also have to fix the admin code since it hasn't been updated properly. My (now old) blog has some information about hooking up the wiringpi http://raspbrew.tumblr.com/ .

I'll spend some more time this week getting the default instructions into a usable state.

On Mon, Jan 4, 2016 at 9:36 AM, David Sweeney notifications@github.com wrote:

I was able to install the software under the new instructions. Two things;

  1. Git is not installed by default on raspbian, so you may want to add it to the install packages.
  2. Postgres was really gorped up. It was installed with the apt-get, but not running, and the scripts to create weren’t working because the data directory hadn’t been created.

I’ll play with the install and report back. Do you have any documentation for which GPIO pins control the One-Wire bus? I saw that you installed

WiringPi. How do I connect the Pi to my devices?

David Sweeney Department of Information Technology Division of Student Affairs Texas A&M University sweeney@tamu.edumailto:sweeney@tamu.edu

From: John Sproull [mailto:notifications@github.com] Sent: Wednesday, December 30, 2015 12:42 PM To: jsproull/kriek kriek@noreply.github.com Cc: Sweeney, David sweeney@tamu.edu Subject: Re: [kriek] Install help (#12)

Hey David,

I have fixed up the install instructions on the main readme at https://github.com/jsproull/kriek

do you mind going through and trying it now? There are updated versions of some of the django packages which were causing issues. Also the default nginx site was interfering with the kriek install (that's why you were seeing the default nginx page instead of kriek).

I'm still updating the automatic script here, but the step by step instructions should work fine.

On Wed, Dec 30, 2015 at 10:47 AM, John Sproull john@redmenace.org wrote:

whoops. :) thanks for the gentle reminder. I'll do it today and let you know. sorry.. i blame all the xmas booze.

On Wed, Dec 30, 2015 at 10:25 AM, David Sweeney < notifications@github.com> wrote:

Any luck at getting the build to work on a newer Raspbian installation?

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-168019016.

— Reply to this email directly or view it on GitHub< https://github.com/jsproull/kriek/issues/12#issuecomment-168052609>.

— Reply to this email directly or view it on GitHub https://github.com/jsproull/kriek/issues/12#issuecomment-168693376.