Page 6 of 7

Re: Photography Projects

Posted: Fri Apr 19, 2013 4:13 pm
by zoelqivlie
hi, I tried "How to setup a schnaphoto host system on a Raspberry Pi" from https://github.com/tgoerlich/Schnapphot ... spberry-Pi
but schnapphoto daemon can't detect my cam cannon 7d with Pi and HH ...:-(

Re: Photography Projects

Posted: Wed Apr 24, 2013 1:03 pm
by tadunique
Have you tried motion?

Re: Photography Projects

Posted: Wed Apr 24, 2013 4:21 pm
by rlee247
How would I go about writing a code that will combine the
$ gphoto2 --capture-image-and-download
and
$ sudo ./usbreset /dev/bus/usb/002/003
commands so that it would execute both with one command? I saw the for loop code in a previous post but am not sure which libraries I would have to include or how to call functions from other apps into a code.

Also-for gphoto2, is there a way I can automatically generate new filenames so that I don't have to overwrite or rename after every picture?

(usbreset is from http://marc.info/?l=linux-usb&m=121459435621262&w=2)

Re: Photography Projects

Posted: Fri Apr 26, 2013 10:30 am
by PaulMPhoto
I've been following this thread for sometime and have created a wireless camera grip following David Hunt's model.
I found that even with latest Pi and all updates you still need the usbreset as described earlier and if as I do you want to use --keep to keep the original photos on the camera memory card I need to upgrade gphoto2 to the later versions by downloading and compiling it myself.
With various scripts I have it works well and I can use my camera as normal but pics are uploaded automatically to my computer via FTP the originals are also still on the camera if needed.
However I realised that it would be more useful for taking pictures remotely and that typing in command line vis ssh was a bit clunky and not for everyone so I have developed a web interface to control the camera and to be able to see the results quickly.
The interface allows you to change any of the camera parameters Speed, Aperture, ISO, White balance etc. and then take and display a picture. If the camera supports it you can also do a quick preview.
It should work with any gphoto supported camera but there is a small config file needed for each one as the description of the config settings varies depending on the camera.

Here's how I did it. I already had Apache and PHP working on the Pi so the first step was to work out how to use gphoto2 from PHP. I found the PHP exec function e.g.
exec ('gphoto2 --auto-detect',$output,$int);
However the big problem I had was getting the permissions right. The default Apache user is www-data. www-data needed to send commands via exec to the camera via the usb port in use.
After much trial and error I found I needed to change 2 things.
Firstly to get it working at all I needed to edit /etc/sudoers file using visudo. I gave www-data the same permissions as the default user pi by the following to the end of the file:
www-data ALL=(ALL) NOPASSWD: ALL
I also needed to change the permissions on the USB port in use for it all to work. Using the info from earlier in the thread to find the port I created the following script called usbperm
#!/bin/bash
#
dev=`gphoto2 --auto-detect | grep usb | cut -b 36-42 | sed 's/,/\//'`
sudo chmod 777 /dev/bus/usb/${dev}
exit 0
Changing the permissions to 777 maybe overkill but it works!

Then just a couple of weeks to get the web page working as I wanted and looking pretty (please notice the symbols matching the camera ones and rounded corners!)
I found using exec('gphoto2 --list-all-config',$output,$int); to get the camera config settings and then parsing it to find the individual settings was much faster than separate calls to get each one.
Changes then made using --set-config from popup windows for each setting.
Clicking on the look-a-like camera button takes a picture with
exec('gphoto2 --capture-image-and-download --keep --filename capt0000.jpg --force-overwrite --quiet');
For my Canon I also needed to insert every time a --set-config /main/settings/capturetarget=1 to force it to use the card and not the internal memory of the camera which it keeps defaulting to.
Clicking on Preview takes a quick preview (if the camera supports it) using
exec('gphoto2 --capture-image-and-download --filename capture_preview.jpg --force-overwrite --quiet')
Of course after each call to gphoto2 I need to do a usb reset with
exec('usbreset /dev/bus/usb/'.$dev);
usbreset and usbperm were added to /usr/bin/ with full permissions.
Here's a screenshot of what it looks like
Image
Full size at http://www.paulmorganphoto.co.uk/PhotoWeb.jpg

Re: Photography Projects

Posted: Fri Apr 26, 2013 10:34 am
by texy
Hi Paul,
and welcome to the forum. It seems strange that you still need to use usbreset, even though you have compiled gphoto yourself. Did you not use the gpoto 'patch' to the source code before compiling. You shouldn't need to use usbreset with this patch to gphoto ;)

Texy

Re: Photography Projects

Posted: Fri Apr 26, 2013 10:40 am
by PaulMPhoto
I used the gphoto-suite way of building gphoto2 which when I did it didn't include the patch. Maybe I will investigate the patch. Unless it speeds things up I may also use the if it's working leave it alone rule!

Re: Photography Projects

Posted: Fri Apr 26, 2013 10:41 am
by texy
rlee247 wrote:How would I go about writing a code that will combine the
$ gphoto2 --capture-image-and-download
and
$ sudo ./usbreset /dev/bus/usb/002/003
commands so that it would execute both with one command? I saw the for loop code in a previous post but am not sure which libraries I would have to include or how to call functions from other apps into a code.

Also-for gphoto2, is there a way I can automatically generate new filenames so that I don't have to overwrite or rename after every picture?

(usbreset is from http://marc.info/?l=linux-usb&m=121459435621262&w=2)

...you shouldn't need to use usbreset at all if you can compile gphoto with the latest patch.
Hope this helps,
Texy

Re: Photography Projects

Posted: Sun Apr 28, 2013 10:56 pm
by rlee247
Is this patch the one uploaded by GonZoo?
https://github.com/gonzalo/gphoto2-updater

Re: Photography Projects

Posted: Sun Apr 28, 2013 11:23 pm
by GarethD
PaulMPhoto wrote:I've been following this thread for sometime and have created a wireless camera grip following David Hunt's model.
I found that even with latest Pi and all updates you still need the usbreset as described earlier and if as I do you want to use --keep to keep the original photos on the camera memory card I need to upgrade gphoto2 to the later versions by downloading and compiling it myself.
With various scripts I have it works well and I can use my camera as normal but pics are uploaded automatically to my computer via FTP the originals are also still on the camera if needed.
However I realised that it would be more useful for taking pictures remotely and that typing in command line vis ssh was a bit clunky and not for everyone so I have developed a web interface to control the camera and to be able to see the results quickly.
The interface allows you to change any of the camera parameters Speed, Aperture, ISO, White balance etc. and then take and display a picture. If the camera supports it you can also do a quick preview.
It should work with any gphoto supported camera but there is a small config file needed for each one as the description of the config settings varies depending on the camera.

Here's how I did it. I already had Apache and PHP working on the Pi so the first step was to work out how to use gphoto2 from PHP. I found the PHP exec function e.g.
exec ('gphoto2 --auto-detect',$output,$int);
However the big problem I had was getting the permissions right. The default Apache user is www-data. www-data needed to send commands via exec to the camera via the usb port in use.
After much trial and error I found I needed to change 2 things.
Firstly to get it working at all I needed to edit /etc/sudoers file using visudo. I gave www-data the same permissions as the default user pi by the following to the end of the file:
www-data ALL=(ALL) NOPASSWD: ALL
I also needed to change the permissions on the USB port in use for it all to work. Using the info from earlier in the thread to find the port I created the following script called usbperm
#!/bin/bash
#
dev=`gphoto2 --auto-detect | grep usb | cut -b 36-42 | sed 's/,/\//'`
sudo chmod 777 /dev/bus/usb/${dev}
exit 0
Changing the permissions to 777 maybe overkill but it works!

Then just a couple of weeks to get the web page working as I wanted and looking pretty (please notice the symbols matching the camera ones and rounded corners!)
I found using exec('gphoto2 --list-all-config',$output,$int); to get the camera config settings and then parsing it to find the individual settings was much faster than separate calls to get each one.
Changes then made using --set-config from popup windows for each setting.
Clicking on the look-a-like camera button takes a picture with
exec('gphoto2 --capture-image-and-download --keep --filename capt0000.jpg --force-overwrite --quiet');
For my Canon I also needed to insert every time a --set-config /main/settings/capturetarget=1 to force it to use the card and not the internal memory of the camera which it keeps defaulting to.
Clicking on Preview takes a quick preview (if the camera supports it) using
exec('gphoto2 --capture-image-and-download --filename capture_preview.jpg --force-overwrite --quiet')
Of course after each call to gphoto2 I need to do a usb reset with
exec('usbreset /dev/bus/usb/'.$dev);
usbreset and usbperm were added to /usr/bin/ with full permissions.
Here's a screenshot of what it looks like
Image
Full size at http://www.paulmorganphoto.co.uk/PhotoWeb.jpg

This looks really good, just what I was looking for, any chance of looking at your scripts, or is there a tutorial.

Re: Photography Projects

Posted: Mon Apr 29, 2013 5:12 am
by texy
rlee247 wrote:Is this patch the one uploaded by GonZoo?
https://github.com/gonzalo/gphoto2-updater

No - it is here :
http://gphoto.10949.n7.nabble.com/test- ... 12907.html

Texy

Re: Photography Projects

Posted: Fri May 03, 2013 5:17 am
by easydiy
PaulMPhoto wrote:I've been following this thread for sometime and have created a wireless camera grip following David Hunt's model.
I found that even with latest Pi and all updates you still need the usbreset as described earlier and if as I do you want to use --keep to keep the original photos on the camera memory card I need to upgrade gphoto2 to the later versions by downloading and compiling it myself.
With various scripts I have it works well and I can use my camera as normal but pics are uploaded automatically to my computer via FTP the originals are also still on the camera if needed.
However I realised that it would be more useful for taking pictures remotely and that typing in command line vis ssh was a bit clunky and not for everyone so I have developed a web interface to control the camera and to be able to see the results quickly.
The interface allows you to change any of the camera parameters Speed, Aperture, ISO, White balance etc. and then take and display a picture. If the camera supports it you can also do a quick preview.
It should work with any gphoto supported camera but there is a small config file needed for each one as the description of the config settings varies depending on the camera.

Here's how I did it. I already had Apache and PHP working on the Pi so the first step was to work out how to use gphoto2 from PHP. I found the PHP exec function e.g.
exec ('gphoto2 --auto-detect',$output,$int);
However the big problem I had was getting the permissions right. The default Apache user is www-data. www-data needed to send commands via exec to the camera via the usb port in use.
After much trial and error I found I needed to change 2 things.
Firstly to get it working at all I needed to edit /etc/sudoers file using visudo. I gave www-data the same permissions as the default user pi by the following to the end of the file:
www-data ALL=(ALL) NOPASSWD: ALL
I also needed to change the permissions on the USB port in use for it all to work. Using the info from earlier in the thread to find the port I created the following script called usbperm
#!/bin/bash
#
dev=`gphoto2 --auto-detect | grep usb | cut -b 36-42 | sed 's/,/\//'`
sudo chmod 777 /dev/bus/usb/${dev}
exit 0
Changing the permissions to 777 maybe overkill but it works!

Then just a couple of weeks to get the web page working as I wanted and looking pretty (please notice the symbols matching the camera ones and rounded corners!)
I found using exec('gphoto2 --list-all-config',$output,$int); to get the camera config settings and then parsing it to find the individual settings was much faster than separate calls to get each one.
Changes then made using --set-config from popup windows for each setting.
Clicking on the look-a-like camera button takes a picture with
exec('gphoto2 --capture-image-and-download --keep --filename capt0000.jpg --force-overwrite --quiet');
For my Canon I also needed to insert every time a --set-config /main/settings/capturetarget=1 to force it to use the card and not the internal memory of the camera which it keeps defaulting to.
Clicking on Preview takes a quick preview (if the camera supports it) using
exec('gphoto2 --capture-image-and-download --filename capture_preview.jpg --force-overwrite --quiet')
Of course after each call to gphoto2 I need to do a usb reset with
exec('usbreset /dev/bus/usb/'.$dev);
usbreset and usbperm were added to /usr/bin/ with full permissions.
Here's a screenshot of what it looks like
Image
Full size at http://www.paulmorganphoto.co.uk/PhotoWeb.jpg
Hi Paul,
An interesting post! How could you get the value of the exposure level indicator in the viewfinder? I analised the output of my camera with gphoto2, but could not find the like value.

Re: Photography Projects

Posted: Mon May 13, 2013 12:04 pm
by texy
mald wrote:Hey Rodd,

A patch is proposed for gphoto might have a patch that fixes the rpi issue. They are looking for somebody to test it. Maybe you can give his patch a try (without the --keep) and see if it works.

http://gphoto.10949.n7.nabble.com/test- ... 12907.html

..so this has proven to work. What needs to happen so that it is included in the latest version of gphoto available to the raspbian distro?
Just to be clear the latest version includes the fix and is gphoto2 2.5.2. When will an 'apt-get install gphoto' install the latest, or an apt-get upgrade update an older version?

Texy

Re: Photography Projects

Posted: Tue May 28, 2013 8:51 pm
by andy33
So does the latest version of gphoto2 2.5.2 fix the usb issue? If so could someone please explain how to compile it on the pi.

Thanks in advance.

Andrew.

Re: Photography Projects

Posted: Tue May 28, 2013 9:15 pm
by texy
Andy,
I haven't actually compiled that version, but it includes the fix that does fix the usb reset problem.
I used these instructions to compile gphoto :
http://www.yannock.be/computer/compilin ... spberry-pi

Hope this helps,
Texy

Re: Photography Projects

Posted: Sat Jun 01, 2013 11:10 am
by andy33
Thanks Texy,

I tried the method described in the link but I didn't have much success. I then found this script https://github.com/gonzalo/gphoto2-updater Although I didn't run it as a script. I just ran the commands individually as I was pushed for time. I now have the latest version of gphoto2 on my pi and I'm using it for time-lapse photography using the method described here. http://blog.davidsingleton.org/raspberr ... controller . Although I'm not using the adafruit lcd plate.

Andy

Re: Photography Projects

Posted: Wed Jun 19, 2013 2:12 pm
by bugloss
Hi
I've got gphoto2 running to take timelapse stills I'm calling it from the hard drive as I don't want the photos stored on the camera.

/media/g_drive/test $ sudo gphoto2 --capture-image-and-download --interval=5 --filename=%d%m%y_%H%M%S_%n.jpg

I'm assuming that this should give me an unlimited number of consecutively numbered .jpeg files with date/time stamp.

It gives me a filename like this 190613_100516_120.jpg

I want this to be executable on boot in the event of a power cut and to continue with the existing file numbering sequence.

When I test this by stopping gphoto2 and then restarting it again it hangs, as I guess that gphoto2 wants to start afresh from 0000.jpeg but can't as this file already exists in the directory. Is there any way of getting gphoto2 to read the last file number in the directory and append the new .jpeg to the existing file sequence when it restarts?

Adam

Controlling exposure and interval

Posted: Fri Sep 27, 2013 11:06 pm
by SlowPhotography
Hi everyone!

I hope this is the right place for my post.
For night photography I need to control the exposure of a DSLR or equivalent, not just interval and download image.
If an external light meter could be hooked up to a Pi and used to change for example the shutter speed and ISO that would be amazing and I would pay someone to make that for me/tell me how it's done. The light meter on DSLRs (even Canon 1Dx and Nikon D4) have a limit to how dark they will go. I need to be able to handle darker than that.
Do any of you Raspberry Pi experts know if this is possible? I can use Nikon, Canon, Sony or Olympus system cameras.

Re: Photography Projects

Posted: Sun Oct 13, 2013 8:16 pm
by Ecurb
I made one running on arduino but I think the same could be done with PI.

https://docs.google.com/document/d/1v14 ... I3W68/edit

Re: Photography Projects

Posted: Fri Nov 01, 2013 6:47 am
by mexicodirk2
new versionn gphoto2
http://www.gphoto.org/news/
i hope this its working good for the usb problem

Dirk

Re: Photography Projects

Posted: Fri Nov 01, 2013 8:34 am
by texy
Which usb problem? It was fixed in the last version?
Texy

Re: Photography Projects

Posted: Sat Nov 02, 2013 7:03 am
by mexicodirk2
Sorry iam late? :cry:
gphoto2-2.5.2

and i have problems
and i dond now wath i make not corect
i download manual
libusbx-1.0.16.tar.bz2
libgphoto2-2.5.2.tar.bz2
gphoto2-2.5.2.tar.bz2
ok this works
then i use tar for decompresing
works
then go in the directory with the decompresed files and type ./configure
works
then i type make ( in the same directory ) and -->> .... no targets specifed .......
i dond find a make file in the directorys
wath i make wrong?

Dirk

Re: Photography Projects

Posted: Sat Nov 02, 2013 10:26 pm
by mexicodirk2
ok
folowing this
https://github.com/gonzalo/gphoto2-upda ... updater.sh
works
i think the libusbx-1.0.16.tar.bz2 dond go right and the libusbx_1.0.17.orig.tar.bz2 ?
iam a bludy noope in this stuf
i fighting
end of the hitory folling this script from gonzalo it works fine :-)
thanks gonzalo

Re: Photography Projects

Posted: Fri Nov 22, 2013 4:03 am
by Frasier_6
Hey, I hope you got the solution of your problem. I am also very fond of photography. I am also learning from internet only but yeah I know some great photographers in Port Macquarie. They might be helpful in clearing your doubts in your projects.
Port Macquarie Photographer

Re: Photography Projects

Posted: Mon Mar 10, 2014 1:39 pm
by ButterySAM777
Hello everyone.

I've been also having this issue with the PTP error when trying to capture an image from my Raspbian, when I'm trying to shoot with the Desktop environment running.

The first solution I found was here, compiling a C program, to Reset the USB port, and release the photo camera. But recently I found another way to solve it.

There it is a package called gvfs-backends, which comes with a automount volume monitor daemon. It seems to interfere with gphoto2, who is trying to mount or access, a device GVFS mounted before. Here it is where start the conflicts.

Solutions? Remove (or rename as backup file) the following files:
sudo rm /usr/share/dbus-1/services/org.gtk.Private.GPhoto2VolumeMonitor.service

sudo rm /usr/share/gvfs/mounts/gphoto2.mount

sudo rm /usr/share/gvfs/remote-volume-monitors/gphoto2.monitor

sudo rm /usr/lib/gvfs/gvfs-gphoto2-volume-monitor


After remove or rename these files, I'm able to use 'gphoto2 -a' or to use 'gphoto2 --capture-image-and-download' with no problem, just initialized the Rasp Pi.

The only point is that the system doesn't mount your camera as a pendrive, it doesn't appear as a drive. I don't need this so, I'm using the camera with no problem from the Linux Shell, because of my idea is using the camera with a visual program, with buttons and all, not for console.

More information, next link:
http://www.freeklijten.nl/home/2011/06/ ... omment-672

Hope it helped!

Regards!

Re: Photography Projects

Posted: Sun Nov 23, 2014 1:55 pm
by surnj1
ButterySAM777 -- thanks your trick worked for me, i had been pulling my hairs since yesterday.