A Unix, Windows, Raspberry Pi Object Speed Camera using python, opencv, video streaming, motion tracking. Includes a Standalone Web Server Interface, Image Search using opencv template match and a whiptail Admin Menu Interface Includes picam and webcam Plugins for motion track security camera configuration including rclone sync script. watch-app allows remotely controller camera configuration from a remote storage service name. Uses sqlite3 and gnuplot for reporting. Recently added openalpr license plate reader support.
I added support for a remote postgres database. I plan to operate multiple cameras on two devices that feed into a single database and will make a webserver that can then just query that single database to generate neat plots.
In order to do that I had to add a few dependencies, primarily psycopg2. I also added python-dotenv to securely store super secret stuff. I developed and tested in the dev container, so it should be good to go but I won't be offended if I made a bonehead mistake.
Thanks for your work on this project. I have reviewed your changes and have a few requests.
If possible db_conn line 40 print statements should be changed to appropriate logging message.
DB_TYPE in db_conn needs to be converted to lowercase since user might input mixed case.
I prefer you move dotenv code out of config.py and move to db_conn.py. Move config.py DB_USER and DB_PASSWORD vars out. Add config.py comment regarding using .env file. I suggest moving logic to db_conn after elif DB_TYPE == 'postgres'. Check for .env file using find_dotenv(). If not found create .env file with required entries with None values. Then error out with message for user to edit the .env file to add progress db user and password to the .env file entries. For additional detail see https://stackoverflow.com/questions/64734118/environment-variable-not-loading-with-load-dotenv-in-linux.
I added support for a remote postgres database. I plan to operate multiple cameras on two devices that feed into a single database and will make a webserver that can then just query that single database to generate neat plots.
In order to do that I had to add a few dependencies, primarily psycopg2. I also added python-dotenv to securely store super secret stuff. I developed and tested in the dev container, so it should be good to go but I won't be offended if I made a bonehead mistake.