- shutdown after one picture taken - General Help and Assistance on using CHDK stable releases - CHDK Forum  

- shutdown after one picture taken

  • 16 Replies
  • 425 Views
- shutdown after one picture taken
« on: 26 / April / 2020, 07:16:14 »
Advertisements
Hi,
I made a photobooth with a raspberry pi 3B+ and the pi camera for my wedding.
Now i want to use a canon camera powershot A2200 to take pictures with better quality.
I put the CHDK (a2200-100b-1.4.1-5462-full) on it at every boot (with the SD Card).
I made a new raspbian-buster to use it, and tried to follow this steps : https://www.stevemurch.com/build-a-photo-booth-for-your-next-party/2019/12

But, when i wanted to try the command:

Code: [Select]
gphoto2 --capture-image-and-download
It works the 1st time but it shutdown the canon camera and i when i try a second time, gphoto says there is no camera found.

Is there any more config to do with this camera or something to make it works ?

I tried with an other USB cable and it do the same.

I tried to use gphoto2 with my nikon D5600 and it works

Thanks!

*

Offline srsa_4c

  • ******
  • 4217
Re: - shutdown after one picture taken
« Reply #1 on: 26 / April / 2020, 07:45:50 »
Hi,
when i wanted to try the command:

Code: [Select]
gphoto2 --capture-image-and-download
It works the 1st time but it shutdown the canon camera and i when i try a second time, gphoto says there is no camera found.
I'm not familiar with what gphoto does under the hood when running that command, but I'd suspect it's something that the a2200 does not like. With "does not like" I mean it crashes, which is why it disappears afterwards.
You may want to give chdkptp a try, although that will require modifications to existing scripts. The camera is listed here with the note that entering playback mode after remote shooting causes a crash.

Re: - shutdown after one picture taken
« Reply #2 on: 26 / April / 2020, 10:24:27 »
You might want to check out this forum thread..  CHDKPTP based Photobooth

I put a bunch of detail in the fifth post.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: - shutdown after one picture taken
« Reply #3 on: 26 / April / 2020, 10:32:19 »
Thanks!

It seems working with the CHDKPTP, i can use the console when i am in the folder by launching the chdkptp.sh.
But when i want to put the chdkptp.sh in /bin folder with the "/home/pi/CHDKPTP" folder (this folder contains the chdkptp-r921 files), after i reboot, the chdkptp command doesn't work, i found this post on the forum :
https://chdk.setepontos.com/index.php?topic=12049.0

 but i didn't find anything to help me how to make a clean install.
I know i should be able to do it by myself but i don't find a step by step installation guide, even in the INSTALL.TXT and others files in the sources files

 :(


*

Offline reyalp

  • ******
  • 12537
Re: - shutdown after one picture taken
« Reply #4 on: 26 / April / 2020, 17:14:16 »
It seems working with the CHDKPTP, i can use the console when i am in the folder by launching the chdkptp.sh.
But when i want to put the chdkptp.sh in /bin folder with the "/home/pi/CHDKPTP" folder (this folder contains the chdkptp-r921 files), after i reboot, the chdkptp command doesn't work, i found this post on the forum :
I'm not sure what you are trying to do. You should be able to put the chdkptp folder anywhere, but the files within it need to be in the expected structure. You can't move just chdkptp.sh. If you want to start chdkptp, use the full path, like /home/pi/CHDKPTP/chdkptp.sh

If you want chdkptp to be available in the standard path, I'd suggest putting the chdkptp files in, e.g. /opt/chdkptp and then making a symlink like
Code: [Select]
ln -s  /opt/chdkptp/chdkptp.sh /usr/local/bin/chdkptp
But perhaps I misunderstood and you are trying to do something completely different
Don't forget what the H stands for.

Re: - shutdown after one picture taken
« Reply #5 on: 27 / April / 2020, 01:47:54 »
It seems working with the CHDKPTP, i can use the console when i am in the folder by launching the chdkptp.sh.
But when i want to put the chdkptp.sh in /bin folder with the "/home/pi/CHDKPTP" folder (this folder contains the chdkptp-r921 files), after i reboot, the chdkptp command doesn't work, i found this post on the forum :
I'm not sure what you are trying to do. You should be able to put the chdkptp folder anywhere, but the files within it need to be in the expected structure. You can't move just chdkptp.sh. If you want to start chdkptp, use the full path, like /home/pi/CHDKPTP/chdkptp.sh

If you want chdkptp to be available in the standard path, I'd suggest putting the chdkptp files in, e.g. /opt/chdkptp and then making a symlink like
Code: [Select]
ln -s  /opt/chdkptp/chdkptp.sh /usr/local/bin/chdkptp
But perhaps I misunderstood and you are trying to do something completely different

Thanks! It's exaclty what i wanted to do!
I tried the following commands and my canon works nicely:
Code: [Select]
chdkptp
___> connect
___> rec
___> remoteshoot /home/pi/Pictures/mypicture
___> remoteshoot /home/pi/Pictures/mypicture2
___> disconnect
___> quit

I tried several times remoteshoot and the camera doesn't shutdown!

Now i will try the CHDKPTP based Photobooth from waterwingz!

Thanks!

Re: - shutdown after one picture taken
« Reply #6 on: 27 / April / 2020, 11:36:45 »
You might want to check out this forum thread..  CHDKPTP based Photobooth

I put a bunch of detail in the fifth post.

Hi,

I tried to use it, but it's not in Python and i got too much error when i wanted to compile and run it.

My actual photobooth in python already do:
- use a screen touch interface
- take 4 pictures and make 1
- the picture can be downloaded by a smartphone with a qrcode (qrencode) and the wifi spot from the raspberry pi
- the photobooth display then the pictures with the qrcode,
(i used this link to to it : https://www.instructables.com/id/Wifi-Photobooth-With-a-Raspberry-Pi/)
But, because it's using the pi camera, i want to use my canon A2200 with now the chdkptp.py from https://github.com/jbaiter/chdkptp.py
but i got some errors when i wanted to install it (i don't know how to use chdkptp directly with python)
Code: [Select]
Failed to build wheel for chdkptp.py

Code: [Select]
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e68krr/chdkptp.py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-nAn0pP/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-e68krr/chdkptp.py/
Code: [Select]
Building wheels for collected packages: chdkptp.py Running setup.py bdist_wheel for chdkptp.py ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e68krr/chdkptp.py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-sJZ9Zd --python-tag cp27:
I only found some bug resolution because lua cannot find the library, because it has not been built or the path is incorrect, but nothing about what i get here.
After failed to find solution, maybe it seems my canon A2200 doesn't want to be used for the photobooth  :D

« Last Edit: 27 / April / 2020, 11:43:04 by bourbourg »

*

Offline reyalp

  • ******
  • 12537
Re: - shutdown after one picture taken
« Reply #7 on: 27 / April / 2020, 13:06:54 »
After failed to find solution, maybe it seems my canon A2200 doesn't want to be used for the photobooth  :D
This is a python package management or build environment problem, not a camera or CHDK problem.  I'm not sure what the problem is, it seems like there should be a log with a more specific error somewhere.

I did not create chdkptp.py and do not maintain it. However, I have successfully installed chdkptp.py on a raspberry pi using the fork at https://github.com/5up3rD4n1/chdkptp.py

In my notes, I have this:
Code: [Select]
sudo apt-get install liblua5.2-dev python3-pip
sudo apt-get install python3-venv

python3 -m venv chdkptp_py
source chdkptp_py/bin/activate
pip install lupa --install-option='--no-luajit'
pip install https://github.com/5up3rD4n1/chdkptp.py/releases/download/v0.1.4/chdkptp.py-0.1.4.tar.gz
Note the above was for a non root user, and used venv to keep everything isolated. This shouldn't be required, it's just how I did it.

You will also need the normal prerequisite packages for building software and building chdkptp. Probably something along the lines of
Code: [Select]
apt-get install build-essential libusb-dev libreadline-dev

Also note that chdkptp.py includes it's own (old) copy of chdkptp, it does not need, and will not use the chdkptp package you installed from the official site.
Don't forget what the H stands for.


Re: - shutdown after one picture taken
« Reply #8 on: 27 / April / 2020, 17:14:46 »
You might want to check out this forum thread..  CHDKPTP based Photobooth

I put a bunch of detail in the fifth post.
I tried to use it, but it's not in Python and i got too much error when i wanted to compile and run it.
It was  a quick & dirty program written in generic C.  It was never intended to compile under Python.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: - shutdown after one picture taken
« Reply #9 on: 28 / April / 2020, 03:01:01 »
After failed to find solution, maybe it seems my canon A2200 doesn't want to be used for the photobooth  :D
This is a python package management or build environment problem, not a camera or CHDK problem.  I'm not sure what the problem is, it seems like there should be a log with a more specific error somewhere.

I did not create chdkptp.py and do not maintain it. However, I have successfully installed chdkptp.py on a raspberry pi using the fork at https://github.com/5up3rD4n1/chdkptp.py

In my notes, I have this:
Code: [Select]
sudo apt-get install liblua5.2-dev python3-pip
sudo apt-get install python3-venv

python3 -m venv chdkptp_py
source chdkptp_py/bin/activate
pip install lupa --install-option='--no-luajit'
pip install https://github.com/5up3rD4n1/chdkptp.py/releases/download/v0.1.4/chdkptp.py-0.1.4.tar.gz
Note the above was for a non root user, and used venv to keep everything isolated. This shouldn't be required, it's just how I did it.

You will also need the normal prerequisite packages for building software and building chdkptp. Probably something along the lines of
Code: [Select]
apt-get install build-essential libusb-dev libreadline-dev

Also note that chdkptp.py includes it's own (old) copy of chdkptp, it does not need, and will not use the chdkptp package you installed from the official site.

Thanks i succeed to install it, but now i get an error when i try to import it:
i tried
import chdkptp :does'nt work,

I tried to change my python command startup :
python photobooth_control.py by python3 photobooth_control.py still get the error:

File "photobooth_control.py", line 7, in <module>
     import chdkptp_py
ModuleNotFoundError: No module named 'chdkptp'

I tried to find how to import it there:
https://chdkptppy.readthedocs.io/en/latest/# : nothing, but i found here:
https://github.com/5up3rD4n1/chdkptp.py:

Now you can use chdkptp simply running:

>>> import chdkptp
>>> chdkptp.list_devices()
[]
>>>
NOTE: if you installed the package and you are inside the repo dir and try to import chdkptp, it will probably throw an error because python is loading the local dir module not the installed one.


Maybe i get this last error when i try to import chdkptp ? How to say to pyhton to load the installed one ?
Many thanks for your helps!!

Edit: I tried too wihtout used venv , i get the same error when i try to import chdkptp
« Last Edit: 28 / April / 2020, 07:10:38 by bourbourg »

 

Related Topics