Skip to content

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍄 MycoTrack — Smart Mushroom Farming & AI Health Monitoring System

MycoTrack is an end-to-end IoT and Deep Learning solution designed for smart mushroom farming. It continuously monitors environmental metrics (temperature, humidity, CO₂ levels), captures high-resolution mushroom bed imagery via IoT edge hardware (ESP32-CAM and Raspberry Pi), and runs real-time computer vision diagnostic models (ResNet-50 / YOLOv8) to detect mushroom diseases and growth health.


📐 System Architecture

graph TD
    subgraph Hardware Tier
        ESP[ESP32-CAM Module]
        PI[Raspberry Pi Camera Node]
    end

    subgraph Cloud Infrastructure - AWS / Firebase
        IoT[AWS IoT Core / MQTT]
        S3[AWS S3 Bucket: mycotrack-images]
        DDB[(AWS DynamoDB)]
        COG[AWS Cognito Auth]
    end

    subgraph AI Inference Backend
        API[FastAPI Backend - realtime_mushroom.py]
        MODEL[PyTorch Model - ResNet50 / YOLOv8]
    end

    subgraph Client Tier
        APP[MycoTrack Expo React Native App]
    end

    ESP -->|Telemetry & Captures| IoT
    PI -->|Upload Image| S3
    PI -->|Publish Scan Event| IoT
    APP -->|Authenticate| COG
    APP -->|Send Image / Stream| API
    API -->|Inference| MODEL
    API -->|Save Scan Analysis| DDB
    API -->|Upload Captured Frames| S3
    APP -->|Query Telemetry & Scans| DDB
    APP -->|MQTT Control Commands| IoT
Loading

📱 Navigation & App Navigation Flow

The mobile app is structured around Expo Router (file-based navigation) located inside app/screens/.

graph TD
    A[Welcome Screen] --> B[Login / Signup]
    B -->|AWS Cognito Auth| C[Dashboard / Home]
    C --> D[Monitoring Screen - Live Telemetry & Actuators]
    C --> E[Camera AI Screen - Real-time Frame Analysis]
    C --> F[Disease Result Screen - Diagnostic Breakdown]
    C --> G[Alerts Screen - Threshold & Outbreak Warnings]
    C --> H[Settings Screen - Hardware & User Preferences]
Loading

🗺 Screen Breakdown

Screen Route / File Description
Welcome app/screens/Welcome.js Onboarding screen introducing MycoTrack features.
Login / Signup app/screens/Login.js, Signup.js AWS Cognito user authentication (Email/Password & Hosted UI).
Dashboard app/screens/Dashboard.js Main overview showing recent scans, quick telemetry, and alerts.
Monitoring app/screens/Monitoring.js Real-time graphs and controls for temperature, humidity, CO₂ fan & misting actuators.
Camera AI app/screens/CameraAI.js Live camera view and file picker for instant AI disease detection.
Disease Result app/screens/DiseaseResult.js Detailed AI diagnostic results, confidence scores, and treatment recommendations.
Alerts app/screens/Alerts.js Log of environmental threshold alerts and disease warnings.
Settings app/screens/Settings.js Configuration for connected IoT devices, notification preferences, and account management.

🛠 Frameworks, Libraries & Technologies

1. Mobile App

  • Core Framework: Expo ~54.0.33 with React Native 0.81.5 and React 19.1.0
  • Routing: expo-router ~6.0.23 (File-based app routing)
  • Styling: styled-components ^6.3.12, expo-linear-gradient, @expo/vector-icons
  • Authentication: AWS Amplify (@aws-amplify/auth, @aws-amplify/react-native)
  • Cloud & Database: AWS SDK for JS (@aws-sdk/client-dynamodb, @aws-sdk/lib-dynamodb, @aws-sdk/client-iot-data-plane), firebase (legacy integration)
  • Realtime IoT: mqtt ^5.15.1
  • Device Capabilities: expo-camera, expo-image-picker, expo-notifications, expo-haptics

2. AI Inference Backend (backend/)

  • API Framework: FastAPI & Uvicorn ASGI Server
  • Deep Learning Engine: PyTorch (torch, torchvision) with trained weights (mushroom_cls.pth)
  • Architectures Supported: ResNet-50 Classifier & YOLOv8 Detection Pipeline
  • Image Processing: OpenCV (opencv-python-headless), Pillow (PIL)
  • Cloud Connectivity: boto3 (AWS S3, DynamoDB, IoT Data Plane)

3. Hardware & Firmware

  • ESP32-CAM: Arduino sketch (esp32_cam_aws/esp32_cam_aws.ino) streaming MQTT telemetry and JPEG snapshots over SSL.
  • Raspberry Pi: Python automation scripts (src/AWS/pi_capture_aws.py) for automated scheduled image captures and AWS S3/DynamoDB sync.

🗄 Database Schema (AWS DynamoDB)

  • MycoTrack_Scans:
    • userId (String, Partition Key)
    • createdAt (Number, Sort Key)
    • imageUrl (S3 URL), diseaseResult (Healthy/Unhealthy), confidence (Float), boundingBoxes
  • MycoTrack_Alerts:
    • houseId (String, Partition Key)
    • alertId (String, Sort Key)
    • type (Temperature/Humidity/Disease), severity, timestamp
  • MycoTrack_Sensors:
    • houseId (String, Partition Key)
    • timestamp (Number, Sort Key)
    • temperature, humidity, co2

🚀 How to Run the Project

Prerequisites

  • Node.js (v18+ recommended)
  • Python 3.9+ (for backend)
  • Expo Go App on your mobile device (or Android Studio / Xcode for emulators)

Step 1: Run the Mobile App (Expo)

From the root directory:

  1. Navigate to the my-app directory:

    cd my-app
  2. Install node dependencies (if not already installed):

    npm install
  3. Start the Expo server:

    npx expo start
  4. Launch the App:

    • On Mobile: Scan the displayed QR code using the Expo Go app (Android) or Camera app (iOS).
    • In Web Browser: Press w in the terminal to launch the web client.
    • On Android Emulator: Press a in the terminal.
    • On iOS Simulator: Press i in the terminal.

Step 2: Run the AI Backend Server (FastAPI)

  1. Navigate to the backend directory:

    cd my-app/backend
  2. Activate the Python Virtual Environment:

    • Windows:
      .\venv\Scripts\activate
    • macOS / Linux:
      source venv/bin/activate
  3. Install python packages (if needed):

    pip install fastapi uvicorn torch torchvision pillow boto3 opencv-python-headless
  4. Start the FastAPI server:

    python -m uvicorn realtime_mushroom:app --host 0.0.0.0 --port 8000 --reload
  5. Access API Documentation: Open http://localhost:8000/docs in your browser to view and test interactive Swagger API endpoints.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages