Description:
The Rio microfluidics controller currently requires the Pi Camera to be connected for the application to start, even when only strobe control is needed. This prevents use cases where an external sensor is used instead of the Pi Camera, but strobe hardware control is still required.
Current Behavior:
- Application fails to start if Pi Camera is not connected
- Camera initialization error at main.py lines 261-276 raises an exception
- Strobe hardware control is unavailable when camera initialization fails
- Only two modes are supported: full hardware (camera + strobe) or full simulation (no hardware)
Expected Behavior:
- Application should start successfully without Pi Camera
- Strobe hardware control via SPI should remain functional
- Support "strobe-only hardware mode" for external sensor setups
- Graceful degradation when camera hardware is unavailable
Steps to Reproduce:
- Disconnect Pi Camera hardware
- Run
python main.py (without RIO_SIMULATION=true)
- Application fails during "Step 5: Initializing camera controller..."
- Exception is raised, preventing application startup
Environment:
- File: software/main.py (lines 261-276)
- Related: software/controllers/strobe_cam.py (strobe is independent of camera)
- Related: software/drivers/strobe.py (PiStrobe class works independently via SPI)
Root Cause:
In main.py, camera initialization is wrapped in a try-except block that raises the exception instead of continuing gracefully:
except Exception as e:
logger.error(f"Step 5: Camera initialization failed: {e}")
import traceback
logger.error(traceback.format_exc())
raise # <-- This causes app to fail
The strobe hardware (PiStrobe class) operates independently via SPI and doesn't require the camera, but the application architecture couples camera and strobe initialization through the Camera class.
Possible Solutions:
- Modify main.py to catch camera initialization failure and continue with strobe-only mode
- Create a minimal strobe-only controller that provides strobe control without camera
- Add environment variable
RIO_CAMERA_ENABLED to optionally disable camera while keeping strobe
- Provide direct strobe timing control (wait_ns, period_ns) instead of FPS-based control
Additional Context:
Use case: External sensor with its own UI needs strobe synchronization via cable connection. The software should control strobe timing without requiring Pi Camera hardware. The strobe hardware communication is already independent (SPI-based), but the application startup logic prevents this configuration.
Description:
The Rio microfluidics controller currently requires the Pi Camera to be connected for the application to start, even when only strobe control is needed. This prevents use cases where an external sensor is used instead of the Pi Camera, but strobe hardware control is still required.
Current Behavior:
Expected Behavior:
Steps to Reproduce:
python main.py(withoutRIO_SIMULATION=true)Environment:
Root Cause:
In main.py, camera initialization is wrapped in a try-except block that raises the exception instead of continuing gracefully:
The strobe hardware (PiStrobe class) operates independently via SPI and doesn't require the camera, but the application architecture couples camera and strobe initialization through the Camera class.
Possible Solutions:
RIO_CAMERA_ENABLEDto optionally disable camera while keeping strobeAdditional Context:
Use case: External sensor with its own UI needs strobe synchronization via cable connection. The software should control strobe timing without requiring Pi Camera hardware. The strobe hardware communication is already independent (SPI-based), but the application startup logic prevents this configuration.