{"id":29075150,"url":"https://github.com/bboonstra/solar","last_synced_at":"2025-10-10T23:34:40.443Z","repository":{"id":299664842,"uuid":"993894127","full_name":"bboonstra/solar","owner":"bboonstra","description":"Semi-Autonomous Outdoor Life Assisting Robot","archived":false,"fork":false,"pushed_at":"2025-06-17T16:45:02.000Z","size":1544,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T17:46:45.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://solar.bboonstra.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bboonstra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"buy_me_a_coffee":"bboonstra","custom":["https://solar.bboonstra.dev/"]}},"created_at":"2025-05-31T18:46:48.000Z","updated_at":"2025-06-17T16:45:05.000Z","dependencies_parsed_at":"2025-06-17T17:46:47.725Z","dependency_job_id":"8fee1122-28ba-4f68-929a-d66b49010929","html_url":"https://github.com/bboonstra/solar","commit_stats":null,"previous_names":["bboonstra/solar"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bboonstra/solar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboonstra%2Fsolar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboonstra%2Fsolar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboonstra%2Fsolar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboonstra%2Fsolar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bboonstra","download_url":"https://codeload.github.com/bboonstra/solar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bboonstra%2Fsolar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262279239,"owners_count":23286552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-27T15:09:33.608Z","updated_at":"2025-10-10T23:34:35.412Z","avatar_url":"https://github.com/bboonstra.png","language":"Python","funding_links":["https://buymeacoffee.com/bboonstra","https://solar.bboonstra.dev/"],"categories":[],"sub_categories":[],"readme":"# SOLAR — Semi-Autonomous Outdoor Life Assisting Robot\n\n[![Python CI](https://github.com/bboonstra/solar/actions/workflows/python-ci.yml/badge.svg)](https://github.com/bboonstra/solar/actions/workflows/python-ci.yml)\n\n[![License: Polyform Noncommercial](https://img.shields.io/badge/License-Polyform%20Noncommercial-blue.svg)](https://polyformproject.org/licenses/noncommercial/1.0.0/)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n\nSOLAR is a research-driven robotics project aimed at exploring sustainable, autonomous plant care through sensor data collection and environmental interaction. Designed for outdoor environments, SOLAR monitors conditions such as soil moisture, temperature, humidity, and light levels, and takes physical actions to support vegetation growth.\n\n## 🌱 Project Goal\n\nInvestigate how robotics can enhance environmental sustainability by automating basic plant care tasks like watering, soil monitoring, and sample collection.\n\n## ✨ Key Features\n\n- **Modular Sensor Integration**: Extensible architecture for adding new sensors\n- **Real-time Environmental Monitoring**: Continuous data collection with configurable intervals\n- **Autonomous Decision-making**: Scheduling and control logic for plant care\n- **Threaded Runner System**: Concurrent sensor monitoring for optimal performance\n- **Development Mode**: Full simulation support for testing without hardware\n- **Comprehensive Logging**: Colorized output with configurable log levels\n- **Health Monitoring**: Automatic error detection and recovery\n- **Custom Hardware Support**: GPIO, pneumatic actuation, custom servos\n\n## 🏗️ Architecture\n\n### Core Components\n\n1. **Runner System** (`src/runners/`)\n   - `BaseRunner`: Abstract base class for all sensor/actuator modules\n   - `RunnerManager`: Central coordinator for concurrent operations\n   - `INA219Runner`: Power monitoring implementation\n\n2. **Sensor Modules** (`src/sensors/`)\n   - Hardware abstraction layer with production/development modes\n   - Standardized interfaces for all sensor types\n   - Built-in error handling and recovery\n\n3. **Main Application** (`src/main.py`)\n   - Configuration loading and validation\n   - Environment detection\n   - Graceful startup/shutdown\n\n### System Design\n\n```\n┌─────────────────┐\n│  Main Process   │\n│   (main.py)     │\n└────────┬────────┘\n         │\n    ┌────┴────┐\n    │ Runner  │\n    │ Manager │\n    └────┬────┘\n         │\n    ┌────┴────────────────┬─────────────┬─────────────┐\n    │                     │             │             │\n┌───┴────┐         ┌─────┴────┐  ┌────┴────┐  ┌─────┴────┐\n│INA219  │         │  Sensor  │  │ Actuator│  │  Future  │\n│Runner  │         │  Runner  │  │ Runner  │  │  Runner  │\n└────────┘         └──────────┘  └─────────┘  └──────────┘\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Python 3.8 or higher\n- Raspberry Pi (for production mode)\n- Git\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/bboonstra/solar.git\n   cd solar\n   ```\n\n2. **Set up virtual environment**\n\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   pip install --upgrade pip setuptools\n   ```\n\n3. **Install dependencies**\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Configure the application**\n\n   ```bash\n   cp configuration/environment.example.yaml configuration/environment.yaml\n   # Edit configuration/environment.yaml to set production: true/false\n   # Edit configuration/config.yaml to configure sensors and behavior\n   ```\n\n5. **Run the application**\n\n   ```bash\n   python src/main.py\n   ```\n\n## 📋 Configuration\n\n### Environment Configuration (`configuration/environment.yaml`)\n\n```yaml\n# Set to true when running on actual Raspberry Pi hardware\nproduction: false\n```\n\n### Solar Configuration (`configuration/solar.yaml`)\n\n```yaml\n# Application settings\napplication:\n  threaded_runners: true\n  main_loop_interval: 2\n  shutdown_timeout: 5.0\n\n# Logging configuration\nlogging:\n  level: \"INFO\"\n  colorized: true\n```\n\n### Runners Configuration (`configuration/runners.yaml`)\n\n```yaml\n# Runner configurations\nrunners:\n  # Solar power monitoring INA219\n  solar_power:\n    type: ina219\n    label: \"Solar Power Monitor\"\n    enabled: true\n    i2c_address: \"0x40\"\n    measurement_interval: 1.0\n    log_measurements: true\n    low_power_threshold: 0.5\n    high_power_threshold: 10.0\n\n  # PiPower UPS monitoring\n  pipower:\n    type: pipower\n    label: \"PiPower UPS Monitor\"\n    enabled: true\n    measurement_interval: 1.0\n    log_readings: true\n    bt_lv_pin: 17\n    adc_channel: 0\n    in_dt_pin: 18\n    chg_pin: 27\n    lo_dt_pin: 22\n```\n\n## 🧪 Development\n\n### Running Tests\n\n```bash\n# Run all tests\npytest tests/\n\n# Run with coverage\npytest tests/ --cov=src --cov-report=html\n\n# Run specific test file\npytest tests/test_base_runner.py -v\n```\n\n### Code Quality\n\n```bash\n# Format code\nblack src/ tests/\n\n# Sort imports\nisort src/ tests/\n\n# Type checking\nmypy src/\n\n# Linting\nflake8 src/ tests/\npylint src/\n```\n\n### Adding New Sensors\n\n1. Create a new runner class:\n\n   ```python\n   # src/runners/my_sensor_runner.py\n   from .base_runner import BaseRunner\n   \n   class MySensorRunner(BaseRunner):\n       def _initialize(self) -\u003e bool:\n           # Initialize hardware/simulation\n           return True\n       \n       def _work_cycle(self) -\u003e None:\n           # Perform measurement\n           pass\n       \n       def is_healthy(self) -\u003e bool:\n           # Check sensor health\n           return True\n   ```\n\n2. Register in `RunnerManager`:\n\n   ```python\n   self._runner_classes = {\n       \"ina219\": INA219Runner,\n       \"my_sensor\": MySensorRunner,  # Add here\n   }\n   ```\n\n3. Add configuration section:\n\n   ```yaml\n   my_sensor:\n     enabled: true\n     measurement_interval: 2.0\n   ```\n\n## 📚 Documentation\n\n- [Threaded Runner System](THREADED_RUNNERS.md) - Detailed architecture documentation\n- [Development Guide](development.md) - Setup and development workflow\n- [API Reference](docs/api/) - Coming soon\n\n## 🤝 Contributing\n\nThis project is open for **non-commercial tinkering and experimentation**. We welcome contributions that:\n\n- Add new sensor support\n- Improve error handling and recovery\n- Enhance documentation\n- Fix bugs\n- Add tests\n\nPlease ensure all contributions:\n\n- Include appropriate documentation\n- Have test coverage\n- Follow the existing code style\n- Are submitted via pull request\n\n## 📄 License\n\nLicensed under the [Polyform Noncommercial License](https://polyformproject.org/licenses/noncommercial/1.0.0/). You may use, modify, and share this work **for noncommercial purposes only**.\n\n## 💰 Funding\n\nIf you find this project useful, please consider [sponsoring the team](https://solar.bboonstra.dev/).\n\n## 🏆 Credits\n\n- **Conner Israel** - Hardware Design \u0026 Integration\n- **Ben Boonstra** - Software Architecture \u0026 Development\n- **SOLAR Research Team** - Testing \u0026 Documentation\n\n---\n\n*Semi-Autonomous Outdoor Life Assisting Robot · 2025*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbboonstra%2Fsolar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbboonstra%2Fsolar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbboonstra%2Fsolar/lists"}