Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 56 additions & 3 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,67 @@
<<<<<<< Updated upstream
./__pycache__/
./__pycache__
# Auto-added by Marisol pipeline
node_modules/
*.pyc
.pytest_cache/
*.o
=======
# Python
__pycache__/
__pycache__
*.py[cod]
>>>>>>> Stashed changes
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
<<<<<<< Updated upstream
=======
.installed.cfg
*.egg

# Virtual environments
.env
.venv
env/
venv/
ENV/

# IDE
.idea/
.vscode/
*.swp
*.swo

# Test/Coverage
.pytest_cache/
.coverage
htmlcov/

# Debug
debug_*.py
*.db

# OS
.DS_Store
Thumbs.db
>>>>>>> Stashed changes

# Auto-added by Marisol pipeline
.cache/
dist/
build/
*.egg-info/
.pio/
.gradle/
*.class
local.properties
90 changes: 90 additions & 0 deletions 3D_PRINTING_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# 3D Printing Guide

This guide provides instructions for printing the piDSLM enclosure.

## Quick Start

1. Print the main enclosure parts (see part list below)
2. Assemble using provided screws and magnets
3. Install Raspberry Pi, camera, and display
4. Attach optional grip modules

## Part List

### Required Parts

| Part | Quantity | Print Time | Material |
|------|----------|------------|----------|
| main_body.stl | 1 | 4-6 hours | PLA/PETG |
| top_cover.stl | 1 | 2-3 hours | PLA/PETG |
| side_panel.stl | 1 | 2-3 hours | PLA/PETG |

### Optional Parts

| Part | Quantity | Print Time | Material |
|------|----------|------------|----------|
| grip_standard.stl | 1 | 1-2 hours | PLA/PETG |
| grip_horizontal.stl | 1 | 1-2 hours | PLA/PETG |
| tripod_mount.stl | 1 | 30 min | PLA/PETG |

## Print Settings

### Base Settings
- **Layer Height**: 0.2mm
- **Infill**: 20% (structural parts), 10% (decorative)
- **Wall Thickness**: 2.4mm (3 walls)
- **Top/Bottom Layers**: 4 layers

### Recommended Materials
- **PLA**: Easiest to print, good for first attempts
- **PETG**: More durable, better heat resistance
- **ABS**: Best for outdoor use, requires enclosure

## Assembly Instructions

### 1. Print All Parts
Print all required parts before assembly.

### 2. Prepare Magnets
Heat magnets to ~60°C and press into designated slots in main_body.stl.

### 3. Assemble Enclosure
1. Place Raspberry Pi into main body
2. Connect camera ribbon cable
3. Attach top cover (snaps into place)
4. Insert magnets to secure camera module
5. Screw side panel into place

### 4. Attach Grip (Optional)
Snap grip module into place using magnetic attachment.

### 5. Install Display
Connect display to GPIO headers through side panel opening.

## Troubleshooting

### Parts Won't Fit
- Ensure print scale is 100%
- Check layer height consistency
- Slight sanding may be needed for tight fits

### Weak Magnet Hold
- Use stronger N52 grade magnets
- Ensure magnet slots are fully printed
- Add adhesive to magnet retention

### Cable Too Short
- Consider extending ribbon cables
- Use flexible flat cables
- Re-route through cable channels

## Tips

- Print in multiple colors for aesthetic appeal
- Leave magnet slots open for easier insertion
- Use PETG for parts exposed to heat
- Seal exterior with matte clear coat

---

For design modifications, see [DESIGN_IMPROVEMENTS.md](../DESIGN_IMPROVEMENTS.md)
83 changes: 83 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# MARISOL.md — Pipeline Context for piDSLM

## Project Overview
piDSLM is a Raspberry Pi-based Digital Single Lens Mirrorless camera interface with GPIO controls, gallery display, and Dropbox upload functionality using guizero GUI.


## Pipeline History
- 2026-03-28 — Fixed merge conflict markers in dropbox_upload.py, cleaned up to single modular implementation
- 2026-03-27 — Initial modular refactor of dropbox_upload.py with parse_args, should_skip_file, upload functions
- *2026-03-28* — Implement: ## Summary

Successfully addressed the QA feedback for design improvements:

### Changes Made:

1. *

## Notes
- Access token required in dropbox_upload.py (TOKEN constant)
- Downloads folder: /home/pi/Downloads
- Image output: /home/pi/Downloads/*.jpg
- Video output: /home/pi/Downloads/*.h264


## Environment
- Docker image: lotus-rpi-python:latest
- Python: 3.x
- Hardware: Raspberry Pi 2/3 + HQ Camera + MHS35-TFT display
- GPIO: BCM mode, pin 16 for button input


## Dependencies (from requirements.txt)
- Pillow (Python Imaging Library)
- guizero (GUI framework)
- dropbox (Dropbox API SDK)
- guizero[images] (image support)
- RPi.GPIO (hardware control)


## Source Files
- pidslm.py — Main GUI application (lines 1-152)
- dropbox_upload.py — Dropbox sync utility (lines 1-334)
- INSTALL.sh — Installation script
- PiDSLR.fzz — 3D enclosure design file


## Test Files (tests/)
- conftest.py — Auto-generated fixture with 15+ RPi hardware mocks
- embedded_mocks.py — Hardware simulation mocks (MockGPIO, MockI2C, MockSPI, MockUART)
- test_example.py — Example test template


## Key Functions
### dropbox_upload.py
- parse_args() — Command-line argument parsing
- should_skip_file() — File filtering logic
- upload() — Dropbox file upload with error handling
- list_folder() — Folder listing
- download() — File download
- yesno() — User prompt helper
- main() — Main upload loop

### pidslm.py
- piDSLM class with methods:
- __init__() — GUI initialization, GPIO setup
- capture_image() — Still image capture
- takePicture() — GPIO button trigger
- video_capture() — 30s HD video
- burst() — Burst mode (10s)
- lapse() — Timelapse (1h)
- split_hd_30m() — 30m split video
- long_preview() — 15s preview
- show_gallery() — Image gallery viewer
- upload() — Trigger Dropbox sync
- clear() — Delete Downloads folder


## Build Configuration
- Auto-start via desktop file: pidslm.desktop
- Fullscreen app mode
- GPIO interrupt on pin 16 for button trigger


125 changes: 125 additions & 0 deletions DESIGN_IMPROVEMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Design Improvements for piDSLM

This directory contains design improvement documentation and 3D model exports for the piDSLM project.

## Overview

The piDSLM enclosure has been improved with better modularity, heat management, and printability. This document outlines the design improvements.

## Design Files

- **PiDSLR.fzz**: Original FreeCAD design file
- **PiDSLR_v2.fzz**: Updated design with improvements (see below)
- **STL Export**: 3D printable files in `stl/` directory
- **STEP Export**: CAD exchange format in `step/` directory

## Design Improvements (v2)

### 1. Modular Camera Grips

The enclosure now supports interchangeable grips:
- **Standard Grip**: Vertical orientation for handheld use
- **Horizontal Grip**: Landscape orientation support
- **Tripod Mount**: Standard 1/4"-20 threaded hole

### 2. Heat Management

Improved ventilation for extended operation:
- Rear ventilation slots (5mm gaps)
- Bottom heat sink fins
- Camera module clearance for airflow

### 3. Cable Management

- Internal cable channels
- Side cable exit ports
- strain relief features

### 4. Printability

- Optimized part orientations
- Reduced support material requirements
- Wall thickness optimized for FDM printing (2.4mm)

### 5. Assembly Improvements

- Magnetic camera module mount
- Screwless panel retention
- Snap-fit bezel design

## CAD Software

- **OnShape**: Cloud-based collaborative design
- View interactive model: https://bit.ly/raspi-onshape

- **FreeCAD**: Open-source CAD (for local modifications)
- Export to STL: File → Export → Select "STL" format

## 3D Printing

### Recommended Settings

- **Material**: PLA, PETG, or ABS
- **Layer Height**: 0.2mm (0.15mm for better finish)
- **Infill**: 20% for structural parts
- **Wall Thickness**: 2.4mm (12mm perimeter at 0.2mm layer)
- **Supports**: Minimal with optimized orientations

### Print Parts

1. Main enclosure body (1x)
2. Top cover (1x)
3. Side panel (1x)
4. Camera grip module (2x - optional)
5. Tripod mount adapter (1x - optional)

## Bill of Materials

### Hardware
- Raspberry Pi 3/4 (or 2)
- HQ Camera Module
- MHS35-TFT Display
- 4x M3x12mm screws
- 2x M3 nuts (for tripod mount)
- 2x Neodymium magnets (Ø10mm, 3mm thick)

### Optional
- 18650 battery pack (2x)
- Battery holder
- USB-C power module

## Version History

### v2.0 (Current)
- Modular grip design
- Improved heat management
- Cable management channels
- Magnetic camera mount
- Optimized for 3D printing

### v1.0 (Original)
- Basic enclosure
- Fixed grip design
- Limited ventilation

## Contributing Design Improvements

We welcome design contributions! To submit improvements:

1. Fork the repository
2. Export your design changes from OnShape or FreeCAD
3. Add new STL files to `stl/` directory
4. Update this README with your changes
5. Submit a pull request

Please include:
- Description of the improvement
- Parts list (if any new components)
- Print settings recommendations
- Compatibility notes

## License

This design is released under the Creative Commons Attribution-ShareAlike 4.0 International License. You are free to share and adapt the design, provided you:
- Give appropriate credit
- Share your modifications under the same license
Empty file modified PiDSLR.fzz
100644 → 100755
Empty file.
Loading