Skip to content

wnccnasa/FishCam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FishCam Aquaponics Monitoring System

This project provides a comprehensive monitoring and notification system for an aquaponics setup, including sensor data collection, logging, web streaming, and automated email alerts.

Main Components

Sensor Modules

  • bme680_ts.py: Reads temperature, humidity, and barometric pressure from a Bosch BME680 sensor via I2C.
  • liquid_level_sensor_ts.py: Detects water/liquid level using a GPIO-connected sensor.
  • temp_water_sensor_ts.py: Measures water temperature.
  • ph_sensor_ts.py: Reads and calibrates pH sensor data, with command-line options for calibration and testing.

Data Aggregation & Control

  • sensors_ts.py: Main script for collecting sensor data, averaging readings, sending data to ThingSpeak, and managing email notifications.
  • sensors_with_scheduled_emails.py: Enhanced version of sensors_ts.py with scheduled email capabilities and improved error handling.
  • scheduled_status_update.py: Sends scheduled or daily summary status updates via email.

Utilities

  • log_manager.py: Interactive utility for managing, viewing, and cleaning log files.
  • email_notification.py: Handles sending email notifications and alerts.
  • aquaponics_config.py: Stores configuration constants (intervals, email settings, etc.).
  • api_key_ts.py: Stores API keys (e.g., for ThingSpeak).
  • ph_calibrate.py: Utility for calibrating the pH sensor and saving calibration data.

Web Streaming

  • web_stream.py: Runs a web server to stream live video from a camera using MJPEG.

Other Files

  • ph_calibration.json: Stores calibration data for the pH sensor.
  • html_templates/: Contains HTML templates for email notifications and status reports.
  • logs/: Directory for log files generated by the system.

Usage

  • Run sensors_ts.py to start sensor monitoring and notifications.
  • Use web_stream.py to start the live camera stream.
  • Use log_manager.py to view and manage logs.
  • Calibrate the pH sensor with ph_calibrate.py.

FishCam Sensor Setup

Our set up uses a Raspberry Pi 5 with Bookworm 64-bit.

  1. Install latest Raspberry Pi OS using these steps: Raspberry Pi Getting Started Guide (Bookworm)

  2. sudo raspi-config

      1. Interface Options
    1. Enable i2c
    2. Enable 1-Wire interface
  3. Clone the repository.

# Change to the home directory.
cd ~
# Clone the repository.
git clone https://github.com/wnccnasa/FishCam.git
  1. Create a virtual environment.
cd FishCam
python -m venv .venv
source .venv/bin/activate
  1. Update pip.
python -m pip install --upgrade pip
  1. Install requests for ThingSpeak uploads.
pip install requests
  1. Install sensor libraries
# Install bme680 for temperature, humidity and barometric pressure sensor.
pip install bme680
# Water temperature sensor.
pip install w1thermsensor

# Install GPIO Zero library for GPIO access for liquid level sensor.
pip install gpiozero lgpio pigpio RPi.GPIO
  1. Install sensor_ts.service
sudo bash install-sensors_ts-server.sh
# Look at the logs to see if there are any issues.
sudo systemctl status sensors_ts.service
sudo journalctl -u sensor_ts.service -n 200
# Restart service
sudo systemctl restart sensors_ts.service
  1. Set journald limits to conserve diskspace
sudo bash install_journald_limits.sh

Setup FishCam Streaming

# Install opencv for camera streaming.
pip install opencv-python

Update FishCam Code

# Update code 
cd FishCam
git pull https://github.com/wnccnasa/FishCam.git

About

Sensor and Web Streaming for WNCC STEM Club Aquaponics System

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •