A beautiful web-based control system for your Flame Gate project with battery monitoring and servo motor control.
index.html- Beautiful web interface with battery displayweb_server.py- Flask web server to control the projectrun_flame_project.py- Python script to start/stop the FlameOS projecttemp/FlameOS.py- Your main Raspberry Pi control script (fixed servo motor)FlameAPI.py- Original API (replaced by web interface)
# Install Flask if not installed
pip install flask
# Start the web server
python web_server.py
# Open your browser and go to:
# http://localhost:5000# Start the project
python run_flame_project.py start
# Stop the project
python run_flame_project.py stop
# Check status
python run_flame_project.py status- Real-time battery level display
- Three battery types: Main Power, Backup, Sensor
- Dynamic battery level simulation
- Visual battery indicators
- One-click start/stop button
- Real-time status updates
- Beautiful animated interface
- Error handling and feedback
- Servo motor control (fixed duty cycle values)
- LCD display integration
- Buzzer alerts
- Serial communication with Raspberry Pi
- Web Interface: Open
http://localhost:5000in your browser - Start Project: Click the "Start Project" button
- Monitor: Watch battery levels and system status
- Control: The servo motor will respond to 'A' signals
- Stop: Click "Stop Project" when done
- Duty Cycle: Changed from
10to proper values (2.5for 0°,7.5for 90°) - Movement: Complete open-close cycle with proper timing
- Initialization: Servo starts in closed position
- Responsive Design: Works on desktop and mobile
- Real-time Updates: Battery levels update automatically
- Status Feedback: Clear indication of system state
- Error Handling: Graceful error messages
- Python 3.6+
- Flask (
pip install flask) - RPi.GPIO (for Raspberry Pi)
- Serial communication libraries
- ✅ Fixed: Proper duty cycle values (2.5-7.5%)
- ✅ Fixed: Complete movement sequence
- ✅ Fixed: Proper initialization
- Check if Flask is installed:
pip install flask - Ensure port 5000 is available
- Check console for error messages
- Verify
temp/FlameOS.pyexists - Check Python dependencies
- Ensure proper file permissions
Edit the battery levels in index.html:
// Change initial battery levels
<div class="battery-level">85%</div>Modify in temp/FlameOS.py:
# Duty cycle values
p.ChangeDutyCycle(2.5) # 0 degrees (closed)
p.ChangeDutyCycle(7.5) # 90 degrees (open)If you encounter issues:
- Check the console for error messages
- Verify all files are in the correct locations
- Ensure Python dependencies are installed
- Test the servo motor with the fixed code
🔥 Flame Gate System - Smart, Beautiful, Simple!