From 771b9924d9517830b2dcb596e8b6311ef6f504d2 Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Thu, 4 May 2017 23:29:07 +0200 Subject: [PATCH] initialize gpio config. quote escaping --- screenless/bureau/photography/photography.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/screenless/bureau/photography/photography.py b/screenless/bureau/photography/photography.py index 42d1f7e..92e9ea4 100644 --- a/screenless/bureau/photography/photography.py +++ b/screenless/bureau/photography/photography.py @@ -33,8 +33,7 @@ class Photography(Bureau): # set up the gpios for lamp & knobs gpio.init() - gpio.pullup(self.doc_light_pin, 0) # reset pullup state - gpio.pullup(self.doc_light_pin, gpio.PULLDOWN) + gpio.setcfg(doc_light_pin, gpio.OUTPUT) def _doc_light_on(self): @@ -66,15 +65,16 @@ class Photography(Bureau): mjpg = os.path.join(modpath, "..", "..", "lib", "mjpg-streamer", "mjpg-streamer-experimental", "mjpg_streamer") mjpg_dir = os.path.dirname(mjpg) - cmd = mjpg.split() + ["-i", "'input_uvc.so -r 3264x2448 -n'", "-o", "'output_file.so -f /tmp/webcam -d 500 -s 1'"] + cmd = mjpg.split() + ["-i", "input_uvc.so -r 3264x2448 -n", "-o", "output_file.so -f /tmp/webcam -d 500 -s 1"] + print(cmd) proc = subprocess.Popen(cmd, shell=True, env={"LD_LIBRARY_PATH": mjpg_dir}) time.sleep(2) proc.terminate() time.sleep(1) # copy last image to the tmpfile - filelist = os.listdir() + filelist = os.listdir("/tmp/webcam") newest = max(filelist, key=lambda x: os.stat(x).st_mtime) shutil.copyfile(newest, tmpimg.name)