A full-stack smart agriculture platform combining IoT sensor monitoring, real-time dashboard, and AI-powered pest/disease detection.
- IoT Sensors: ESP32-based sensors stream temperature, humidity, soil moisture, and water depth via MQTT.
- AI Detection: Upload or capture plant images for pest/disease detection using deep learning models.
- Real-Time Dashboard: Mobile app displays live sensor data and AI predictions.
- Socket.IO: Real-time communication between backend and frontend.
- REST API: Endpoints for disease and pest prediction.
elc_summer/
├── server/ # Flask backend, MQTT, AI models, database
├── my-expo-app/ # Expo React Native frontend app
├── mqtt/ # ESP32 Arduino sketch for sensors
- Tech: Flask, Flask-SocketIO, SQLAlchemy, Paho-MQTT, PyTorch, Timm
- Main entry:
server/run.py - Database: PostgreSQL
- Install dependencies:
cd server pip install -r requirements.txt - Configure environment variables in
server/.env:DB_STRING = "postgresql://postgres:yourpassword@localhost:5432/Elc_summer" MQTT_USERNAME = "your_mqtt_user" MQTT_PASSWORD = "your_mqtt_pass" MQTT_HOST = "your_mqtt_host" MQTT_PORT = "8883" - Start PostgreSQL and create the database.
- Run the server:
python run.py
- Tech: React Native (Expo), NativeWind, Socket.IO client, Zustand
- Main entry:
my-expo-app/App.tsx - Pages: Home (dashboard), Manual (image upload/capture for AI detection)
- Install dependencies:
cd my-expo-app npm install - Set API base URL in
my-expo-app/.env:API_BASE_URL = "http://<your-server-ip>:6000" - Start the app:
npx expo start
- Flash the sketch in
mqtt/sketch_jul09b/sketch_jul09b.inoto your ESP32. - Update WiFi and MQTT credentials as needed.
POST /predict/disease— Upload image for disease detection.POST /predict/pest— Upload image for pest detection.
server/run.py: Main backend entry point.server/app/ml/predictor.py: AI model inference.server/app/routes/routes.py: API routes.my-expo-app/src/pages/home.tsx: Dashboard UI.my-expo-app/src/pages/manual.tsx: Manual detection UI.
MIT License
For questions or contributions, open an