-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Hello GitHub Community,
I am working on a project where I aim to capture images with a Canon camera and transfer them to my PC using the Canon EDSDK. However, I am encountering a persistent issue: Error Code 0x61 appears whenever I try to transfer a captured image from the camera to the PC.
You can download the Python script as a ZIP file here:
https://github.com/user-attachments/files/18269265/camtest.zip
-
Error Description:
- The camera is correctly detected and initialized.
- The photo is successfully captured.
- When attempting to download the image using
EdsDownload, the error 0x61 is returned.
-
Steps Taken:
- Set the storage target to "Host" using
EdsSetPropertyData. - Configured host capacity using
EdsSetCapacity. - Verified all functions return success until the image transfer step.
- Set the storage target to "Host" using
-
Environment:
- Language: Python with ctypes (bindings for Canon EDSDK)
- Operating System: Windows 10
- Camera: Canon EOS 1300D
- Canon EDSDK Version: latest
-
Failing Method:
result = self.edsdk.EdsDownload(dirItem, 0xFFFFFFFF, stream)
-
Attempts to Fix:
- Tested different storage targets (e.g., camera storage instead of host).
- Adjusted capacity values.
- Added debugging and logging to identify potential issues.
Despite these efforts, the error persists. It seems the issue may lie in the camera configuration or how the image object is referenced.
Goal:
Enable the camera to successfully transfer a captured image to the PC.
Steps to Transfer Photos (Based on Canon EDSDK Manual):
1. Initialize the SDK:
- Use
EdsInitializeSDKto start the SDK. - Load the EDSDK library and verify initialization success.
2. Detect the Camera:
- Call
EdsGetCameraListto retrieve the list of connected cameras. - Check the number of cameras using
EdsGetChildCount. - Use
EdsGetChildAtIndexto select a camera from the list.
3. Open the Camera Session:
- Open the camera session with
EdsOpenSession.
4. Configure the Camera:
- Set the camera's storage options to "Host" using
EdsSetPropertyData:EdsSetPropertyData(camera, kEdsPropID_SaveTo, 0, sizeof(kEdsSaveTo_Host), &kEdsSaveTo_Host); - Specify host capacity using
EdsSetCapacity.
5. Trigger the Camera:
- Use
EdsSendCommandto capture an image:EdsSendCommand(camera, kEdsCameraCommand_TakePicture, 0);
6. Retrieve the Image:
- Access the captured image using
EdsGetChildAtIndexto get a directory item (e.g., the most recent image).
7. Transfer the Image to the PC:
- Create a file stream with
EdsCreateFileStreamto specify the destination path on the host. - Transfer the image using
EdsDownload:EdsDownload(dirItem, 0xFFFFFFFF, stream); - Confirm the download completion with
EdsDownloadComplete.
8. Close the Session and Terminate the SDK:
- Close the camera session using
EdsCloseSession. - Terminate the SDK using
EdsTerminateSDK.
Common Issues:
- Error 0x61: Occurs if the storage target or capacity is incorrectly set.
- No Camera Detected: Check connections and drivers.
- Download Failure: Ensure the directory item is correctly referenced.
What might be causing this error, and are there specific areas I should investigate to resolve the issue? Any help would be greatly appreciated. Thank you!