diff --git a/.gitignore b/.gitignore index dd30cf6..7dda894 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,9 @@ debug_*.py dist/ build/ *.egg-info/ + +# Auto-added by Marisol pipeline +.pio/ +.gradle/ +*.class +local.properties diff --git a/MARISOL.md b/MARISOL.md new file mode 100644 index 0000000..a87ff2d --- /dev/null +++ b/MARISOL.md @@ -0,0 +1,35 @@ +# MARISOL.md — Pipeline Context + +## Project Overview +Raspberry Pi Digital Single Lens Mirrorless camera interface project with GPIO controls, gallery display, and Dropbox upload functionality. Built with Python 3, guizero GUI framework, and RPi.GPIO for hardware control. + +## Build & Run +- **Language**: Python 3.12 +- **Framework**: guizero (GUI), RPi.GPIO (hardware) +- **Docker image**: python:3.12-slim +- **Install deps**: `pip install -r requirements.txt` +- **Run**: `python3 pidslm.py` (requires Raspberry Pi hardware or mocked environment) + +## Testing +- **Test framework**: pytest +- **Test command**: `pytest tests/ -v` +- **Hardware mocks needed**: yes (rpi_python via conftest.py embedded_mocks) +- **Known test issues**: Tests require embedded_mocks.py for GPIO/I2C/SPI/UART simulation + +## Pipeline History +- *2026-03-04* — Implement: Improve pidslm.py main application logic +- *2026-03-10* — Implement: Improve test_pidslm.py and embedded_mocks.py +- *2026-03-10* — Test: 16/19 tests passed with hardware mocks + +## Known Issues +- Requires Raspberry Pi hardware for full functionality +- Dropbox OAuth token must be configured in dropbox_upload.py +- GPIO operations need hardware or mocked environment + +## Notes +- conftest.py auto-generates hardware mocks for 15+ RPi modules +- embedded_mocks.py provides MockGPIO, MockI2C, MockSPI, MockUART +- INSTALL.sh script handles setup on Raspberry Pi +- Main entry point: pidslm.py with guizero GUI +- Gallery displays images from /home/pi/Pictures/ directory +- Dropbox upload requires valid OAuth token diff --git a/README.md b/README.md index ff81653..f980931 100644 --- a/README.md +++ b/README.md @@ -50,5 +50,93 @@ Finally, run the INSTALL.sh script using the following command sudo ./INSTALL.sh ``` +# Usage +The main application (`pidslm.py`) provides a graphical interface for: +- Taking photos and videos +- Viewing captured media in a gallery +- Uploading footage to Dropbox + +## Starting the Application + +```bash +python3 pidslm.py +``` + +## Gallery + +The gallery displays images from `/home/pi/Pictures/` directory. Navigate through captured media using the touchscreen interface. + +## Dropbox Upload + +To enable Dropbox uploads, configure your OAuth2 access token in `dropbox_upload.py`: + +```python +TOKEN = 'YOUR_ACTUAL_ACCESS_TOKEN' +``` + +Generate your token from the [Dropbox Developer Console](https://www.dropbox.com/developers/apps). + +# Testing + +The project uses pytest for testing with hardware mocks for Raspberry Pi components. + +## Running Tests + +```bash +pytest tests/ -v +``` + +## Test Infrastructure + +- **Hardware Mocks**: `conftest.py` auto-generates mocks for 15+ RPi modules (RPi.GPIO, I2C, SPI, UART, etc.) +- **Mock Classes**: `embedded_mocks.py` provides `MockGPIO`, `MockI2C`, `MockSPI`, `MockUART` +- **Test Template**: `tests/test_example.py` shows how to write tests using the mocks + +## Example Test + +```python +from embedded_mocks import MockGPIO + +def test_gpio_pin_control(): + gpio = MockGPIO() + gpio.setmode(gpio.BCM) + gpio.setup(17, gpio.OUTPUT) + gpio.output(17, gpio.HIGH) + assert gpio.input(17) == gpio.HIGH +``` + +# Contributing + +## Design Contributions + +The project uses modular camera grips designed in [OnShape](https://bit.ly/raspi-onshape). Feel free to create your own designs and share them. + +## Code Contributions + +1. Fork the repository +2. Create a feature branch +3. Add tests for new functionality +4. Submit a pull request + +## Dependencies + +- **Pillow**: Image processing +- **guizero**: GUI framework +- **dropbox**: Dropbox API integration +- **RPi.GPIO**: Hardware control (requires Raspberry Pi or mocked environment) + +# License + +This project is based on the [MerlinPi project](https://github.com/MisterEmm/MerlinPi) by Martin Manders. + +# Support + +If you found this project useful, consider donating via [paypal.me/nickengman](https://paypal.me/nickengman) to help cover design time. + +# Links + +- [Hackster Project Page](https://www.hackster.io/projects/2a86c3) +- [GitHub Repository](https://github.com/NickEngmann/piDSLM) +- [OnShape Design](https://bit.ly/raspi-onshape)