Trigger to GPIO
This commit is contained in:
+2
-1
@@ -1,2 +1,3 @@
|
|||||||
paho-mqtt>=1.6.1
|
paho-mqtt>=1.6.1
|
||||||
schedule>=1.2.0
|
schedule>=1.2.0
|
||||||
|
flask>=2.0.0
|
||||||
Executable
+29
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Start the Flask web application
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# Check if virtual environment exists, if not create it
|
||||||
|
if [ ! -d "venv" ]; then
|
||||||
|
echo "Creating virtual environment..."
|
||||||
|
python3 -m venv venv
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Activate virtual environment
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
echo "Installing dependencies..."
|
||||||
|
pip install -q -r requirements.txt
|
||||||
|
|
||||||
|
# Check if database exists
|
||||||
|
if [ ! -f "karung_counts.db" ]; then
|
||||||
|
echo "Error: Database karung_counts.db not found!"
|
||||||
|
echo "Please run the frigate_counter.py first to initialize the database."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run the Flask application
|
||||||
|
echo "Starting Flask web application..."
|
||||||
|
echo "Access the dashboard at: http://localhost:5000"
|
||||||
|
python web_app.py
|
||||||
+1
-1
@@ -218,4 +218,4 @@ if __name__ == '__main__':
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# Run Flask app on all interfaces, port 5000
|
# Run Flask app on all interfaces, port 5000
|
||||||
app.run(host='0.0.0.0', port=8898, debug=True)
|
app.run(host='0.0.0.0', port=8080, debug=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user