Open vincent1903 opened 4 years ago
I created an other config file called d5600.cfg as specified in the log file, with the following settings :
[Startup]
imagequality = JPEG Fine
autofocus = On
[Shutdown]
[Idle]
[Active]
But it doesn't change anything :(
What I suppose: I think this is related to the Nikon AF system. When using Liveview (what the python gphoto2 camera does and the gphoto2 cli doesn't) you have other parameters impacting the AF system. For example, with Liveview you have these parameters :
gphoto 2 :
Label: Live View AF Mode
Readonly: 0
Type: RADIO
Current: Wide-area AF
Choice: 0 Face-priority AF
Choice: 1 Wide-area AF
Choice: 2 Normal-area AF
Choice: 3 Subject-tracking AF
END
The first initializing picture does'nt use liveview, that's why the focus work, then the liveview starts, and focus mode changes.
But even with the new parameters in the camera config file autofocus is still not activated :(
[Startup]
imagequality = JPEG Fine
autofocus = On
liveviewafmode = Normal-area AF
@vincent1903 I ran into the same issue and created a PR here: https://github.com/reuterbal/photobooth/pull/215
Hello @thebino
thanks for helping me, nevertheless I tried to copy your file but now the photobooth won't start. When starting the photobooth, I see the camera making the focus while I have the "Starting the photobooth" message, and I get an unexpected error :
020-04-06 19:50:03,862 - root - INFO - Using camera with preview functionality
2020-04-06 19:50:03,875 - root - INFO - CameraGphoto2: change autofocusdrive to "1"
2020-04-06 19:50:16,566 - root - ERROR - CameraProcess: Exception "[-1] Unspecified error"
Traceback (most recent call last):
File "/home/pi/photobooth/photobooth/main.py", line 66, in run
if cap.run():
File "/home/pi/photobooth/photobooth/camera/__init__.py", line 94, in run
self.handleState(state)
File "/home/pi/photobooth/photobooth/camera/__init__.py", line 101, in handleState
self.startup()
File "/home/pi/photobooth/photobooth/camera/__init__.py", line 67, in startup
test_picture = self._cap.getPicture()
File "/home/pi/photobooth/photobooth/camera/CameraGphoto2.py", line 144, in getPicture
file_path = self._cap.capture(gp.GP_CAPTURE_IMAGE)
gphoto2.GPhoto2Error: [-1] Unspecified error
2020-04-06 19:50:16,575 - root - DEBUG - CameraProcess: Running...
2020-04-06 19:50:16,577 - root - DEBUG - Context: Handling event "Camera: [-1] Unspecified error"
2020-04-06 19:50:16,578 - root - DEBUG - Context: New state is "ErrorState"
2020-04-06 19:50:16,581 - root - ERROR - Camera: [-1] Unspecified error
2020-04-06 19:50:19,165 - root - DEBUG - Context: Handling event "abort"
2020-04-06 19:50:19,167 - root - DEBUG - Context: New state is "TeardownState"
2020-04-06 19:50:19,199 - root - DEBUG - Context: Handling event "welcome"
2020-04-06 19:50:19,200 - root - DEBUG - Context: New state is "WelcomeState"
2020-04-06 19:50:20,910 - root - DEBUG - Context: Handling event "Teardown(0)"
2020-04-06 19:50:20,911 - root - DEBUG - Context: New state is "TeardownState"
2020-04-06 19:50:20,916 - root - DEBUG - CameraProcess: Exit
2020-04-06 19:50:20,917 - root - DEBUG - WorkerProcess: Exit
2020-04-06 19:50:20,919 - root - DEBUG - GpioProcess: Exit
2020-04-06 19:50:20,924 - root - DEBUG - GuiProcess: Exit
2020-04-06 19:50:20,967 - root - DEBUG - All processes joined, returning code 0
2020-04-06 19:50:20,973 - root - INFO - Exiting photobooth with status code 0
After that, if I click on retry, it says that it cannot claim the USB device.
I tried to do a gphoto2 --set-config=autofocusdrive=1 and it do the focus without error.
Hi, sorry to hear that. Can you try to change the camera to continuous focus and also adjust the liveviewaffocus You should be able to set the autofocusdrive multiple times without an error.
I change the following settings :
in liveview :
but the issue remain.
I don't know if it is useful or not but there is the gphoto2 commands i used
pi@photobooth1:~/photobooth/photobooth/camera $ gphoto2 --get-config=autofocusdrive
Label: Drive Nikon DSLR Autofocus
Readonly: 0
Type: TOGGLE
Current: 0
END
pi@photobooth1:~/photobooth/photobooth/camera $ gphoto2 --set-config=autofocusdrive=1
pi@photobooth1:~/photobooth/photobooth/camera $ gphoto2 --get-config=autofocusdrive
Label: Drive Nikon DSLR Autofocus
Readonly: 0
Type: TOGGLE
Current: 0
END
pi@photobooth1:~/photobooth/photobooth/camera $ gphoto2 --set-config=autofocusdrive=0
pi@photobooth1:~/photobooth/photobooth/camera $ gphoto2 --get-config=autofocusdrive
Label: Drive Nikon DSLR Autofocus
Readonly: 0
Type: TOGGLE
Current: 0
END
@vincent1903 - was this issue resolved? I am having the same issue with my Nikon D90, it will autofocus first but not on each of the 4 photos, but it shows a preview on the count down. However, I have managed to get the camera to autofocus but it will not show a preview on the count down. Please let me know if you have come to a solution. I have looked into using a Picamera for the preview to allow the Nikon to autofocus, but I no one has offered a solution in this repo. If you know different please let me know
Describe the bug
When using the python2 camera, the focus will be done at the initializing, but not for the next 4 pictures.
Otherwise, it works when I use the gphoto2 command line camera : the focus is done at every triggers but I don't have live preview functionnality
I read that some cameras models needs a configuration file in /photobooth/camera/models/ so I created a file named nikond5600.cfg with the same content that canoneos500d.cfg. I don't know if I've done right because I don't know how this config file work and what to put in
Expected behavior
autofocus between each pictures A clear and concise description of what you expected to happen.
Hardware (please complete the following information)
Software (please complete the following information)
Photobooth log