pibooth icon indicating copy to clipboard operation
pibooth copied to clipboard

Canon EOS 650D takes 4 shots instead of one

Open Ippephyx opened this issue 2 years ago • 25 comments

Hi, I have attached my 650D DSLR to a RPi 4, and for each and every photo it takes 4 shots (saving only one...) but it keeps taking 4 shots. So when we click on "4 shots"... well it the shutter takes 4x4 ... 16 ! shots. That "problem" is only found with pibooth. No problem whastoever with windows. I've tried PhotoboothProject.github.io too, same Pi, same DSRL, works as it should : just one shutter/shot per photo. Any help would be greatly appreciated.

Thanks a lot.

Ippephyx avatar Jun 05 '23 13:06 Ippephyx

My bad... It seems to be caused by the preview... Is there a way to only have 1 shutter preview, normal count-down and picture taken ? instead of 4 shutter previews ? Or maybe a live preview ? or no preview at all ?

Thanks.

Ippephyx avatar Jun 05 '23 13:06 Ippephyx

It is indeed linked to the preview. We didn't find a way to get video through Gphoto2 so we had to implement this fallback mechanism. My best advice is to use pibooth in hybrid mode: a Pi camera for the preview and the DSLR for the photo.

werdeil avatar Jun 05 '23 20:06 werdeil

I've stumbled into the same issue and it was caused by OpenCV apt pkg using an old gphoto2 library (rather than the one build locally)

I would recommand uninstalling OpenCV using apt and installing it manually using pip

supercairos avatar Jul 19 '23 22:07 supercairos

I @supercairos

Thanks for the feedback.

During a long time, it was not possible to install OpenCV with pip on PiOS. Is now possible? I could modify the setup to install it automatically using pip.

anxuae avatar Jul 20 '23 07:07 anxuae

I believe so, I've used opencv-python

But I might be in a special setup as I'm using a Rpi 4 with the 64bits and Debin Bullseye

supercairos avatar Jul 20 '23 08:07 supercairos

Actually looking at the precompiled files, it seams there is no 32bits version for OpenCV python binding: https://pypi.org/project/opencv-python/#files

supercairos avatar Jul 20 '23 08:07 supercairos

i've been trying with both openCV via apt and pip on Rpi 4 64bits Bullseye

the one installed with apt allow me to start pibooth, but then i get an oups something went wrong. the one installed with pip doesn't start because i cannot find my canon 650D

Is there a way to get the image of a working version ? or explain the steps you did @supercairos ? that would be awesome

adonno avatar Apr 08 '24 19:04 adonno

Hi @adonno,

I actually don't remember the proper steps, but I do remember that I built gphoto from sources. But in order to load it properly into PiBooth, you need to properly remove the apt version before (it is sometime installed by default).

Maybe if you have some error logs, I can help troubleshoot them...

supercairos avatar Apr 08 '24 20:04 supercairos

In order to install GPhoto, I've used:

wget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh
wget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/.env
chmod +x gphoto2-updater.sh
sudo ./gphoto2-updater.sh

supercairos avatar Apr 08 '24 20:04 supercairos

I'll leave tonight for 3 days but i'll come back with logs when i'm back thank you.

Can't wait to get it finally working and to start adding hardware buttons.

adonno avatar Apr 08 '24 21:04 adonno

In order to install GPhoto, I've used:


wget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh

wget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/.env

chmod +x gphoto2-updater.sh

sudo ./gphoto2-updater.sh

Yup did that it's also in their doc

adonno avatar Apr 08 '24 21:04 adonno

Check that the Gphoto PiBooth is loading is really the built version and not a PKG version.

A gnome picture utility is also using Gphoto so it's usually installed by default on rpi4...

supercairos avatar Apr 08 '24 22:04 supercairos

Please output the pibooth-diag output also :)

supercairos avatar Apr 08 '24 22:04 supercairos

hi i'm finally back from vacation Like i said I installed the PIP version and have tried with legacy on and off from the raspi-config

If I try with a webcam it works and the Camera is recognised on the PI since it shows the SD card

adonno@pibooth:~ $ pibooth
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
pygame-menu 4.0.7
[ INFO    ] pibooth           : Installed plugins: 
[ INFO    ] pibooth           : Starting the photo booth application on Raspberry pi 4B
[ WARN:[email protected]] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video0): can't open camera by index
[ERROR:[email protected]] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
[ WARN:[email protected]] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video1): can't open camera by index
[ERROR:[email protected]] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
[ WARN:[email protected]] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video2): can't open camera by index
[ERROR:[email protected]] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
/usr/local/lib/python3.9/dist-packages/pluggy/_manager.py:469: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: pibooth-core:camera, Hook: pibooth_setup_camera
OSError: Neither Raspberry Pi nor GPhoto2 nor OpenCV camera detected
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  outcome = Result.from_call(
Traceback (most recent call last):
  File "/usr/local/bin/pibooth", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/pibooth/booth.py", line 490, in main
    app = PiApplication(config, plugin_manager)
  File "/usr/local/lib/python3.9/dist-packages/pibooth/booth.py", line 131, in __init__
    self.camera = self._pm.hook.pibooth_setup_camera(cfg=self._config)
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_manager.py", line 473, in traced_hookexec
    return outcome.get_result()
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_result.py", line 99, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_result.py", line 61, in from_call
    result = func()
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_manager.py", line 470, in <lambda>
    lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_callers.py", line 155, in _multicall
    teardown[0].send(outcome)
  File "/usr/local/lib/python3.9/dist-packages/pibooth/plugins/camera_plugin.py", line 28, in pibooth_setup_camera
    cam = camera.find_camera()
  File "/usr/local/lib/python3.9/dist-packages/pibooth/camera/__init__.py", line 52, in find_camera
    raise EnvironmentError("Neither Raspberry Pi nor GPhoto2 nor OpenCV camera detected")
OSError: Neither Raspberry Pi nor GPhoto2 nor OpenCV camera detected

adonno avatar Apr 12 '24 15:04 adonno

Can you print the version of Gphoto ?

gphoto2 --version and pibooth-diag

supercairos avatar Apr 12 '24 15:04 supercairos

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, no jpeg, no readline
libgphoto2      2.5.27         standard camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, ltdl, EXIF, USB, serial without locking

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
pygame-menu 4.0.7
Pibooth version installed: 2.0.8
Installed plugins: 
gPhoto2 not installed, cannot diagnose connected DSLR

hm this is wierd gphoto2 not installed ?

adonno avatar Apr 12 '24 15:04 adonno

btw thank you for your quick response

adonno avatar Apr 12 '24 15:04 adonno

Yes, there might be an error here.

You're on Bookworm 64bits right ?

supercairos avatar Apr 12 '24 15:04 supercairos

since it was working for you on bullseye i tried to replicate your setup

adonno@pibooth:~ $ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
adonno@pibooth:~ $ uname -m
aarch64

adonno avatar Apr 12 '24 15:04 adonno

Maybe try the RasPi Bookworm version (Debian 12) aarch64 ? It's the one i've used.

Also, as soon as it's installed, uninstall the gphoto2 & libgphoto2 packages and build them from source.

You should have version 2.5.31 or above listed as libgphoto2 version

supercairos avatar Apr 12 '24 15:04 supercairos

You can see here the version of the software It's building from source: https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/.env

supercairos avatar Apr 12 '24 15:04 supercairos

Good luck 🙏

supercairos avatar Apr 12 '24 15:04 supercairos

I worked 👍 now i'm tempted to try on a pi5 😄

adonno avatar Apr 12 '24 21:04 adonno

Glad it worked! On my camera (700D) putting it on video mode gave a much better frame-rate than in picture mode.

I haven't tried on a pi5 (yet) but I didn't felt it was the RPi 4 that was limiting the camera fps.

Would love some feedback on a pi5 tho :)

supercairos avatar Apr 12 '24 21:04 supercairos

It worked as a charm on a pi 5

now that i have both working i will test the speed difference regarding the frame-rate, i'm using a webcam for previews and it works like. charm actually, much faster pictures since it doesn't need to open /close the mirror for previews. Only point now is to find a webcam that has the almost same zoom level as the canon lens i'm using

adonno avatar Apr 12 '24 22:04 adonno