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.
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
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]
| 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. |
- Core Framework: Expo
~54.0.33with React Native0.81.5and React19.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
- 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)
- 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.
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
- Node.js (v18+ recommended)
- Python 3.9+ (for backend)
- Expo Go App on your mobile device (or Android Studio / Xcode for emulators)
From the root directory:
-
Navigate to the
my-appdirectory:cd my-app -
Install node dependencies (if not already installed):
npm install
-
Start the Expo server:
npx expo start
-
Launch the App:
- On Mobile: Scan the displayed QR code using the Expo Go app (Android) or Camera app (iOS).
- In Web Browser: Press
win the terminal to launch the web client. - On Android Emulator: Press
ain the terminal. - On iOS Simulator: Press
iin the terminal.
-
Navigate to the backend directory:
cd my-app/backend -
Activate the Python Virtual Environment:
- Windows:
.\venv\Scripts\activate
- macOS / Linux:
source venv/bin/activate
- Windows:
-
Install python packages (if needed):
pip install fastapi uvicorn torch torchvision pillow boto3 opencv-python-headless
-
Start the FastAPI server:
python -m uvicorn realtime_mushroom:app --host 0.0.0.0 --port 8000 --reload
-
Access API Documentation: Open http://localhost:8000/docs in your browser to view and test interactive Swagger API endpoints.