Commit Graph

14 Commits

Author SHA1 Message Date
Wizznu e1628ef4db Upload Tugas Akhir TKK 2026-07-09 09:49:35 +07:00
Wizznu b8cb7a3ba6 fix: Turn OFF pot and pumps atomically together to prevent pressure issues in hose 2026-06-02 08:40:16 +07:00
Wizznu 206117d26a fix: Turn OFF pumps during break between pots to save power 2026-06-02 08:20:34 +07:00
Wizznu f9e89fe826 fix: Ensure sequential watering by adding explicit OFF for other pots and increased delays 2026-06-02 08:10:01 +07:00
Wizznu e666c1ddea feat: Change watering mode from parallel to sequential (bergiliran) with 30s break between pots 2026-06-02 07:50:05 +07:00
Wizznu 789f80ffe0 🛠️ IMPROVE: Add retry logic and better error handling for mosvet trigger
- Add retry logic (3x attempts) to updateFirebaseSmart() for better stability
- Add Firebase verification to confirm mosvet updates actually wrote to database
- Add exponential backoff (1s, 2s, 3s) between retry attempts
- Improve error logging with full error stack traces
- Add critical alerts when safety OFF fails (potential stuck mosvet)
- Better validation of kontrol config with NULL checks
- Enhanced diagnostics for all updateFirebaseSmart calls
- Ensure pump stops are retried if initial attempt fails

This fixes issues where mosvet would not trigger despite logs showing 'success'
2026-04-10 12:55:07 +07:00
Wizznu 568c4dd981 🐛 FIX: Firebase path jadwal notification - changed kontrol_1 to kontrol
- Worker was reading from /kontrol_1 but data stored at /kontrol
- This caused worker to not find any scheduled watering jadwal
- Fixed to match Flutter app which uses /kontrol path
- Result: Scheduled watering notifications will now trigger correctly
2026-04-10 12:33:36 +07:00
Wizznu a02827897c chore(railway): update worker and add history migration script 2026-03-26 18:27:01 +07:00
Wizznu b361463b9d railway-worker: set auto-log 30m and cleanup retention 10 days 2026-03-24 23:05:20 +07:00
Wizznu 6c3b2f3112 feat: Complete ApsGo hydroponics system with multiple features
Features implemented:
- Dashboard with real-time sensor monitoring (temp, humidity, light, soil moisture)
- Water flow status indicator with color coding
- Time-based scheduling (Kontrol Waktu/Jadwal)
- Sensor-based threshold control (Kontrol Sensor/Threshold)
- Smart mode with auto-stop when target reached
- Three pump controls: Air, Larutan Nutrisi, Pengaduk
- Manual control for all actuators
- History/logging system
- Firebase Realtime Database integration
- Railway worker backend service

UI/UX improvements:
- Material Design 3 components
- Badge indicators for active pumps
- Conditional rendering (show only when active)
- Responsive layouts with Wrap widgets
- Color-coded status indicators

Backend fixes:
- Fixed water_flow reading from Firebase
- Fixed threshold model copyWith method
- Added pompa_pengaduk support across all models
- Smart mode with per-pot independent monitoring
- Cooldown per-threshold (not per-pot)
- Valves stop together when targets reached

Renamed: All 'Pupuk' references to 'Larutan Nutrisi Cair'
2026-02-18 08:10:43 +07:00
Wizznu 1224c8e867 feat: Threshold-based sensor system with unlimited threshold configs
- NEW: Flexible threshold system (threshold_1, threshold_2, ... unlimited)
- Each threshold: batas_bawah, batas_atas, durasi, smart_mode, pot_aktif[]
- Smart mode: siram sampai batas_atas tercapai
- Fixed mode: siram sesuai durasi tetap
- ThresholdModel: Complete model with validation
- ThresholdService: CRUD operations for threshold management
- ThresholdManagementPage: UI untuk list dan manage threshold
- ThresholdFormPage: Add/edit form dengan slider dan pot selection
- Worker.js: Dynamic threshold_* detection and processing
- Navigation: Sensor button now goes to ThresholdManagementPage
- Firebase: Auto-setup script with example threshold data (threshold_1, threshold_2, threshold_3)
- Path: All threshold data stored in /kontrol_1
2026-02-16 12:30:13 +07:00
Wizznu abef985a11 APSGO V2.1 NEW APS 2026-02-16 11:40:41 +07:00
Wizznu 09ee9ea516 feat: Complete ApsGo system with Railway Worker automation
- Real-time scheduling system working with 20s delay per section
- 1 schedule time controls multiple pumps simultaneously
- Railway Worker with Firebase SDK + REST API fallback
- Timeout handling and job queue management
- Comprehensive documentation and troubleshooting guides
- Flutter mobile app with dual mode (manual + auto scheduling)
2026-02-11 17:17:22 +07:00
Wizznu de5ce25f57 feat: Add Railway Worker, bug fixes, and mosvet_8 pengaduk
 New Features:
- Railway Worker for 24/7 automation (Node.js + BullMQ + Redis)
- Connection monitoring service
- Automation constants for centralized config
- History logging service with auto cleanup
- Mosvet_8 pengaduk support in kontrol page and Firebase

🐛 Bug Fixes:
- Fixed StreamSubscription memory leak in dashboard_page
- Added AppLifecycle observer for proper service management
- Fixed race conditions with Redis queue
- Improved error handling and user feedback
- Better connection status monitoring

📚 Documentation:
- DEPLOYMENT_GUIDE.md - Complete Railway deployment guide
- BUGS_AND_FIXES.md - Bug report and fixes summary
- RAILWAY_QUICK_START.md - Quick reference guide
- IMPLEMENTATION_COMPLETE.md - Complete implementation summary
- FULL_HISTORY_SYSTEM.md - History system documentation

🔧 Code Changes:
- lib/main.dart - Added AppLifecycleObserver
- lib/screens/dashboard_page.dart - Fixed memory leak
- lib/screens/histori_page.dart - Full Firebase integration
- lib/screens/kontrol_page.dart - Added pengaduk (mosvet_8)
- lib/services/firebase_database_service.dart - Added mosvet_8, history methods
- lib/services/kontrol_automation_service.dart - Use constants, connection check
- lib/services/automation_constants.dart - NEW centralized constants
- lib/services/connection_monitor_service.dart - NEW connection monitoring
- lib/services/history_logging_service.dart - NEW auto logging service
- railway-worker/ - NEW complete worker implementation

Status:  Production Ready
2026-02-10 07:22:43 +07:00