Permalink
Browse files

Fixing TypeError on help message for commandline arguments.

Ignoring directories that could have sensitive data.  Adding directories
for short and longterm storage automatically instead.

Making video capture device a configuration option.
  • Loading branch information...
morphex committed Dec 7, 2018
1 parent ac63f02 commit 42743c4f3785e1e9dd3dbcbd62a46a96f47d4f68
Showing with 18 additions and 4 deletions.
  1. +3 −0 .gitignore
  2. +4 −0 config.py
  3. +11 −4 surveil.py
@@ -0,0 +1,3 @@
# Ignoring directories where sensitive data can be stored
surveil
longterm
@@ -78,3 +78,7 @@
# system will reboot
import random
REBOOT += random.uniform(0.08333, 1)

# Video device images are taken from
DEVICE = '/dev/video0'

@@ -18,8 +18,6 @@

SURVEIL_DIR = 'surveil'

DEVICE = '/dev/video0'

_CWD = os.getcwd()
_INDEX = 0
_INDEX_VIDEO = 0
@@ -61,7 +59,7 @@ def test_dependencies():
smtp_password = ""

if len(sys.argv) != 5:
print("Run as: ./%s %s %s %s %s" % (sys.argv[0], 'email@example.com', 'smtp.outgoing.example.com', 'smtp user' 'smtp password'))
print("Run as: ./%s %s %s %s %s" % (sys.argv[0], 'email@example.com', 'smtp.outgoing.example.com', 'smtp user', 'smtp password'))
print("Use smtp.outgoing.example.com:587 for SMTP port 587, default is 25")
sys.exit(1)

@@ -111,6 +109,14 @@ def message_subject(subject="Surveillance video, surveil started"):
print('message sent')

def start():
try:
os.mkdir("%s/%s" % (_CWD, SURVEIL_DIR))
except FileExistsError:
pass
try:
os.mkdir("%s/longterm" % _CWD)
except FileExistsError:
pass
message_subject(subject="Surveillance video, surveil started")
os.system('mount -t tmpfs -o size=%s none %s/surveil' %
(TMPFS_SIZE, _CWD))
@@ -244,7 +250,8 @@ def mailer():
while 2:
process = subprocess.Popen(['fswebcam', '-S', str(config.SKIP_FRAMES),
'--jpeg', str(95),
'--rotate', str(config.ROTATE), '-d', DEVICE,
'--rotate', str(config.ROTATE),
'-d', config.DEVICE,
'-i', config.INPUT,
'--timestamp', config.STRFTIME,
'-r', config.RESOLUTION,

0 comments on commit 42743c4

Please sign in to comment.