- Install IIS HTTPHandler (IIS uses this to start the waitress application)
- Install the latest version of Python
- Create a folder under c:\intepub
-
Create a virtual environment:
-
Windows Command Prompt/PowerShell in the base directory
python -m venv .venv
-
Activate the virtual environment:
.venv\Scripts\activate
-
Install required packages:
pip install flask waitress requests flask-sqlalchemy
-
Restart the IIS server
iisreset
- Setup folder under inetpub for flask application
- Configure IIS to use the virtual environment Python interpreter with web.config
- Controlled Environment Agriculture - Cornell University
- LED light sizing
- How many moles/lumens per m²
- Oxygenation
- More bubblers with fish
- Bubblers with plants
- Sump for circulation of water, pH sensors, health of water without disturbing the fishies
- Quiet oscillating fan for plants
- MICS6814 Gas Sensor (GitHub)
- Adafruit ENS160 MOX Gas Sensor
- Grove VOC and eCO2 Gas Sensor-SGP30
- Scientific research on sensors
- Grove Multichannel Gas Sensor V2
- Grove Multichannel Gas Sensor
- Kactoily 7-in-1 Aquarium WiFi Monitor
-
main_app.py: The main Flask web application. It provides a web interface for viewing MJPEG video streams from remote cameras, handles configuration, logging, and routes for the web UI. It uses
MediaRelayandCachedMediaRelayto efficiently distribute video streams to multiple clients. -
frame_cache.py: Contains the
FrameCachesystem, which buffers video frames from unreliable wireless cameras. It stores frames temporarily and serves them with a delay to smooth out connection issues, providing stable video playback. -
cached_relay.py: Defines the
CachedMediaRelayclass, which combines the relay and frame caching systems. It provides stable video streaming from unreliable sources by buffering frames and distributing them to clients at a steady rate. -
waitress_app.py: Sets up and runs a Waitress WSGI server to serve the Flask web application. It configures logging and ensures the app can be deployed in a production environment.
-
database.py: Database configuration module that initializes SQLAlchemy for storing visitor location data.
-
geomap_module/: A Flask blueprint module for tracking and displaying visitor locations on an interactive map.
- models.py: Defines the
VisitorLocationdatabase model for storing IP geolocation data - routes.py: Provides endpoints for the visitor map page and API endpoints for location data
- helpers.py: Utility functions for extracting visitor IPs and fetching geolocation data from ipinfo.io
- templates/visitors.html: Interactive map visualization using Leaflet.js with marker clustering
- models.py: Defines the
The application now includes an automatic visitor tracking system that displays where visitors are connecting from on an interactive world map:
- Automatic Tracking: Every visitor's location is automatically logged based on their IP address (respects 1-hour cooldown per IP)
- Interactive Map: Uses Leaflet.js with marker clustering for clean visualization
- Statistics: Shows total visits and unique visitor counts
- Recent Visitors: Displays a table of recent connections with timestamps
- Privacy Friendly: Only stores city/region/country level data, not exact addresses
- Free Tier: Uses ipinfo.io API (50,000 requests/month free tier)
Access the visitor map at: /aquaponics/visitors
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright (c) 2025 William A Loring
