This folder provides simulated implementations that allow the Rio software to run (and be tested) without physical hardware connected. In simulation mode, drivers and camera creation automatically route into these implementations.
Set:
export RIO_SIMULATION=trueThis affects:
software/drivers/spi_handler.py: swaps in simulated GPIO + SPI routingsoftware/drivers/camera/create_camera(...): returns a simulated camera backend
-
spi_simulated.pySimulatedGPIO: minimalRPi.GPIO-compatible APISimulatedSPIHandler: routes SPI “transfers” to simulated devices based on the currently selected port
-
flow_simulated.pySimulatedFlow: implements the same packet types as the flow firmware and returns realistic-enough pressure/flow readings
-
heater_simulated.pySimulatedHeater: implements the same packet types as the sample-holder firmware (PID status, temp readings, stir, power limit, etc.)
-
strobe_simulated.pySimulatedStrobe: implements key strobe commands (enable, timing, hold, cam-read-time, trigger mode)
-
camera_simulated.pySimulatedCamera: aBaseCamera-compatible implementation that generates synthetic frames and supports ROI cropping- it can optionally load real background/droplet templates from a
droplet_AInalysischeckout (if found), otherwise it generates synthetic droplets
-
pump_simulated.pySimulatedPump: in-memory syringe pump behavior for API/UI testing
- Routine tests / CI-style checks: run in simulation mode
- UI iteration: run the server on a development machine without requiring the Pi or attached modules
- Hardware validation: disable simulation and run on the Pi with hardware connected
This file was AI-generated and may contain errors. Please verify against the source code and runtime behavior.
- Date: 2025-12-30
- Model: GPT-5.2
- Maintenance: If you change simulation routing, packet behavior, or frame generation semantics, update this document.