I'm trying to use the library of DigiCamControl (2.0.73-beta). I've installed the NuGet package in a C# Console Application for testing. In this application, I've hooked up some basic Console.Writeline's to the events and logging class to see what is happening. The library detects my Canon EOS 600D and fires the CameraConnected event, but doesn't fire any PhotoCaptured/CameraDisconnected-events after that moment.
This is my testcode:
Code: Select all
static void Main(string[] args)
{
var DeviceManager = new CameraDeviceManager();
DeviceManager.CameraConnected += (e) => {
Console.WriteLine($"Connected {e.DeviceName} {e.IsConnected} {e.SerialNumber}");
DeviceManager.SelectedCameraDevice = e;
Console.WriteLine("Taking photo");
e.CapturePhotoNoAf();
Console.WriteLine("Took photo");
};
DeviceManager.PhotoCaptured += (sender, eventArgs) => { Console.WriteLine("OK"); };
DeviceManager.CameraDisconnected += (e) => { Console.WriteLine("Disconnected"); };
DeviceManager.UseExperimentalDrivers = true;
DeviceManager.DisableNativeDrivers = false;
Log.LogError += (e) =>
{
Console.WriteLine($"ERROR: {e.Message}");
};
Log.LogDebug += (e) =>
{
Console.WriteLine($"DEBUG: {e.Message}");
};
Log.LogInfo += (e) =>
{
Console.WriteLine($"INFO: {e.Message}");
};
Console.WriteLine("Enter to continue");
Console.ReadLine();
Console.WriteLine("ConnectToCamera()");
DeviceManager.ConnectToCamera();
Console.ReadLine();
}
Code: Select all
Enter to continue
ConnectToCamera()
DEBUG: New canon camera found !
DEBUG: Pas 1
DEBUG: Pas 2
DEBUG: Connection device start
DEBUG: Connection device \\?\usb#vid_04a9&pid_3218#5&3095c79&0&2#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
DEBUG: Error get EC
ERROR: Error initialize EOS camera object
DEBUG: Pas 3
DEBUG: Pas 4
DEBUG: Pas 5
DEBUG: ===========Camera is connected==============
DEBUG: USB : VID=04a9, PID=3218
DEBUG: Driver :CanonSDKBase
DEBUG: Name :Canon EOS 600D
DEBUG: Manufacturer :Canon Inc.
Connected Canon EOS 600D True 083063027375
Taking photo
DEBUG: EOS capture start
DEBUG: EOS capture end
Took photo
DEBUG: New canon camera found done!
DEBUG: Connection device start
DEBUG: Connection device \\?\usb#vid_04a9&pid_3218#5&3095c79&0&2#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
I've stripped the code down as far as I could, but it doesn't seem to work. I'm basically doing the exact same thing as CameraControl.Devices.Example and that one does work.
Does anyone have an idea what I'm doing wrong?