canon-sdk-java
canon-sdk-java copied to clipboard
Failed to get property type and size of kEdsPropID_BodyIDEx (EDS_ERR_COMM_DISCONNECTED), inParam 0. Probably not supported by camera
Hi,
I´m trying this lib to connect my Canon 1300d. The lib / dll files is found and i placed all the files in my project. My camera is also switched on. Is there any specifc settings which I have to do on the camera? I´m getting this error message:
Failed to get property type and size of kEdsPropID_BodyIDEx (EDS_ERR_COMM_DISCONNECTED), inParam 0. Probably not supported by camera
Do I need a memory card inside the cam? I see also during I start the program that the screen is poping up for 1 sec from the camera, so it seems there is a connection...
Here my log:
Aug. 02, 2022 12:13:29 NACHM. org.blackdread.cameraframework.api.helper.factory.CanonLibraryImpl registerCanonShutdownHook INFORMATION: Registered shutdown hook of library Aug. 02, 2022 12:13:29 NACHM. org.blackdread.cameraframework.api.helper.factory.CanonLibraryImpl initLibrary INFORMATION: Library successfully loaded Aug. 02, 2022 12:13:47 NACHM. org.blackdread.cameraframework.api.helper.factory.PropertyLogicDefault getPropertyTypeAndSize SCHWERWIEGEND: Failed to get property type and size of kEdsPropID_BodyIDEx (EDS_ERR_COMM_DISCONNECTED), inParam 0. Probably not supported by camera Aug. 02, 2022 12:13:47 NACHM. org.blackdread.cameraframework.api.helper.factory.CameraLogicDefault openSession INFORMATION: Error ignored while testing if camera is connected to open session org.blackdread.cameraframework.exception.error.communication.EdsdkCommDisconnectedErrorException: Port disconnected at org.blackdread.cameraframework.api.constant.EdsdkError.getException(EdsdkError.java:411) at org.blackdread.cameraframework.api.helper.factory.PropertyLogicDefault.getPropertyTypeAndSize(PropertyLogicDefault.java:64) at org.blackdread.cameraframework.api.helper.factory.PropertyGetLogicDefault.getPropertyData(PropertyGetLogicDefault.java:72) at org.blackdread.cameraframework.api.helper.logic.PropertyGetLogic.getPropertyData(PropertyGetLogic.java:88) at org.blackdread.cameraframework.api.helper.logic.PropertyGetShortcutLogic.getBodyIDEx(PropertyGetShortcutLogic.java:87) at org.blackdread.cameraframework.api.helper.factory.CameraLogicDefault.openSession(CameraLogicDefault.java:163) at org.blackdread.cameraframework.api.command.OpenSessionCommand.runInternal(OpenSessionCommand.java:60) at org.blackdread.cameraframework.api.command.OpenSessionCommand.runInternal(OpenSessionCommand.java:38) at org.blackdread.cameraframework.api.command.AbstractCanonCommand.run(AbstractCanonCommand.java:131) at org.blackdread.cameraframework.api.helper.factory.SingleCommandDispatcher.commandDispatcher(SingleCommandDispatcher.java:152) at java.base/java.lang.Thread.run(Thread.java:829)
I´m using: Windows 8.1 Pro 64 Bit
I do not know the Canon 1300d
, you would need to check compatibility with Canon documentation of the EDSDK.
If this is a recent camera, check which EDSDK you downloaded, I have generated the code for specific specific version of EDSDK, if new properties are returned, it may throw.
I cannot help more than that, you need to debug via documentation and check value returned by EDSDK and why it is currently not supported in my implementation.
Hi @Blackdread Thank you for the response. With which camera did you check this library?
According to the following page. https://developers.canon-europe.com/developers/s/article/Latest-EOS-SDK-Version-13-x
Please see also in the PDF:
Canon1300d is used for all EDSDK. I´ve checked already with. EDSDK 13.10.0 (your EDSDK from the description), also with the latest one from Canon Homepage.
As I said:
- The device is connected and it will be found from your library
- I see during the start from your program that the screen from the camera is poping up.
- Afterwards I´m getting: failed to get property type and size of kEdsPropID_BodyIDEx (EDS_ERR_COMM_DISCONNECTED), inParam 0. Probably not supported by camera Aug. 02, 2022 12:13:47 NACHM
I´ve tested the same also with a Canon 1200d and it´s the same.
I cannot help much on that, this kind of error needs to be investigated with the camera on hand. You can try to run in debug mode, there are manual test classes that can be used and all.
I tested with Canon EOS 5D and Canon EOS 6D
If I try to execute your test classes, I never got an issue - but it seems it will run successfully even if there is no camera is connected?
If try this code in a Main class, I got the issue which I posted at first... Any further idea? Is there something wrong which I did?
Here is my code: `import java.util.concurrent.ExecutionException;
import org.blackdread.camerabinding.jna.EdsdkLibrary; import org.blackdread.camerabinding.jna.EdsdkLibrary.EdsCameraRef; import org.blackdread.camerabinding.jna.EdsdkLibrary.EdsSaveTo; import org.blackdread.cameraframework.api.CanonLibrary; import org.blackdread.cameraframework.api.camera.CanonCamera; import org.blackdread.cameraframework.api.command.CanonCommand; import org.blackdread.cameraframework.api.command.CloseSessionCommand; import org.blackdread.cameraframework.api.command.GetPropertyCommand; import org.blackdread.cameraframework.api.command.InitializeSdkCommand; import org.blackdread.cameraframework.api.command.OpenSessionCommand; import org.blackdread.cameraframework.api.command.TerminateSdkCommand; import org.blackdread.cameraframework.api.constant.EdsISOSpeed; import org.blackdread.cameraframework.api.constant.EdsPropertyID; import org.blackdread.cameraframework.api.helper.factory.CanonFactory; import org.blackdread.cameraframework.api.helper.initialisation.FrameworkInitialisation; import org.blackdread.cameraframework.api.helper.logic.event.CameraAddedListener; import org.blackdread.cameraframework.api.helper.logic.event.CameraObjectListener; import org.blackdread.cameraframework.api.helper.logic.event.CameraPropertyListener; import org.blackdread.cameraframework.api.helper.logic.event.CameraStateListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
/**
- This class is based on the Heroku example at
- https://github.com/heroku/devcenter-embedded-tomcat.
- @author stephan
*/
public class CameraTest {
private static final Logger LOGGER = LoggerFactory.getLogger(CameraTest.class);
private static CameraAddedListener cameraAddedListener;
private static CameraObjectListener cameraObjectListener;
private static CameraPropertyListener cameraPropertyListener;
private static CameraStateListener cameraStateListener;
public static void main(String[] args) throws Exception {
final InitializeSdkCommand initializeSdkCommand = new InitializeSdkCommand();
CanonFactory.commandDispatcher().scheduleCommand(initializeSdkCommand);
initializeSdkCommand.get();
cameraAddedListener = event -> {
LOGGER.info("Camera added detected: {}", event);
};
cameraObjectListener = event -> {
LOGGER.info("Object event: {}", event);
};
cameraPropertyListener = event -> {
LOGGER.info("Property event: {}", event);
};
cameraStateListener = event -> {
LOGGER.info("State event: {}", event);
};
new FrameworkInitialisation()
.registerCameraAddedEvent()
.withEventFetcherLogic()
.withCameraAddedListener(cameraAddedListener)
.initialize();
final CanonCamera camera = new CanonCamera();
final EdsdkLibrary.EdsCameraRef edsCameraRef = get(camera.openSession());
// camera.setCameraRef(edsCameraRef); // not necessary as by default on success the ref is set by the openSession command
get(camera.getEvent().registerObjectEventCommand());
get(camera.getEvent().registerPropertyEventCommand());
get(camera.getEvent().registerStateEventCommand());
CanonFactory.cameraObjectEventLogic().addCameraObjectListener(cameraObjectListener);
CanonFactory.cameraPropertyEventLogic().addCameraPropertyListener(edsCameraRef, cameraPropertyListener);
CanonFactory.cameraStateEventLogic().addCameraStateListener(edsCameraRef, cameraStateListener);
final String artist = get(camera.getProperty().getArtistAsync());
LOGGER.info("artist: {}", artist);
final String serial = get(camera.getProperty().getBodyIDExAsync());
LOGGER.info("serial: {}", serial);
final EdsISOSpeed isoSpeed = get(camera.getProperty().getIsoSpeedAsync());
LOGGER.info("isoSpeed: {}", isoSpeed);
final org.blackdread.cameraframework.api.constant.EdsSaveTo saveTo = get(camera.getProperty().getSaveToAsync());
LOGGER.info("saveTo: {}", saveTo);
get(camera.closeSession());
CanonFactory.commandDispatcher().scheduleCommand(new TerminateSdkCommand());
}
private static <R> R get(final CanonCommand<R> command) {
try {
return command.get();
} catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException(e);
}
}
}`
Like I said: I cannot help much on that, this kind of error needs to be investigated with the camera on hand.
I cannot know if you did something wrong
Is there any specific setting needed in the Camera? Which Mode should be selected…?
how can I enable the debug mode etc.? Some further ideas would be helpful
ok, I enhanced the code with:
Shoot shoot = camera.getShoot(); List<File> file = shoot.shoot();
And I was able to take a photo... The "error messages" was also only a Information:
INFORMATION: Error ignored while testing if camera is connected to open session
For the take photo I will have another question, but I will open a new ticket