gphoto / libgphoto2

The libgphoto2 camera access and control library.
GNU Lesser General Public License v2.1
1.03k stars 324 forks source link

Nikon P950 #780

Open jurgenfd opened 2 years ago

jurgenfd commented 2 years ago

Nikon Coolpix P950

USB IDs [jd@Amok:~]> lsusb Bus 000 Device 001: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub Bus 000 Device 003: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub Bus 000 Device 002: ID 05e3:0610 Genesys Logic, Inc. USB2.1 Hub Bus 000 Device 004: ID 05e3:0610 Genesys Logic, Inc. USB2.1 Hub Bus 000 Device 005: ID 14cd:8601 MOAI ELECTRONICS CORPORATION USB 2.0 Hub Bus 000 Device 006: ID 0bda:8153 Realtek Semiconductor Corp. USB 10/100/1000 LAN Serial: 000001 Bus 000 Device 007: ID 04b0:036d Nikon Corporation NIKON DSC COOLPIX P950 Serial: 000040015802 Bus 000 Device 000: ID 05e3:0626 Genesys Logic, Inc. USB 3.1 Bus Bus 000 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

camera summary output gphoto2 --summary > summary.txt summary.txt

camera configuration output gphoto2 --list-all-config > list-all-config.txt list-all-config.txt

test if capture perhaps already works: gphoto2 --capture-image-and-download

Error PTP I/O Error ERROR: Could not capture image. ERROR: Could not capture. ^C Cancelling... ^C Aborting... Aborted.

At this point the camera is no longer responsive to commands such as: gphoto2 --summary

Error Liveview cannot start: Lens is retracting Error (-1: 'Unspecified error')

For debugging messages, please use the --debug option. Debugging messages may help finding a solution to your problem. If you intend to send any error or debug messages to the gphoto developer mailing list gphoto-devel@lists.sourceforge.net, please run gphoto2 as follows:

env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --capture-preview

Please make sure there is sufficient quoting around the arguments.

=== Here's the result:

my-logfile.txt

I would like support for the P950 for the purpose of astrophotography with Kstars. Keep up the good work. I'll be available for follow up questions. I love this new camera with good potential.

Cheers, Jurgen

msmeissn commented 2 years ago

can you try something like gphoto2 --capture-preview --wait-event=2s --capture-preview to see if this helps?

I have added a change to git, so it will not look for a capture complete event, but just pull the object list, so gphoto2 --capture-image-and-download should work.

jurgenfd commented 2 years ago

Should I download and build a new version of gphoto2 as you mention a change to git was done? With my current build I still get no picture. See below messages and attached log file. Should I set: Setup > "Charge by computer" to OFF like I have now? My impression is that as soon as I attach the cable the camera switches off: i.e. the lens retracts, the led stays full on lid. Perhaps I'm missing a correct setting in the menu?

Thanks for looking into this!

Best regards, Jurgen

my-logfile.txt

[jd@Amok:~]> gphoto2 --capture-preview --wait-event=2s --capture-preview; date

Error Liveview cannot start: Lens is retracting Waiting for 2 seconds for events from camera. Press Ctrl-C to abort.

Error Liveview cannot start: Lens is retracting Error (-1: 'Unspecified error')

For debugging messages, please use the --debug option. Debugging messages may help finding a solution to your problem. If you intend to send any error or debug messages to the gphoto developer mailing list gphoto-devel@lists.sourceforge.net, please run gphoto2 as follows:

env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --capture-preview --wait-event=2s --capture-preview

Please make sure there is sufficient quoting around the arguments.

Fri Mar 25 15:47:30 CET 2022

msmeissn commented 2 years ago

you need to checkout , build and install "libgphoto2" git master branch for this

jurgenfd commented 2 years ago

Let me try building it on Linux. I have no luck on my macOS (intel)....

jurgenfd commented 2 years ago

Build libgphoto2 and gphoto2 on macbook hardware in a VMWare image with a guest Ubuntu OS. Now I get the following results.

jd@ub20:~/Developer/gphoto2$ lsusb Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 004: ID 0e0f:0002 VMware, Inc. Virtual USB Hub Bus 003 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub Bus 003 Device 005: ID 04b0:036d Nikon Corp. NIKON DSC COOLPIX P950 Bus 003 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 0e0f:000b VMware, Inc. VMware Virtual USB Video Device Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub Bus 002 Device 002: ID 0e0f:0008 VMware, Inc. Virtual Bluetooth Adapter Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

camera summary output gphoto2 --summary > summary.txt

summary.txt

gphoto2 --list-all-config > list-all-config.txt

list-all-config.txt

jd@ub20:~$ gphoto2 --capture-image-and-download New file is in location /store_00010001/DCIM/100NIKON/DSCN0129.NRW on the camera Saving file as DSCN0129.NRW Deleting file /store_00010001/DCIM/100NIKON/DSCN0129.NRW on the camera

jd@ub20:~$ env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --capture-preview

Error
Liveview cannot start: Lens is retracting Error (-1: 'Unspecified error')

my-logfile.txt

To my surprise this seems to have saved the attached (I zipped to make it work here for GitHub): jd@ub20:~$ gphoto2 --capture-image-and-download New file is in location /store_00010001/DCIM/100NIKON/DSCN0131.NRW on the camera Saving file as DSCN0131.NRW Deleting file /store_00010001/DCIM/100NIKON/DSCN0131.NRW on the camera

DSCN0131.NRW.gz

The image is not sharp but at least it shows an image. Succes! Great, how to proceed from here? I would like access to the camera before taking a shot so I can change exposure time etc... As mentioned before I am still at the point where the lcd screen turns itself off as soon as I connect the USB cable. ;-)

msmeissn commented 2 years ago

i think regular capture works now ... for liveview ... need to check again if we can get that working :/

jurgenfd commented 2 years ago

Can I help you check?

What gui do you suggest for checking "regular capture". By command line it works. Could I try my favorite Kstars?

msmeissn commented 2 years ago

The regular capture you can also try with kstars I think.

For liveview i just put in a small change to libgphoto2 master that ignores the error currently, if you want to help test it there , can you rebuild libgphoto2 from current GIT again and try

gphoto2 --capture-preview

jurgenfd commented 2 years ago

I've done a git pull and make clean and again make for libgphoto2. I've checked the source change in the commit in the file camlibs/ptp2/library.c but no change observed:

jd@ub20:~/Developer/libgphoto2$ git status On branch master Your branch is up to date with 'origin/master'.

jd@ub20:~$ gphoto2 --capture-image-and-download New file is in location /store_00010001/DCIM/101NIKON/DSCN0154.JPG on the camera Saving file as DSCN0154.JPG Deleting file /store_00010001/DCIM/101NIKON/DSCN0154.JPG on the camera

jd@ub20:~$ env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --capture-preview

my-logfile.txt

Error

Liveview cannot start: Lens is retracting Error (-1: 'Unspecified error')

jurgenfd commented 2 years ago

I'll wait with trying to link the gphoto2 lib with kstars build. I'm not that good with building C code so it's a bit above my pay grade ;-)

GSI commented 2 years ago

The error also affects the Nikon Coolpix P1000 here:

% lsusb
Bus 001 Device 005: ID 04b0:0232 Nikon Corp. NIKON DSC COOLPIX P1000

% gphoto2 -v
This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.28         gcc, popt(m), exif, no cdk, no aa, jpeg, readline
libgphoto2      2.5.29         standard camlibs, gcc, no ltdl, EXIF
libgphoto2_port 0.12.0         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, no ltdl, EXIF, USB, serial without locking

% gphoto2 --stdout --capture-movie
Capturing preview frames as movie to 'stdout'. Press Ctrl-C to abort.

*** Error ***
Liveview cannot start: Lens is retracting
ERROR: Movie capture error... Exiting.
Movie capture finished (0 frames)

Let me know if I can be of further assistance.

msmeissn commented 2 years ago

likely the same issue sadly.

peterevertz commented 1 year ago

I am stuck with the same problem (P950). Tested with 2.5.30.1

To understand: Is the P950/P1000 not able to be used with gphoto2 ? (Because it is shuting down parts of the camera when USB is connected ? I think there is no Nikon USB connected software that able to capture. So it is likely impossible to make it work?)

Or is it "just" a bug to be hunted? I would like to help with that.

davidh- commented 1 year ago

Also wondering... @peterevertz @msmeissn

thursdaybw commented 9 months ago

I have experienced this exact same issue with the Nikonp950 too.

libgphto2 version 2.5.31. That commit previous mentioned to be "in master" is included in that release yes? Could someone confirm that for me, if it's not in that release I will attempt to build from the master branch.

As previously mentioned, but to be more clear and explicit, when I plug the USB cable that is connected to my linux/manjaro machine into the camera, the digital view display on the camera goes blank, and the lens retracts and the camera no long responds to any button presses except for the on/off button.

So the lens IS retracted, so it kind of makes sense that this happens:

gphoto2 --capture-movie 
Capturing preview frames as movie to 'movie.mjpg'. Press Ctrl-C to abort.      

*** Error ***              
Liveview cannot start: Lens is retracting

Seems likely that since the lens is retracted that just ignoring the error won't solve the issue. However the error is still occurring even in release libgphto2 version 2.5.31

gphoto2 --version
gphoto2 2.5.28

Copyright (c) 2000-2021 Marcus Meissner and others

gphoto2 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of gphoto2 under the terms of the GNU General Public
License. For more information about these matters, see the files named COPYING.

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.28         gcc, popt(m), exif, no cdk, no aa, jpeg, readline
libgphoto2      2.5.31         standard camlibs, gcc, no ltdl, EXIF
libgphoto2_port 0.12.2         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, no ltdl, EXIF, USB, serial without locking
msmeissn commented 9 months ago

i am afraid we either do not know the right opcodes to send, or the firmware just can't do it correctly. As Nikon does not support these Coolpix series for remote control, I fear its probably more firmware bugs.