Jenkins
Posts: 6
Joined: Fri Aug 03, 2012 5:12 am

Re: Photography Projects

Sat Aug 18, 2012 9:16 pm

Hello All,

I am also trying to use the raspberry pi to control my DSLR, I have the Nikon D5100. I am also having problems taking the second photo, when using the pi.

I am learning how to write an android app and currently have a very crude app that is able to connect to the pi over ssh and take a photo and am working to create better app.

@climberhunt I really like the use of the camera grip certainly going to look into do that if this project works.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Sun Aug 19, 2012 12:37 pm

Hi,
I did an apt-get install gphoto2, connected up my Nikon D80 switched it on and reset the Pi, but I get

Code: Select all

pi@raspberrypi ~ $  gphoto2 --auto-detect
Model                          Port
----------------------------------------------------------
pi@raspberrypi ~ $
, i.e. the D80 is not recognised. Any idea's?
lsusb shows :

Code: Select all

pi@raspberrypi ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 04b0:0411 Nikon Corp.
Bus 001 Device 005: ID 0425:0101 Motorola Semiconductors HK, Ltd G-Tech Wireless Mouse & Keyboard
pi@raspberrypi ~ $
Do I need a later version of gphoto2 (compiling isn't anything I,ve done before :o )

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

davidmam
Posts: 101
Joined: Tue Dec 06, 2011 4:13 pm

Re: Photography Projects

Sun Aug 19, 2012 12:56 pm

Check the USB mode set on the D80. You also need to ensure the camera is switched on.

..d

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Sun Aug 19, 2012 1:27 pm

Brilliant! Didn't even know there was different usb modes ;)
That sorted it, now to confirm want others have found.

Thanks,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Sun Aug 19, 2012 1:57 pm

The above was a step closer, but can't actually capture an image, I get :

Code: Select all

pi@raspberrypi ~ $ gphoto2 --capture-image

*** Error ***
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
ERROR: Could not capture image.
*** Error (-53: 'Could not claim the USB device') ***
Is this part of the usb-reset issue? I tried the resetusb script above and it states it was successful, but still the above error.

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

davidmam
Posts: 101
Joined: Tue Dec 06, 2011 4:13 pm

Re: Photography Projects

Sun Aug 19, 2012 2:25 pm

WHat happens when you try to auto-detect the camera?

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Sun Aug 19, 2012 2:34 pm

OK, scrub my last message - after a reset of the Pi, I can now gphoto2 --capture-image-and-download, then usbreset, and repeat without issue. Well only one slight issue - with that 'basic' command, it wants to overwrite the same image filename, so asks to continue - I,m guessing there is a way to auto-increment the filename, so that it doesn't ask to overwrite it?

Thanks for the help,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Jenkins
Posts: 6
Joined: Fri Aug 03, 2012 5:12 am

Re: Photography Projects

Sun Aug 19, 2012 2:41 pm

After updating Raspbian today I am no longer having usb reset problems. Is anyone else not having problems any more?

davidmam
Posts: 101
Joined: Tue Dec 06, 2011 4:13 pm

Re: Photography Projects

Sun Aug 19, 2012 2:48 pm

texy wrote:OK, scrub my last message - after a reset of the Pi, I can now gphoto2 --capture-image-and-download, then usbreset, and repeat without issue. Well only one slight issue - with that 'basic' command, it wants to overwrite the same image filename, so asks to continue - I,m guessing there is a way to auto-increment the filename, so that it doesn't ask to overwrite it?
Use the --filename <filename> option with the --capture-and-download

khurtwilliams
Posts: 10
Joined: Tue May 15, 2012 2:18 pm
Location: Skillman, NJ
Contact: Website

Re: Photography Projects

Sun Aug 19, 2012 3:20 pm

texy wrote:The above was a step closer, but can't actually capture an image, I get :

Code: Select all

pi@raspberrypi ~ $ gphoto2 --capture-image

*** Error ***
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
ERROR: Could not capture image.
*** Error (-53: 'Could not claim the USB device') ***

Is this part of the usb-reset issue? I tried the resetusb script above and it states it was successful, but still the above error.

Texy
I suggest reading the documentation and looking at the example on the gphoto2 page. This will help you to understand what combination of commands you'll need.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Sun Aug 19, 2012 3:27 pm

Thankyou ;)
I,ve moved on a little bit from then. I can repeatedly take photo's, but I,m still stuggling with how to download from the camera to the Pi AND give the filename a new title for every shot. This description might as well be in Mongolian :

Code: Select all

--filename FILENAME
When downloading files from the camera, specify the file name or file name pattern to use when storing the downloaded file on the local disk. When uploading a file to the camera, specify the filename to store the uploaded file as on the camera.

The --filename option accepts %a, %A, %b, %B, %d, %H, %k, %I, %l, %j, %m, %M, %S, %y, %%, (see date(1)) and, in addition, %n for the number, %C for the filename suffix, %f for the filename without suffix, %: for the complete filename in lowercase.

Note that %: is still in alpha stage, and the actual character or syntax may still be changed. E.g. it might be possible to use %#f and %#C for lower case versions, and %^f and %^C for upper case versions.

%n is the only conversion specifier to accept a padding character and width: %03n will pad with zeros to width 3 (e.g. print the number 7 as “007”). Leaving out the padding character (e.g. %3n) will use an implementation specific default padding character which may or may not be suitable for use in file names.

Default value for this option can be specified in the ~/.gphoto/settings file as gphoto2=filename=value.
, and the there is no example use of the --filename option. I can give it --filename "test", but I guess it needs to have an additional '%' choice to auto rename the file, otherwise every shot wants the filename to be test.

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Sun Aug 19, 2012 3:28 pm

Oh, and the other thing is that it takes around 20 seconds or so 'initialising' the camera every time I want to take a shot?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

davidmam
Posts: 101
Joined: Tue Dec 06, 2011 4:13 pm

Re: Photography Projects

Sun Aug 19, 2012 3:39 pm

you should be able to set the filename as --filename 'test-%y%m%d-%H%M%S.jpg'

which will give you a timestamp.

Don't know how to skip the initialising - it is a bit of a pain having that lag.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Sun Aug 19, 2012 4:05 pm

Jenkins wrote:After updating Raspbian today I am no longer having usb reset problems. Is anyone else not having problems any more?
Quite the opposite. After rpi-update to the latest firmware, I am now getting :

Code: Select all

*** Error ***
PTP I/O error

*** Error ***
An error occurred in the io-library ('Unspecified error'): No error description available
ERROR: Could not capture image.
*** Error (-1: 'Unspecified error') ***

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <gphoto-devel@lists.sourceforge.net>, please run
gphoto2 as follows:

    env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --capture-image

Please make sure there is sufficient quoting around the arguments.
apt-get update && upgrade doesn't update anything (I had already done this earlier in the day).

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

khurtwilliams
Posts: 10
Joined: Tue May 15, 2012 2:18 pm
Location: Skillman, NJ
Contact: Website

Re: Photography Projects

Sun Aug 19, 2012 10:31 pm

Capture and download image

Code: Select all

gphoto2 --capture-image-and-download --filename "Nikon_D90_%Y%m%d-%H%M%S-%03n.%C"

User avatar
climberhunt
Posts: 5
Joined: Wed Aug 15, 2012 12:32 pm

Re: Photography Projects

Wed Aug 22, 2012 1:37 pm

Nice one, Khurt. I didn't know you could append sequential requests like that. That's probably much quicker than 5 seperate gphoto2 calls. :)
Rgds,
David.

User avatar
BillyBag2
Posts: 32
Joined: Fri Jun 15, 2012 7:11 am
Contact: Website

Re: Photography Projects

Fri Aug 24, 2012 1:50 pm

Thanks for this thread.
I'm trying to do HDR timlapse video with a canon 400D. I had to use the usbreset after every call to gphoto2. I used the bash script from this thread to find the camera and do the reset ustomatically. Also used the "--set-config-index /main/.../exposurecompensation=n" where n=0 gives -2S, n=6 give 0S and n=12 gives +2S (on canon 400D). Been looking at enfuse and also pfstools, as with gphoto2, available using apt-get. Keeping a blog to help me remember what I am doing. see http://pinchips.blogspot.co.uk/2012/08/ ... r-and.html

Thanks again, I will try and keep you posted as I make more progress.
Pi N Chips - pinchips.blogspot.co.uk

funi1234
Posts: 2
Joined: Sat Mar 03, 2012 11:58 pm

Re: Photography Projects

Sun Sep 16, 2012 11:03 pm

Is anyone using a Canon 550D or similar? I'm having trouble figuring out how to do a bulb capture.

Any help would be much appreciated.

getting an error when i try --set-config bulb=1 and the debug file output is

http://pastebin.com/7uLPBN3s

Thank you.

sorry about the link, debug file was over the char limit of the post.

anat
Posts: 19
Joined: Mon Aug 27, 2012 12:45 am

Re: Photography Projects

Wed Sep 26, 2012 12:33 am

Does the Rev2 board and the 2012-09-18 Wheezy resolve the problem of issuing the second command ? I also tried to use the bulb mode for a 500D camera and got the same problem.

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Photography Projects

Fri Sep 28, 2012 6:51 pm

No, rev2 board also needs the reset regularly before it works. Unfortunately.

genalubcap
Posts: 1
Joined: Sun Oct 07, 2012 11:18 pm

Re: Photography Projects

Sun Oct 07, 2012 11:41 pm

I have a Nikon Coolpix 4300. My goal was to use the Pi, running gphoto2, to command the camera to take an image, download it from the camera, crop and title it with Imagemagick and sftp the image to a remote server.
I ran into a lot of roadblocks, I figured I would chronicle them here in case it helps anyone. First problem, the Coolpix 4300 uses something called Sierra mode to communicate over the usb cable. Linux mounts the camera as /dev/sg0. So, I needed to find a distro for the Pi that had the generic scsi kernal module compiled in. The only one I could find is Fedora 17 remix. Then I ran into the reset issue discussed here. I compiled the resetusb code found on this forum. I had to modify the bash script that launches resetusb so that it would find /dev/sg0. Resetting after every command is sent to the camera. Also, I had to program the Pi to reboot after each photo taking/cropping/uploading cycle. It is dependable, reliably taking and processing an image every 15 minutes. But, I still have some gremlins to squash. Every time a shutter release command is sent to the camera, it takes three images rather than just one. Also, deleting old images from the cameras memory card is unreliable. Some cycles it works, others it doesn't.

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Thu Oct 11, 2012 1:04 pm

I have not looked at this for a while. Is there still the problem that it takes 20 seconds initialising before the camera shutter is activated?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Photography Projects

Thu Oct 11, 2012 1:54 pm

No such delay with my D40 at least. Few seconds only.

chaos6
Posts: 12
Joined: Sat Aug 25, 2012 1:42 am
Location: Massachusetts, US

Re: Photography Projects

Fri Oct 12, 2012 1:00 pm

No delay for me. My lag is about 1.7 seconds. I got it down to 0.5 seconds by removing all of the drivers except those of my camera. Most of the 1.7 second delay was all the drivers being loaded (in preparation for auto-detection).

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Photography Projects

Fri Oct 12, 2012 1:28 pm

Drivers ? In the gphoto directory?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Return to “Other projects”