-
-
Notifications
You must be signed in to change notification settings - Fork 106
Added support for gphoto2 external camera types Nikon or Canon Camaras #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -240,6 +240,7 @@ does. | |
| #previewimage: True | ||
| #saveframes: False | ||
| #wget_skip_cert_check: False | ||
| #gphoto2_camera_model: Nikon DSC D40 (PTP mode) | ||
|
|
||
| ``` | ||
|
|
||
|
|
@@ -267,4 +268,44 @@ To get that change at every klipper start: | |
| [delayed_gcode _INIT_TIMELAPSE_CHECK_TIME] | ||
| initial_duration: 1 | ||
| gcode: SET_GCODE_VARIABLE MACRO=TIMELAPSE_TAKE_FRAME VARIABLE=check_time VALUE=0.5 | ||
| ``` | ||
| ``` | ||
| # gphoto2 Configuration | ||
|
|
||
| ## Connect Your Camera | ||
|
|
||
| 1. Connect camera via USB | ||
| 2. Enable PTP/USB mode on camera (varies by model) | ||
| 3. Verify detection: | ||
|
|
||
| ```bash | ||
| gphoto2 --auto-detect | ||
| ``` | ||
|
|
||
| You should see your camera listed: | ||
|
|
||
| ```bash | ||
| Model Port | ||
| ---------------------------------------------------------- | ||
| Nikon DSC D40 (PTP mode) usb:003,004 | ||
| ``` | ||
|
|
||
| ## Update Configuration | ||
|
|
||
| Add a dummy webcam and give it a stream and snapshot URL that is not in use. | ||
| Select that Camara in the timelaps menue. | ||
| Set the Stream Delay Compensation to the amount of time it takes to focus and take a picture (setting it to manual focus decreases the time taken) | ||
|
Comment on lines
+294
to
+296
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct spelling in the gphoto2 setup steps. Line 295 has multiple typos (“Camara”, “timelaps”, “menue”), which makes the instructions look unreliable. 🧰 Tools🪛 LanguageTool[grammar] ~295-~295: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) [grammar] ~295-~295: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
|
|
||
| Edit `moonraker.conf`: | ||
|
|
||
| ```ini | ||
| [timelapse] | ||
| gphoto2_camera_model = Nikon DSC D40 (PTP mode) | ||
| ``` | ||
|
|
||
| ## Camera "Device busy" | ||
|
|
||
| ```bash | ||
| # Kill any process using camera | ||
| killall gvfs-gphoto2-volume-monitor | ||
| killall gphoto2 | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevent shell command injection in capture command construction.
Line 481 and Lines 498-499 build shell commands from configurable values and execute them. Because
gphoto2_camera_modelandsnapshoturlare writable settings, this creates an RCE path via shell injection.Suggested hardening
🤖 Prompt for AI Agents