rlamarche / camera-toolbox

GNU Lesser General Public License v3.0
75 stars 10 forks source link

Canon Camera Error #2

Open baker12 opened 7 years ago

baker12 commented 7 years ago

error

It detects the right camera but I have a feeling I broke something with gphoto2/libgphoto2 since I get the same error as shown below

image

Will let you know if I get gphoto back working again

Thanks again for your help!

rlamarche commented 7 years ago

Can you run the command "gphoto2 --capture-image --debug" please ? Thanks

baker12 commented 7 years ago

gphoto_output.txt

looking at the output it seems like a permission/udev error with libusb. I can run the commands using sudo but when I run hpis I get

image

rlamarche commented 7 years ago

ok can you run :

gphoto2 --list-all-config and attach the output here please ?

I'm creating the GPCanonCamera class and I'll need theses infos to complete the class.

Thanks

baker12 commented 7 years ago

Here it is!

canon_xt_config.txt

rlamarche commented 7 years ago

Hi, I've just commited some updates to support Canon Camera. But I don't have any idea of how it works. Please update, test and tell me what you get ;)

Beware that I've renamed the target to "camera-toolbox".

baker12 commented 7 years ago

Got it compiled, but my output is:

1 cameras detected Seg Fault

I'm not too familiar with C/C++ debuggers at the moment to see if I can specifically find where the seg fault happens

rlamarche commented 7 years ago

Ok I think that the problem is with the detection of the camera. Please update & try again ;)

baker12 commented 7 years ago

1 cameras detected. Open camera : "Canon Digital Rebel XT (normal mode)" at port "usb:001,009" Error : "Unable to get single config manufacturer: Bad parameters" Error : "Unable to get manufacturer widget : Bad parameters" [9;15]pi@raspberrypi:~ $

rlamarche commented 7 years ago

ok let's try again ;)

baker12 commented 7 years ago

camera-toolbox.txt

Getting closer! Just had a black screen with an arrow with those errors listed in the file. The last 2 lines are from when I hit escape on the pi

rlamarche commented 7 years ago

Ok so it seems to work :+1: Hit Enter from the keypad to activate the liveview (I don't know if your camera support it). Hit Return (normal enter key) to capture a photo See https://github.com/rlamarche/camera-toolbox#keyboard--mouse-control for more controls

You also can control the camera from webservices. The api is documented here in swagger format : https://github.com/rlamarche/camera-toolbox/blob/master/swagger.yaml

rlamarche commented 7 years ago

For example go on url http://[Rpi IP address]:8080/api/v1/status

ecurtin commented 7 years ago

Just an observer here, really excited to see all this Canon compatibility work happening here! Keep up the good work y'all! Looking forward to taking a spin with it in the coming weeks!

baker12 commented 7 years ago

Am I supposed to be seeing images on screen? The camera starts taking pictures (not sure if that's considered live mode) but I see no image on screen

Copy/Paste from Terminal:

pi@raspberrypi:~ $ QT_QPA_EGLFS_FORCE888=1 QT_QPA_EGLFS_PHYSICAL_WIDTH=24A_EGLFS_PHYSICAL_HEIGHT=341 ./camera-toolbox [9;0]1 cameras detected. Open camera : "Canon Digital Rebel XT (normal mode)" at port "usb:001,011" Error : "Unable to get single config manufacturer: Bad parameters" Error : "Unable to get manufacturer widget : Bad parameters" Error : "Unable to get single config cameramodel: Bad parameters" Error : "Unable to get camera model widget : Bad parameters" Start camera thread Start liveview decoder thread QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts. Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig. QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts. Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig. QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts. Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig. QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts. Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig. QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts. Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig. Error : "Unable to get single config autofocusdrive: Bad parameters" Command failed Command failed Stop liveview decoder thread Stop camera thread

rlamarche commented 7 years ago

Does the command gphoto2 --capture-preview working ? It is required to work because the liveview use this command.

You can activate liveview with this command :

curl --request POST http://[Pi IP]:8080/api/v1/liveview/start

Then open a browser and go to this url :

http://[Pi IP]:8080/api/v1/liveview.mjpg

To see liveview in realtime.

Then stop liveview with :

curl --request POST http://[Pi IP]:8080/api/v1/liveview/stop

baker12 commented 7 years ago

I am able to do the command and what not but all I get is a small square on the screen

screenshot at 2016-12-29 16 24 41

rlamarche commented 7 years ago

Ok so maybe the liveview is not starting, I'll double check the code

rlamarche commented 7 years ago

I've added some informations. Please check that you have started the liveview. If you can describe exactly the steps you did ;)

Thanks

baker12 commented 7 years ago

screenshot at 2016-12-30 23 06 23 screenshot at 2016-12-30 23 08 56 So I rebuilt the entire application just in case something wasn't linking right then SCP'ed it over to the Pi Then SSHed into the Pi and ran your app. Opened a second Terminal and SSHed as well so I could run the curl commands. I can start the liveview but the only way I can stop it is by closing out of camera-toolbox. curl stop doesn't even do it

baker12 commented 7 years ago

@ecurtin have you by any chance tried it? I know my Canon is a little outdated (Digital Rebel XT) not sure how much newer yours is or not to see if it's just a compatibility issue with mine. I know the gphoto docs says it should, but you never know.

rlamarche commented 7 years ago

@baker12 in your last test, it seems that an image is sent to the browser but not in the expected format.

Please re-test and go on the url : http://..../api/v1/preview.jpg

This will download the image and send it to me. I'll inspect it. Thanks

baker12 commented 7 years ago

Still getting the same error. I even went and did a find command for "preview.jpg" while it was running so I have no idea where in the local directory it is stored to get you a pic

rlamarche commented 7 years ago

Which error are you talking about ? To get the preview, launch the following command :

curl http://..../api/v1/preview.jpg > preview.jpg

baker12 commented 7 years ago

Sorry. Didn't realize fully what you meant.

Here is the Console output: image

however it looks like it's not saving properly. I get a thumbnail of what it's supposed to be on the pi, but that's it. preview

rlamarche commented 7 years ago

Ok I downloaded the preview.jpgand it seems that it is incomplete. But the starting of the file is a jpeg :

file preview.jpg 
preview.jpg: JPEG image data, Exif standard: [TIFF image data, little-endian, direntries=9, manufacturer=Canon, model=Canon EOS DIGITAL REBEL XT, orientation=upper-left, xresolution=160, yresolution=168, resolutionunit=2, datetime=2017:01:05 19:53:38]

Resolution : 160x168 ... strange.

rlamarche commented 7 years ago

It seems that there is only exif data

rlamarche commented 7 years ago

I added code to handle possible error while getting file data & size. But I don't expect that there is an error because you get a preview ... incomplete.

When you run the command :

gphoto2 --capture-preview

What are you getting ? a file ? can you send it to me please ? I want to know if the bug if from libgphoto2 or my tool. Thanks.

baker12 commented 7 years ago

capture_preview

rlamarche commented 7 years ago

Thanks !

This file is only 12k and also has EXIF data without jpeg data. I think that you should open an issue on libghoto2 project. They are very reactive.

baker12 commented 7 years ago

Just opened up a case on the libgphoto2 page. Will let you know as soon as I hear something!

baker12 commented 7 years ago

And 2 months later still no update from them. :/