gphoto / libgphoto2

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

Set camera configuration #917

Closed martinsgronli closed 1 year ago

martinsgronli commented 1 year ago

Bug description: Hi

I want to configure my camera with new values. However, using set_value() does not seem to cause a permanent change as the two print statements below give different values. I wonder if I use camera.set_config(config) in the wrong way?

Camera: Nikon Z7_2

libgphoto2 and gphoto2 version: 2.5.27

To reproduce:

camera = gp.Camera()
camera.init()
config1 = camera.get_config()
iso1 = config.get_child_by_name("iso")
iso1.set_value("340") 
print(iso1.get_value())    # Print statement 1, prints 340
camera.set_config(config1)

config2 = camera.get_config()
iso2 = config2.get_child_by_name("iso")
print(iso2.get_value())    # Print statement 2, prints 320 (default value)
msmeissn commented 1 year ago

Can you try with the gphoto2 command line tool and see if there are errors reported?

for instance I do not think 340 is a valid ISO value.

320 would be a supported one.

martinsgronli commented 1 year ago

You are absolutely right, I also used unsupported values for other configurations. Thank you.

msmeissn commented 1 year ago

ok! :) good reminder to add error reporting to your python script :)