Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

ASCOM.DSLR - ASCOM driver for dslr camers (Canon, Nikon)

astrophotography
  • Please log in to reply
69 replies to this topic

#1 vtorkalo

vtorkalo

    Lift Off

  • -----
  • topic starter
  • Posts: 7
  • Joined: 24 Jan 2018

Posted 15 July 2018 - 12:55 PM

Hello

 

Let me introduce my opensource project of ASCOM.DSLR driver for Canon an Nikon

I started this project to integrate ASCOM platform with DSLR cameras.

I think this driver can be usefull for people which are using some complicated automation (scripts etc.)

 

Github repository of project: https://github.com/vtorkalo/ASCOM.DSLR

For installation start installer https://www.dropbox.... Setup.exe?dl=1

To connect in astro software please use standart ASCOM camera selection dialog - select there "ASCOM Camera Driver for DSLR"

1. Set camera mode to B or M (depends on camera model)

2. Connect via USB cable

Settings description:

Connection method - way how to connect to camera

There are 3 possibilities

1. CanonSDK - direct connection using canon driver.

2. Nikon - connection using library digicamcontrol. After nikon selection appears checkbox "Use external shutter" and com port selection - it's implemented for some Nikon cameras which doesn't support Bulb mode via USB. To solve this limitation you can connect shutter using this scheme: http://www.alienworl...on MaxDSLR.html

List on nikon models without Bulb support via USB: Nikon D3s, Nikon D3x, Nikon D300, Nikon D300S, Nikon D3400, Nikon D3300, Nikon D3200, Nikon D3100, Nikon D3000, Nikon D40, Nikon D60, Nikon D80, Nikon D5100, Nikon D5000, Nikon D700, Nikon D7000, Nikon D80, Nikon D90

3. BackyardEOS  - driver can control camera by connection to backyardEOS software. It's implemented for simultaneous usage with BackyardEOS application. To activate in BEOS - go to settings - 3rd Party Integration - Enable TCP server and set Port Number equal to driver settings

 

Image mode - format in which image is returned

1. RGGB - raw data are transferred to ASCOM

2. Color16 - debayered 16 bit tiff - usefull for software which doesn't support debayerization

3. ColorJPG - jpeg for quick preview (i used it for plate solving)

 

Enable binning - enables software binning up to 4*4

 

Save photos to - path where store files. Original RAW files will be stored there. Filename contains exposure, ISO, sensor temperature (for canon), time

 

ISO  - iso value. contains all possible values. When camera doesn't support selected - nearest will be choosen

 

This is alpha version  of software. I will appreciate your feedback - if this software will be usefull, testing, new ideas

Tested on Canon EOS80D, EOS550D, Nikon D3100

Tested with software:  MaximDL, APT, allskyplate solver,  CCD Ciel, Backyard EOS

 

Please let know about any issues: describe used software, camera, steps to reproduce and send log file

Logs are written there C:\Users\<USER_NAME>\Documents\ASCOM\Logs <DATE_TIME>


Edited by vtorkalo, 15 July 2018 - 12:56 PM.

  • ccs_hello, Ptarmigan, tjay and 13 others like this

#2 Jim Davis

Jim Davis

    Soyuz

  • *****
  • Posts: 3804
  • Joined: 05 Jul 2014
  • Loc: Lewisberry, PA

Posted 15 July 2018 - 01:06 PM

Thanks for putting in all the work.



#3 aneeg

aneeg

    Apollo

  • -----
  • Posts: 1036
  • Joined: 24 Jan 2016
  • Loc: Nesodden, Norway

Posted 15 July 2018 - 01:58 PM

Please let us have a Pentax option!

 

Arne



#4 vtorkalo

vtorkalo

    Lift Off

  • -----
  • topic starter
  • Posts: 7
  • Joined: 24 Jan 2018

Posted 15 July 2018 - 02:12 PM

Regarding development: i will be great if contributors will join to this project on github. If you are interested in development please contact me. Project is written using C# and Visual Studio

Now i want to see if this kind of software will be usefull


Edited by vtorkalo, 15 July 2018 - 02:14 PM.


#5 SKYGZR

SKYGZR

    Vanguard

  • *****
  • Posts: 2016
  • Joined: 13 Aug 2009
  • Loc: Planet Earth, Milky Way Galaxy, Speeding towards the Virgo Supercluster

Posted 15 July 2018 - 04:42 PM

Please let us have a Pentax option!

 

Arne

I'll 2nd that...(K-5, K-5ii, K-3ii)..


  • aneeg likes this

#6 Rickster

Rickster

    Viking 1

  • *****
  • Posts: 655
  • Joined: 09 Jun 2008
  • Loc: NC Kansas Bortle 3 SQM 21.8+

Posted 16 July 2018 - 08:13 AM

I downloaded the setup file from dropbox and attempted to install it on a windows 7 computer. I got the following error messages.

The ASCOM DriverHelper object has failed to load, this indicates a serious problem with the ASCOM installation. The ASCOM Utilities object has failed to load, this indicates that the ASCOM Platform has not been installed correctly. The ASCOM Platform 6.2 or greater is required for this driver.

Edit: Downloaded and installed ASCOM Platform 6.4 and then reinstalled the DSLR driver. No error messages this time.

Edited by Rickster, 16 July 2018 - 09:04 AM.


#7 vtorkalo

vtorkalo

    Lift Off

  • -----
  • topic starter
  • Posts: 7
  • Joined: 24 Jan 2018

Posted 16 July 2018 - 08:38 AM

 

The ASCOM Platform 6.2 or greater is required for this driver.

I think this is reason. Update is needed



#8 vtorkalo

vtorkalo

    Lift Off

  • -----
  • topic starter
  • Posts: 7
  • Joined: 24 Jan 2018

Posted 16 July 2018 - 09:14 AM

But i will check if it's possible to change minimum version (looks like it's 6.2 by default)



#9 Rickster

Rickster

    Viking 1

  • *****
  • Posts: 655
  • Joined: 09 Jun 2008
  • Loc: NC Kansas Bortle 3 SQM 21.8+

Posted 16 July 2018 - 11:00 AM

I hadn't previously downloaded the ASCOM Platform. It wasn't on my computer before now.

#10 ccs_hello

ccs_hello

    Voyager 1

  • *****
  • Posts: 10196
  • Joined: 03 Jul 2004

Posted 18 July 2018 - 07:45 PM

To OP,

 

Great work.

For some N DSLRs that do not support "B" mode over USB" my

DIY solution is here https://www.cloudyni...trol-for-nikon/

 

Clear Skies!

 

ccs_hello



#11 Ptarmigan

Ptarmigan

    Lagopus lagopus

  • *****
  • Posts: 4557
  • Joined: 23 Sep 2004
  • Loc: Arctic

Posted 18 July 2018 - 09:27 PM

Cool. I will like to check it out. cool.gif waytogo.gif



#12 rwgrwg

rwgrwg

    Vendor (SharpCap)

  • -----
  • Vendors
  • Posts: 80
  • Joined: 11 May 2012
  • Loc: Vale of the White Horse, Oxfordshire, UK

Posted 20 July 2018 - 03:15 PM

Hi,

 

this is a very interesting project! I have briefly tested the driver with my capture application SharpCap and have had some success with the Live View mode so far when scaled 'to fit'. What I have noticed is an intermittent crash from this code

                SevereErrorHappenedEvent.BeginInvoke(sender, ex, (a) =>
                {
                    var ar = a as AsyncResult;
                    var invokedMethod = ar.AsyncDelegate as GeneralExceptionHandler;
                    invokedMethod.EndInvoke(a);
                }, null);
System.ArgumentException
  HResult=0x80070057
  Message=The delegate must have only one target.
  Source=EDSDKLib
  StackTrace:
   at EOSDigital.API.GeneralExceptionHandler.BeginInvoke(Object sender, Exception ex, AsyncCallback callback, Object object)
   at EOSDigital.API.ErrorHandler.ReportError(Object sender, Exception ex) in C:\Documents\Source Code\ASCOM.DSLR\EDSDKLib\API\Helper\ExceptionHandling.cs:line 411
   at EOSDigital.API.Camera.DownloadEvf() in C:\Documents\Source Code\ASCOM.DSLR\EDSDKLib\API\Base\Camera.cs:line 1381
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

The delegate appears to have five targets and it seems that the asynchronous 'BeginInvoke' is limited to one target.

 

If you want to fire the event to all targets in an asynchronous 'fire+forget' manner, you could maybe use something like

        public static bool ReportError(object sender, Exception ex)
        {
            var onSevereErrorHappened = SevereErrorHappened;
            if (onSevereErrorHappened != null)
            {
                Task.Run(() => onSevereErrorHappened.Invoke(sender, ex));
                return true;
            }

            return false;
        }

When I try to use non-live-view mode, the camera tries to focus then I end up with the camera state being Error when SharpCap calls ImageReady, so a NotConnectedException gets thrown.

 

Hope this information is useful to you - I will continue to test when I have some more time.

 

cheers,

 

Robin



#13 vtorkalo

vtorkalo

    Lift Off

  • -----
  • topic starter
  • Posts: 7
  • Joined: 24 Jan 2018

Posted 21 July 2018 - 03:50 PM

Live mode is not tested well - i added it like prototype.
Thank you for testing!

Regarding focus - i was testing it in Manual mode - no sense to use auto focusing for astrophotography

maybe it will be good to show error message in case of Auto focus mode


Edited by vtorkalo, 21 July 2018 - 03:51 PM.


#14 moxican

moxican

    Viking 1

  • -----
  • Posts: 580
  • Joined: 13 Nov 2011
  • Loc: Toronto, Canada

Posted 26 July 2018 - 09:11 AM

I just tested it on my Nikon D5100. No joy unfortunately



#15 rwgrwg

rwgrwg

    Vendor (SharpCap)

  • -----
  • Vendors
  • Posts: 80
  • Joined: 11 May 2012
  • Loc: Vale of the White Horse, Oxfordshire, UK

Posted 19 August 2018 - 04:50 PM

I am now having some success with a Canon 700D with this driver - I had to make some tweaks to both the ASCOM.DSLR code and to SharpCap to get the two to work nicely together. I must say that this is looking very promising now - I am definitely impressed :)

 

My tweaked version of the code can be found at https://github.com/rwg0/ASCOM.DSLR - I fixed

 

* Errors from Canon cameras caused internal error within ASCOM.DSLR code due to multicast events not supporting BeginInvoke

* Sending unsupported ISO value to Canon camera lead to 'camera busy' error and then disconnection

* ASCOM driver implemented both discrete gains and gainMin/gainMax (should only implement one)

* Worker thread not flagged as background - stopped applications using ASCOM.DSLR from shutting down correctly under some circumstances

 

keep up the good work!

 

cheers,

 

Robin


  • ccs_hello, Messierthanwhat and vtorkalo like this

#16 vtorkalo

vtorkalo

    Lift Off

  • -----
  • topic starter
  • Posts: 7
  • Joined: 24 Jan 2018

Posted 27 August 2018 - 05:59 AM

 

 

My tweaked version of the code can be found at https://github.com/rwg0/ASCOM.DSLR - I fixed

Great! You can make Pull request to my repository - i will merge changes
Sorry for disappearing - last weeks had not time for this project 

rwgrwg  - i added you as contributor

 

PS - see your PRs - reviewing it


Edited by vtorkalo, 27 August 2018 - 06:29 AM.


#17 moxican

moxican

    Viking 1

  • -----
  • Posts: 580
  • Joined: 13 Nov 2011
  • Loc: Toronto, Canada

Posted 03 September 2018 - 11:16 AM

To make sure I understand this right. This ASCOM driver should allow other capture software not compatible with Nikon camera control to control Nikon camera through ASCOM DSLR driver?

I have a Nikon D5100 and Nebulosity does not offer compatibility. But, it is compatible with ASCOM cameras, thus I could use it for capture.

Furthermore, will it work with astro-modified firmware?



#18 moxican

moxican

    Viking 1

  • -----
  • Posts: 580
  • Joined: 13 Nov 2011
  • Loc: Toronto, Canada

Posted 03 September 2018 - 11:24 AM

I get this error message:

"Driver method failed: "ASCOM.DSLR.Camers" Object reference not set to an instance of an object"

Running ASCOM 6.4

Could I get some help with it please?



#19 moxican

moxican

    Viking 1

  • -----
  • Posts: 580
  • Joined: 13 Nov 2011
  • Loc: Toronto, Canada

Posted 03 September 2018 - 11:27 AM

ASCOM diagnostic says the ASCOM camera driver is 32bit only and since I have a 64bit system it won't work. Could that be the case? How do I attain a 64bi driver?



#20 rwgrwg

rwgrwg

    Vendor (SharpCap)

  • -----
  • Vendors
  • Posts: 80
  • Joined: 11 May 2012
  • Loc: Vale of the White Horse, Oxfordshire, UK

Posted 03 September 2018 - 12:30 PM

Hi,

 

I happen to know that @vtorkalo doesn't have a Nikon or Pentax camera to test with, so Nikon and Pentax support is very very untested. There is no 64 bit version of the driver at the moment, so only 32 bit software will work.

 

cheers,

 

Robin



#21 moxican

moxican

    Viking 1

  • -----
  • Posts: 580
  • Joined: 13 Nov 2011
  • Loc: Toronto, Canada

Posted 03 September 2018 - 12:41 PM

I see. I've just checked ASCOM main site and clicking the download link only allow 64bit download. So, if ASCOM is only 64bit, and DSLR driver is only 32bit, how do you guys make it work?



#22 rwgrwg

rwgrwg

    Vendor (SharpCap)

  • -----
  • Vendors
  • Posts: 80
  • Joined: 11 May 2012
  • Loc: Vale of the White Horse, Oxfordshire, UK

Posted 03 September 2018 - 12:43 PM

The '64' in the Ascom platform download is the current version number :) I must admit it's a bit confusing!

 

Robin


  • proteus5 likes this

#23 moxican

moxican

    Viking 1

  • -----
  • Posts: 580
  • Joined: 13 Nov 2011
  • Loc: Toronto, Canada

Posted 03 September 2018 - 12:48 PM

Ok it makes sense now smile.gif

So, the only solution would be to reinstall windows in a 32bit version?

My setup works fine with Digicamcontrol 2. The OP mentioned using digamcontrol library. I am not entirely sure what that means though. 



#24 rwgrwg

rwgrwg

    Vendor (SharpCap)

  • -----
  • Vendors
  • Posts: 80
  • Joined: 11 May 2012
  • Loc: Vale of the White Horse, Oxfordshire, UK

Posted 03 September 2018 - 12:59 PM

No, don't think you need to reinstall windows!!!

 

64 bit windows can run 64 *and* 32 bit applications. ASCOM installs for both 32 and 64 bit when you install it on a 64 bit computer. All you need to do is find a 32 bit version of your capture application (or use a different capture application that is 32 bit).

 

I can't advise on Nikon specific stuff - I only have a canon camera, but I have had this working in SharpCap with the Canon 700D.

 

cheers,

 

Robin



#25 Astrohoven

Astrohoven

    Vostok 1

  • -----
  • Posts: 136
  • Joined: 25 Apr 2017

Posted 09 September 2018 - 10:30 AM

I'm getting this error attached.

Attached Thumbnails

  • Sharpcap DSLR.png



CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics





Also tagged with one or more of these keywords: astrophotography



Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics