This guide shows how to add support for a new gphoto2-compatible camera using a Python profile class.
Connect camera over USB and run:
gphoto2 --auto-detectCopy the detected model string. You will use parts of this string in
_MODEL_MARKERS.
List available keys:
gphoto2 --list-configInspect important keys:
gphoto2 --get-config /main/settings/capturetarget
gphoto2 --get-config /main/capturesettings/shutterspeed
gphoto2 --get-config /main/imgsettings/imageformat
gphoto2 --get-config /main/imgsettings/isoCopy:
openscan_firmware/controllers/hardware/cameras/gphoto2/profiles/template_camera.py
Create a new file with your camera name, for example:
openscan_firmware/controllers/hardware/cameras/gphoto2/profiles/my_camera.py
Then update:
profile_id_MODEL_MARKERS- config key lists (
_SHUTTER_KEYS,_ISO_KEYS,_RAW_FORMAT_KEYS, ...) - startup defaults in
apply_startup_config - optional RAW behavior in
capture_dng
No manual registry edit is needed.
All Python modules in:
openscan_firmware/controllers/hardware/cameras/gphoto2/profiles/
are auto-discovered by the profile registry at startup.
Requirements:
- your class must inherit from
GPhoto2Profile(orGenericGPhoto2Profile) register_in_registrymust beTrue(default)matches(identity)should returnTrueonly for your target camera model
Use the firmware API/flow to capture a JPEG and check:
- image is captured successfully
- expected shutter and quality values are applied
- diagnostics show expected config keys
Capture RAW/DNG via the firmware flow and verify:
- file extension is RAW-like for your camera (
.nef,.cr2,.raw, ...) - profile can switch to RAW mode
- profile restores previous image format after capture
write_first_config(...) returns explicit result details:
- attempted keys
- requested value
- success/failure
- failure message
If a setting fails, inspect these values first, then compare with
gphoto2 --get-config <key> output.