diff --git a/assets/support/configdefault.json b/assets/support/configdefault.json index 3699b7d..050ccc6 100755 --- a/assets/support/configdefault.json +++ b/assets/support/configdefault.json @@ -259,12 +259,12 @@ } }, "relay": { - "enabled": true, + "enabled": false, "colors": { "on": [ 255, - 0, - 0 + 128, + 128 ], "off": [ 0, @@ -274,7 +274,7 @@ }, "triggers": { "horn": { - "enabled": true, + "enabled": false, "pin": 0, "invert": false, "text": "HORN" diff --git a/dashcam.py b/dashcam.py index 2a7c539..b2e169f 100755 --- a/dashcam.py +++ b/dashcam.py @@ -252,7 +252,7 @@ def save_dashcam_segments(file1, file2=""): relay_triggers = {} for stamp in config["dashcam"]["stamps"]["relay"]["triggers"]: if (config["dashcam"]["stamps"]["relay"]["triggers"][stamp]["enabled"] == True): # Check to see if this relay stamp is enabled. - relay_trigger[stamp] = Button(int(config["dashcam"]["stamps"]["relay"]["triggers"][stamp]["pin"])) + relay_triggers[stamp] = Button(int(config["dashcam"]["stamps"]["relay"]["triggers"][stamp]["pin"])) def apply_dashcam_stamps(frame, device=""): @@ -307,10 +307,10 @@ def apply_dashcam_stamps(frame, device=""): stamp_number = 0 for stamp in config["dashcam"]["stamps"]["relay"]["triggers"]: if (config["dashcam"]["stamps"]["relay"]["triggers"][stamp]["enabled"] == True): # Check to see if this relay stamp is enabled. - if (relay_trigger[stamp].is_pressed): # Check to see if the relay is triggered. - relay_stamp_color = config["dashcam"]["stamps"]["relay"]["color"]["on"] + if (relay_triggers[stamp].is_pressed): # Check to see if the relay is triggered. + relay_stamp_color = config["dashcam"]["stamps"]["relay"]["colors"]["on"] else: - relay_stamp_color = config["dashcam"]["stamps"]["relay"]["color"]["off"] + relay_stamp_color = config["dashcam"]["stamps"]["relay"]["colors"]["off"] relay_stamp = config["dashcam"]["stamps"]["relay"]["triggers"][stamp]["text"] # Set the relay stamp text to a blank placeholder. Elements will be added to this in the next steps. (label_width, label_height), baseline = cv2.getTextSize(relay_stamp, 2, config["dashcam"]["stamps"]["size"], 1) relay_stamp_position = [width - 10 - label_width, (30 * stamp_number) + round(30 * config["dashcam"]["stamps"]["size"])] # Determine where the diagnostic overlay stamp should be positioned in the video stream. diff --git a/docs/INSTALL.md b/docs/INSTALL.md index c256755..5cd6dee 100755 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -7,7 +7,7 @@ This document contains detailed instructions on how to install Predator. If you're already familiar with Predator, and you just want a quick set-up guide, you can use the following steps to set everything up. For more detailed instructions, skip to the 'Full Install Guide' later in the document. -1. Install Python packages: `pip3 install pytz validators requests gps gpsd-py3 opencv-python cvlib tensorflow keras silence-tensorflow psutil rns lxmf` +1. Install Python packages: `pip3 install pytz validators requests gps gpsd-py3 opencv-python cvlib tensorflow keras silence-tensorflow psutil rns lxmf gpiozero` - If you see an "externally managed environment" error while installing Python packages, consider creating a virtual environment by running the following command in the Predator directory: `python3 -m venv .venv; source .venv/bin/activate` - In the future, you will need to manually start the virtual environment by navigating to the Predator directory and running the following command: `source .venv/bin/activate` - Note that depending on a virtual environment is likely to cause issues if you want to run Predator through Optic, Cortex, or another front-end interface, since these interfaces run outside of the virtual environment. In this case, you should try to install the required Python packages through your operating system's default package manager. @@ -35,6 +35,7 @@ This is the installation process for Predator and all of its dependencies. This - Optional: - `psutil`: Required to process disk usage information in management mode and dash-cam mode. - `lxmf`, `rns`: Required to send offline parking notifications over the Reticulum stack. + - `gpiozero`: Required to trigger events using GPIO inputs. - System packages: `sudo apt-get install ffmpeg mpg321 gpsd gpsd-clients imagemagick fswebcam` - Highly recommended: - `ffmpeg`: Required for audio/video merging in dash-cam mode, and video processing in pre-recorded mode.