HiveControl is a comprehensive beehive monitoring and management system designed to run on Raspberry Pi. It collects data from multiple sensors, provides a web-based dashboard for visualization, and integrates with Hivetool.org for data sharing.
Install HiveControl with one simple command - no technical knowledge required:
curl -sSL https://raw.githubusercontent.com/rcrum003/HiveControl/master/easy-install.sh | sudo bashThat's it! The installer handles everything automatically. Installation takes 30-60 minutes.
Bee Counter Camera (6-8 hours):
curl -sSL https://raw.githubusercontent.com/rcrum003/HiveControl/master/easy-install.sh | sudo bash -s -- -bRemote Desktop + Touchscreen Keyboard:
curl -sSL https://raw.githubusercontent.com/rcrum003/HiveControl/master/easy-install.sh | sudo bash -s -- -xkAll Features:
curl -sSL https://raw.githubusercontent.com/rcrum003/HiveControl/master/easy-install.sh | sudo bash -s -- -bxkπ See our Complete Installation Guide for step-by-step instructions including:
- How to install Raspberry Pi OS
- How to image your SD card
- How to connect to your Pi
- Complete setup walkthrough with screenshots
If you prefer to download and review the code first:
curl -O https://raw.githubusercontent.com/rcrum003/HiveControl/master/install.sh
chmod u+x install.sh
sudo ./install.shOptions: -b (Bee Counter) -x (Remote Desktop) -k (Touchscreen) -d (Debug)
π Download Instructions | π Full Installation Guide
sudo /home/HiveControl/upgrade.shNote: Upgrades preserve your data and configurations but will overwrite code changes in the scripts directory.
- Features
- Supported Sensors
- System Architecture
- Documentation
- Web Interface
- Security
- Development
- Support
- Real-time Sensor Data: Weight, temperature, humidity, bee flight activity
- Weather Integration: WeatherFlow Tempest, Ambient Weather, OurWeather
- Environmental Monitoring: Light (LUX), air quality (PurpleAir)
- Growing Degree Days (GDD): Track bee development and activity
- Automated Data Collection: Configurable collection intervals via cron
- Responsive Design: Bootstrap-based interface for desktop and mobile
- Interactive Charts: HighCharts visualizations with multiple timeframes
- Live Camera Feed: Monitor hive activity with webcam integration
- Historical Analysis: View trends over days, weeks, months, or years
- Web-Based Configuration: No command-line needed for most tasks
- Backup & Restore: Full database and configuration backups
- Password Management: Change admin password through web interface
- System Monitoring: View logs, disk space, and system status
- Data Management: Clear old data, remove zero values, pause collection
- Hivetool.org Integration: Share data with beekeeping research community
- REST API: JSON endpoints for external applications
- Data Export: Download backups and historical data
- HX711 Load Cell Amplifier (Primary)
- Phidget 1046 Bridge Interface
- CPW-200+ Industrial Scale
- DHT22 (AM2302) - External weather
- SHT31-D - Precision I2C sensor
- BME680 - Temperature/humidity/pressure/gas
- BME280 - Temperature/humidity/pressure
- BroodMinder Bluetooth sensors
- Temper USB sensors
- WeatherFlow Tempest (UDP broadcast)
- Ambient Weather (API)
- OurWeather stations
- Weather Underground (XML)
- TSL2591 / TSL2561 - Light/LUX sensors
- PurpleAir - Air quality monitoring
- Bee Counter - Optical flight activity counter
/home/HiveControl/
βββ data/ # Data storage
β βββ hive-data.db # SQLite database
β βββ backups/ # Database backups
βββ scripts/ # Data collection scripts
β βββ currconditions.sh # Main data collection orchestrator
β βββ weight/ # Weight sensor scripts
β βββ temp/ # Temperature sensor scripts
β βββ weather/ # Weather station scripts
β βββ lux/ # Light sensor scripts
β βββ air/ # Air quality scripts
β βββ beecounter/ # Bee flight counter
βββ www/public_html/ # Web application
β βββ admin/ # Admin interface
β βββ pages/ # User-facing pages
β βββ include/ # Shared PHP files
β βββ charts/ # Chart data endpoints
β βββ bower_components/ # Frontend libraries
βββ install.sh # Installation script
βββ upgrade.sh # Update script
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Physical Sensors (I2C, GPIO, USB, Network) β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
v
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bash Collection Scripts (scripts/) β
β - currconditions.sh (orchestrator) β
β - Individual sensor scripts β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
v
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β SQLite Database (hive-data.db) β
β - allhivedata (sensor readings) β
β - hiveconfig (configuration) β
β - logs (audit trail) β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
v
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β PHP Web Application (www/) β
β - Real-time dashboard β
β - Configuration interface β
β - Chart data APIs β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
v
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β External Integration β
β - Hivetool.org data sharing β
β - REST API access β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
Backend:
- Language: PHP 7.0+, Bash
- Database: SQLite 3
- Web Server: Apache 2.4
- Platform: Raspberry Pi OS (Raspbian Buster/Bullseye)
Frontend:
- Framework: Bootstrap 3
- Charts: HighCharts
- jQuery: 3.x
- Data Tables: DataTables plugin
Python Dependencies:
- pigpio (GPIO control)
- Adafruit libraries (I2C sensors)
- RPi.GPIO
- Architecture Overview
- Web Application Structure
- Bash Scripts Reference
- Database Schema
- API Reference
- Security Features
Main Dashboard (/pages/index.php)
- Combined chart with weight, temperature, humidity, and bee activity
- Time range selector (Today, 2 days, 1 week, 1 month, 1 year, All)
- Current conditions display
- Webcam feed integration
Specialized Views
- Weight Chart - Track hive weight changes, nectar flow
- Temperature Chart - Internal and external temperature
- Environment Chart - Humidity, barometric pressure, weather
- GDD Chart - Growing degree days with pollen counts
- Light Chart - Solar radiation and daylight patterns
- Air Quality - PM2.5, PM10 pollution levels
- Bee Counter - Flight activity tracking
Administration Pages (/admin/)
- Hive Configuration - Basic settings, location, Hivetool.org integration
- Instrument Configuration - Sensor selection and calibration
- Site Configuration - Weather station and sensor-specific settings
- System Commands - Data management, logs, upgrades
- Backup & Restore - Database backup and recovery
- Change Password - Admin password management
- Notifications - Email alerts configuration
- Method: Apache Basic Authentication with .htpasswd
- Default Username:
admin - Password Location:
/home/HiveControl/www/.htpasswd - Change Password: Use web interface at
/admin/changepassword.php
HiveControl 2.10 includes comprehensive security improvements:
β SQL Injection Protection
- Parameterized queries throughout application
- Input validation and whitelisting
- Prepared statements with PDO
β Cross-Site Scripting (XSS) Prevention
- All output properly escaped with
htmlspecialchars() - Content Security Policy headers
- Input sanitization
β CSRF Protection
- Token-based validation on all POST forms
- Session-based token generation
- Automatic token regeneration
β Session Security
- HTTPOnly cookies prevent JavaScript access
- SameSite=Strict prevents cross-site attacks
- Session ID regeneration every 5 minutes
- 1-hour session timeout
β Additional Protections
- IP spoofing prevention
- Information disclosure prevention
- Security headers (X-Frame-Options, CSP, etc.)
- Password protection (no plaintext exposure)
Complete Security Documentation
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Test thoroughly on Raspberry Pi
- Submit a pull request
# Clone repository
git clone https://github.com/rcrum003/HiveControl.git
cd HiveControl
# Create test branch
git checkout -b feature/your-feature
# Test on Raspberry Pi
sudo ./install.sh -d # Debug modePHP:
- Use prepared statements for all database queries
- Escape all output with
htmlspecialchars() - Include CSRF tokens in all POST forms
- Follow existing code structure and naming conventions
Bash:
- Use
set -eo pipefailfor error handling - Quote all variable expansions
- Provide error checking for all operations
- Log errors to syslog or logs table
- Test all sensor integrations on actual hardware
- Verify database operations don't corrupt data
- Check web interface on desktop and mobile
- Validate security features (CSRF, XSS, SQL injection)
Sensors Not Reading
- Check I2C is enabled:
sudo raspi-config - Verify sensor connections and power
- Test sensor directly:
i2cdetect -y 1 - Review logs:
/admin/system.phpβ View Logs
Web Interface Not Loading
- Check Apache status:
sudo systemctl status apache2 - Verify PHP installed:
php -v - Check file permissions:
sudo chown -R www-data:www-data /home/HiveControl/www - Review Apache error log:
/var/log/apache2/error.log
Database Errors
- Check database file exists:
ls -la /home/HiveControl/data/hive-data.db - Verify permissions:
sudo chown www-data:www-data /home/HiveControl/data/hive-data.db - Test SQLite:
sqlite3 /home/HiveControl/data/hive-data.db "SELECT * FROM hiveconfig;"
Data Not Collecting
- Check cron is running:
sudo systemctl status cron - Verify currconditions.sh executable:
chmod +x /home/HiveControl/scripts/currconditions.sh - Run manually to see errors:
sudo /home/HiveControl/scripts/currconditions.sh - Check for "pause" status in system settings
Complete Troubleshooting Guide
- Website: https://hivecontrol.org
- GitHub Issues: https://github.com/rcrum003/HiveControl/issues
- Wiki: https://github.com/rcrum003/HiveControl/wiki
- Hivetool.org: https://hivetool.org
- Check the Troubleshooting Guide
- Search existing issues
- Review system logs in the web interface
- Post detailed issue report with:
- HiveControl version
- Raspberry Pi model and OS version
- Sensors being used
- Error messages from logs
- Steps to reproduce
allhivedata - Sensor readings
id,date,hivetempf,hiveHum,hiveweight,luxleveloutsidetemp,outsideHum,pressure,rain,windsolar,uvindex,IN_COUNT,OUT_COUNTpm25,pm10, and more
hiveconfig - System configuration
- Hive name, location, timezone
- Hivetool.org credentials
- GDD settings, sensor enable/disable flags
logs - Audit trail
- All system operations logged with timestamp
- IP address tracking for security
- Error and success messages
msgqueue - System command queue
- Upgrade requests
- Data export jobs
- Background tasks
Complete Database Documentation
HiveControl is open source software. See individual files for specific license information.
Author: Ryan Crum Website: hivecontrol.org Related Project: Hivetool.org
Special thanks to the beekeeping and open source communities for their contributions, testing, and feedback.
Supported Raspberry Pi Models:
- Raspberry Pi 4 Model B
- Raspberry Pi 3 Model B/B+
- Raspberry Pi 2 Model B
- Raspberry Pi Zero/Zero W (limited)
Supported Operating Systems:
- Raspberry Pi OS (Raspbian) Buster
- Raspberry Pi OS (Raspbian) Bullseye
- Debian-based distributions
Minimum Requirements:
- 1GB RAM (2GB+ recommended)
- 8GB SD card (16GB+ recommended)
- Active internet connection for weather and Hivetool.org integration
Latest Release: Version 2.10 (2026-01-17) Status: Production Ready β