Page 1 of 1

Library - No events after CameraConnected

Posted: Mon Apr 30, 2018 6:28 pm
by itsamaik

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");
                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");

And this is the output:

Code: Select all

Enter to continue

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}
The strange thing is that it is able to make a photo during the CameraConnected-event, but even then it doesn't fire the PhotoCaptured event. If I take a photo manually it doesn't fire either.

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?

Re: Library - No events after CameraConnected

Posted: Thu May 03, 2018 9:34 pm
by admin
I think the problem is the canon sdk require message pump in the application, the console application don't use such thing.
Take a look on this forum ... icesnative
maybe helps.

Re: Library - No events after CameraConnected

Posted: Mon May 07, 2018 3:42 pm
by itsamaik
Right on point, perfect, thank you! I managed to get it working within my app as well by taking the message pump into consideration. Thank you for the help and the amazing library!