From 8f9942bc8e763cf4eec9ade571f7acb211d0007c Mon Sep 17 00:00:00 2001 From: Etienne SCHMITZ Date: Thu, 16 Nov 2023 01:41:33 +0000 Subject: [PATCH] fix - fix some issues --- rpi/manager/thymio/manager.py | 2 +- rpi/vision/camera.py | 4 ++-- web/start.sh | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rpi/manager/thymio/manager.py b/rpi/manager/thymio/manager.py index 42ec4c0..d145485 100644 --- a/rpi/manager/thymio/manager.py +++ b/rpi/manager/thymio/manager.py @@ -102,7 +102,7 @@ def run_process(self): print() script_path = f"/home/pi/rosa-master/rpi/mode/{self.tasks[self.current_mode]}" - self.current_process = subprocess.Popen(['python3', script_path]) + self.current_process = subprocess.Popen(['/usr/bin/python3', script_path]) def close(self): diff --git a/rpi/vision/camera.py b/rpi/vision/camera.py index bae9703..f3e0121 100644 --- a/rpi/vision/camera.py +++ b/rpi/vision/camera.py @@ -70,8 +70,8 @@ def _detect_objects_continuously(self): detected_img_path = os.path.join(self.image_dir, 'detected_img.jpg') detected_data_path = os.path.join(self.image_dir, 'detected_data.json') - if self.last_found_obj or time.time() - self.last_detection_time >= 3: - self.last_detection_time = time.time() + if self.last_found_obj or time.time() - last_detection_time >= 3: + last_detection_time = time.time() cv.imwrite(detected_img_path, frame) with open(detected_data_path, 'w') as f: diff --git a/web/start.sh b/web/start.sh index 42562e5..0648a6d 100755 --- a/web/start.sh +++ b/web/start.sh @@ -1,3 +1,5 @@ #!/bin/bash -python3 /home/pi/rosa-master/web/wsgi.py \ No newline at end of file +cd ~/rosa-master/web + +/home/pi/.local/bin/gunicorn -w 2 wsgi:app -b 0.0.0.0:8000 \ No newline at end of file