Skip to content

Commit

Permalink
remove manual_install.md, update docs, update setup.py and add exampl…
Browse files Browse the repository at this point in the history
…es for crontab and move_file.sh into add_files.
  • Loading branch information
alaudet committed Oct 19, 2014
1 parent f5ede72 commit 92087aa
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 191 deletions.
17 changes: 10 additions & 7 deletions conf/raspisump.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ critical_distance = 35
# bottom of the sump pit.
pit_depth = 72


# Raspisump.py should be run with a cron job. However cron is limited to
# rsump.py should be run with a cron job. However cron is limited to
# 1 minute as its minimum interval. If you need to monitor the sump level
# more frequently you can set reading_interval to the desired time and
# replace the raspisump.py file with raspisump_alternate.py. Don't forget
# to actually rename raspisump_alternate.py to raspisump.py.
# The interval in seconds at which raspi-sump will take water readings
# reading_interval = 30
# more frequently you can set reading_interval to the desired time in seconds.
# Default is 0 meaning only one reading will occur and the program will exit.
# If set to 0 call the script with a cron job and select your interval there.
# If setting to a value other than 0 you should run checkpid.py from a cron
# job at a regularly interval to monitor the health of the rsump.py process.
reading_interval = 0

# This will adjust the speed of sound to reflect the following temperature.
# Set this to the normal Celcius temperature of your basement.
temperature = 20

[email]
# SMTP Server requires authentication (0=No, 1=Yes)
Expand Down
3 changes: 2 additions & 1 deletion cron/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Any cron jobs required will be put here.

1 - example crontab for pi user.
1 - picrontab (Example crontab for pi user)
2 - move_file.sh (Example for handling offsite files)
2 changes: 1 addition & 1 deletion cron/picrontab
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*/1 * * * * sudo /usr/local/bin/raspisump.py
*/1 * * * * sudo /usr/local/bin/rsump.py
59 * * * * * /home/pi/raspi-sump/move_file.sh

# if running raspisump as a continuous process run checkpid.py every 5 minutes
Expand Down
7 changes: 3 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Installation Methods
====================
Configuration
=============

1) to install with PIP read automated_install.md
View automated_install.md for configuration instructions.

2) to install manually read manual_install.md
25 changes: 13 additions & 12 deletions docs/automated_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ The /home/pi/raspi-sump folder is setup as follows on install;

All scripts associated to Raspisump are installed as follows;

* /usr/local/bin/raspisump.py
* /usr/local/bin/raspisump_alternate.py
* /usr/local/bin/rsump.py
* /usr/local/bin/todaychart.py
* /usr/local/bin/checkpid.py

Expand Down Expand Up @@ -81,15 +80,15 @@ Starting Raspi-Sump
===================
To start raspi-sump manually issue the command;

sudo raspisump.py
sudo rsump.py

To run raspisump at 1 minute intervals enter the following line in crontab as follows;

1 - crontab -e

2 - enter line in crontab as follows;

1 * * * * sudo /usr/local/bin/raspisump.py
1 * * * * sudo /usr/local/bin/rsump.py

3 - Save crontab

Expand All @@ -100,27 +99,29 @@ To run raspisump at 1 minute intervals enter the following line in crontab as fo

tail -f 'csvlogfilename'

If running as a continuous process (raspisump_alternate.py)
===========================================================
If running as a continuous process
==================================

1) set reading_interval in raspisump.conf to desired interval (e.g. reading_interval = 30)
1) set reading_interval in raspisump.conf to desired interval in seconds (e.g.
reading_interval = 30). The default setting is 0 which will not run rsump.py as
a continuous process.

2) Add checkpid.py to crontab (see next section)

3) To start Raspi-Sump on bootup add the following line at the end of /etc/rc.local just before the line 'exit 0'

/usr/local/bin/raspisump_alternate.py &
/usr/local/bin/rsump.py &

5) Reboot your Raspberry Pi or run the following command. Your pi will run
Raspi-Sump on boot from now on.

sudo raspisump_alternate &
sudo rsump.py &

Note*** Do not forget the ampersand '&' as this will run the script as a background process.

6) To stop Raspi-Sump:

sudo killall 09 raspisump_alternate.py
sudo killall 09 rsump.py

7) To monitor the log file in the csv folder while raspi-sump is running;

Expand All @@ -129,7 +130,7 @@ Note*** Do not forget the ampersand '&' as this will run the script as a backgro
Health check with checkpid.py. If checking level more than once per minute only.
================================================================================

To check for the health of the raspisump_alternate.py process run the checkpid.py script as root
To check for the health of the rsump.py process run the checkpid.py script as root
Add to pi user crontab as follows;

1 - crontab -e
Expand All @@ -140,7 +141,7 @@ Add to pi user crontab as follows;

3 - Save crontab

This will check the raspisump_alternate.py process every 5 minutes and restart it if it is stopped.
This will check the rsump.py process every 5 minutes and restart it if it is stopped.


Making Line Charts of Sump Activity
Expand Down
164 changes: 0 additions & 164 deletions docs/manual_install.md

This file was deleted.

6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup
import os
version = '0.4.0.beta1'
version = '0.4.0.dev2'

homedir = '/home/pi/raspi-sump/'

Expand All @@ -20,10 +20,12 @@
(homedir + 'charts', ['conf/charts/README.md']),
(homedir + 'docs', ['docs/README.md']),
(homedir + 'docs', ['docs/automated_install.md']),
(homedir + 'docs', ['docs/manual_install.md']),
(homedir + 'simulations', ['simulations/README.md']),
(homedir + 'simulations', ['simulations/sim-pump-fail.py']),
(homedir + 'simulations', ['simulations/sim-pump-working.py']),
(homedir + 'cron', ['cron/README.md']),
(homedir + 'cron', ['cron/move_file.sh']),
(homedir + 'cron', ['cron/picrontab']),
]

setup(name='raspisump',
Expand Down

0 comments on commit 92087aa

Please sign in to comment.