Trigger to GPIO

This commit is contained in:
2026-04-07 16:10:59 +07:00
3 changed files with 32 additions and 2 deletions

View File

@@ -1,2 +1,3 @@
paho-mqtt>=1.6.1
schedule>=1.2.0
schedule>=1.2.0
flask>=2.0.0

29
run_web.sh Executable file
View File

@@ -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

View File

@@ -218,4 +218,4 @@ if __name__ == '__main__':
exit(1)
# 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)