Discussion:
[gphoto-devel] Error setting shutterspeed on Nikon D90
Maurice-Pascal Sonnemann
2009-09-10 19:53:10 UTC
Permalink
Hi
I am using version 2.4.7 (both gphoto2 and libgphoto2) connected to a Nikon
D90.
When I try to set the shutterspeed while in mode S (shutter priority),
everything works fine. But when I switch to manual mode, I get the following
error:
$ gphoto2 --set-config-index shutterspeed=50

*** Error ***
The property 'Shutter Speed' / 0x500d was not set, PTP errorcode 0xa008.

*** Error ***
Failed to set new configuration value 50 for configuration entry shutterspeed.
*** Error (-1: 'Unspecified error') ***


The debug log is attached.
I haven't subscribed so please CC me when you answer.

Regards, Maurice
Marcus Meissner
2009-09-10 20:13:08 UTC
Permalink
Post by Maurice-Pascal Sonnemann
Hi
I am using version 2.4.7 (both gphoto2 and libgphoto2) connected to a Nikon
D90.
When I try to set the shutterspeed while in mode S (shutter priority),
everything works fine. But when I switch to manual mode, I get the following
$ gphoto2 --set-config-index shutterspeed=50
*** Error ***
The property 'Shutter Speed' / 0x500d was not set, PTP errorcode 0xa008.
*** Error ***
Failed to set new configuration value 50 for configuration entry shutterspeed.
*** Error (-1: 'Unspecified error') ***
The debug log is attached.
I haven't subscribed so please CC me when you answer.
Can you try gphoto2 --set-config-index shutterspeed2=50

ciao, Marcus
Maurice-Pascal Sonnemann
2009-09-10 20:26:14 UTC
Permalink
Post by Marcus Meissner
Post by Maurice-Pascal Sonnemann
Hi
I am using version 2.4.7 (both gphoto2 and libgphoto2) connected to a
Nikon D90.
When I try to set the shutterspeed while in mode S (shutter priority),
everything works fine. But when I switch to manual mode, I get the
$ gphoto2 --set-config-index shutterspeed=50
*** Error ***
The property 'Shutter Speed' / 0x500d was not set, PTP errorcode 0xa008.
*** Error ***
Failed to set new configuration value 50 for configuration entry
shutterspeed. *** Error (-1: 'Unspecified error') ***
The debug log is attached.
I haven't subscribed so please CC me when you answer.
Can you try gphoto2 --set-config-index shutterspeed2=50
ciao, Marcus
Thanks for the quick reply.

"gphoto2 --set-config-index shutterspeed2=50" runs without error, but it does
not set the value correctly, as the camera displays still the old value.

More interestingly "gphoto2 --set-config-index shutterspeed2=50 --capture-
image-and-download" still fails, this time with "*** Error (-1: 'Unspecified
error') ***"

Log is attached.


Regards, Maurice
Marcus Meissner
2009-09-10 20:39:32 UTC
Permalink
Post by Maurice-Pascal Sonnemann
Post by Marcus Meissner
Post by Maurice-Pascal Sonnemann
Hi
I am using version 2.4.7 (both gphoto2 and libgphoto2) connected to a
Nikon D90.
When I try to set the shutterspeed while in mode S (shutter priority),
everything works fine. But when I switch to manual mode, I get the
$ gphoto2 --set-config-index shutterspeed=50
*** Error ***
The property 'Shutter Speed' / 0x500d was not set, PTP errorcode 0xa008.
*** Error ***
Failed to set new configuration value 50 for configuration entry
shutterspeed. *** Error (-1: 'Unspecified error') ***
The debug log is attached.
I haven't subscribed so please CC me when you answer.
Can you try gphoto2 --set-config-index shutterspeed2=50
ciao, Marcus
Thanks for the quick reply.
"gphoto2 --set-config-index shutterspeed2=50" runs without error, but it does
not set the value correctly, as the camera displays still the old value.
Oh.
Post by Maurice-Pascal Sonnemann
More interestingly "gphoto2 --set-config-index shutterspeed2=50 --capture-
image-and-download" still fails, this time with "*** Error (-1: 'Unspecified
error') ***"
Log is attached.
0000 0c 00 00 00 01 00 cb 90-03 01 00 00 ............
0000 0c 00 00 00 03 00 02 a0-03 01 00 00 ............
This is:

ptp.h:#define PTP_RC_NIKON_OutOfFocus 0xA002

Should perhaps be more verbosely reported :/

ciao, Marcus
Marcus Meissner
2009-09-10 21:51:15 UTC
Permalink
Post by Maurice-Pascal Sonnemann
Hi
I am using version 2.4.7 (both gphoto2 and libgphoto2) connected to a
Nikon D90.
When I try to set the shutterspeed while in mode S (shutter priority),
everything works fine. But when I switch to manual mode, I get the
$ gphoto2 --set-config-index shutterspeed=50
The property 'Shutter Speed' / 0x500d was not set, PTP errorcode 0xa008.
*** Error ***
Failed to set new configuration value 50 for configuration entry
shutterspeed. *** Error (-1: 'Unspecified error') ***
I tried with my D90, it works fine :/ (I have the Nikkor 18-200 VR lens).
(Even with the lens cap on.)

0xa008 is PTP_RC_NIKON_ShutterSpeedBulb btw, but I am not sure
what it means in this context.

Ciao, Marcus
Maurice-Pascal Sonnemann
2009-09-11 03:51:24 UTC
Permalink
Post by Marcus Meissner
Post by Maurice-Pascal Sonnemann
Hi
I am using version 2.4.7 (both gphoto2 and libgphoto2) connected to a
Nikon D90.
When I try to set the shutterspeed while in mode S (shutter
priority), everything works fine. But when I switch to manual mode, I
$ gphoto2 --set-config-index shutterspeed=50
The property 'Shutter Speed' / 0x500d was not set, PTP errorcode 0xa008.
*** Error ***
Failed to set new configuration value 50 for configuration entry
shutterspeed. *** Error (-1: 'Unspecified error') ***
I tried with my D90, it works fine :/ (I have the Nikkor 18-200 VR lens).
(Even with the lens cap on.)
0xa008 is PTP_RC_NIKON_ShutterSpeedBulb btw, but I am not sure
what it means in this context.
Ciao, Marcus
I found the source of the error.
In libgphoto2/camlibs/ptp2/config.c where the nearest value for the setting is
determined, the comparison works with the wrong types.
using dpd->FORM.Enum.SupportedValue[i].i32 instead of u32 solves it for me.

A small patch is included.

Regards, Maurice
Marcus Meissner
2009-09-12 16:43:22 UTC
Permalink
Post by Maurice-Pascal Sonnemann
I found the source of the error.
In libgphoto2/camlibs/ptp2/config.c where the nearest value for the setting is
determined, the comparison works with the wrong types.
using dpd->FORM.Enum.SupportedValue[i].i32 instead of u32 solves it for me.
Thanks for the investigation!

The property is u32, so it has to stay ...

The issue itself is that the values in the functions were integers, but
should have been unsigned integers too.

I am using this patch which seems to cure it too.

Ciao, Marcus

Index: config.c
===================================================================
--- config.c (Revision 12434)
+++ config.c (Revision 12435)
@@ -1661,7 +1661,8 @@
static int
_put_ExpTime(CONFIG_PUT_ARGS)
{
- int ret, i, delta, xval;
+ int ret;
+ unsigned int i,delta,xval;
float val;
char *value;

@@ -1676,6 +1677,7 @@
xval = val;
/* match the closest value */
for (i=0;i<dpd->FORM.Enum.NumberOfValues; i++) {
+ /*gp_log (GP_LOG_DEBUG,"ptp2/_put_ExpTime","delta is currently %d, val is %f, supval is %u, abs is %u",delta,val,dpd->FORM.Enum.SupportedValue[i].u32,abs(val - dpd->FORM.Enum.SupportedValue[i].u32));*/
if (abs(val - dpd->FORM.Enum.SupportedValue[i].u32)<delta) {
xval = dpd->FORM.Enum.SupportedValue[i].u32;
delta = abs(val - dpd->FORM.Enum.SupportedValue[i].u32);

Maurice-Pascal Sonnemann
2009-09-11 01:21:59 UTC
Permalink
Post by Marcus Meissner
Post by Maurice-Pascal Sonnemann
Hi
I am using version 2.4.7 (both gphoto2 and libgphoto2) connected to a
Nikon D90.
When I try to set the shutterspeed while in mode S (shutter
priority), everything works fine. But when I switch to manual mode, I
$ gphoto2 --set-config-index shutterspeed=50
The property 'Shutter Speed' / 0x500d was not set, PTP errorcode 0xa008.
*** Error ***
Failed to set new configuration value 50 for configuration entry
shutterspeed. *** Error (-1: 'Unspecified error') ***
I tried with my D90, it works fine :/ (I have the Nikkor 18-200 VR lens).
(Even with the lens cap on.)
0xa008 is PTP_RC_NIKON_ShutterSpeedBulb btw, but I am not sure
what it means in this context.
Ciao, Marcus
I just tried the trunk version, still the same error for me.
For reference, I tested with a Nikkor 18-105mm and a Tamron 90mm (which both
focus fine).

One thing I noticed is that a successful attempt results in:
"ptp2/_put_ExpTime(2): value 5.0000s is 50000.000000, closest match was 50000"
while an erroneous attempt results in
"ptp2/_put_ExpTime(2): value 5.0000s is 50000.000000, closest match was -1"

There are two logs attached of a successful and an unsuccessful attempt.

Regards, Maurice
Loading...