Request: gphoto2 / entangle PND


antisol

Member
Joined
Feb 9, 2014
Messages
74
Hi,

I'm hoping to use gphoto2 on my pandora to be able to tether my DSLR camera (Nikon D3200).

I've been screwing around trying to get gphoto2 working properly on my pandora all day. I feel like somebody with more knowledge of compiling would be able to do it fairly easily and save me a whole lot of time and effort.

I have installed gphoto2 on the pandora via opkg but this is version 2.4.8. Unfortunately there's a bug in this version which stops me from being able to change the shutter speed on my camera. On my laptop I have version 2.5.3 and it works flawlessly.
I'm hoping somebody might be able to compile it (version >= 2.5.3) for me and ideally put it into a PND.

For bonus points, I'd also really like to have entangle (http://entangle-photo.org) on my pandora. It's a nice GUI frontend for gphoto2.

I tried using the code:blocks dev command line to compile it myself, but there were a couple of problems with that. It seemed to compile fine but I keep getting segmentation faults when I try to use the newer version I compiled. The first time I use it it works fine, but anything I try to do after that gives me a segmentation fault. Also I'm not able to use it outside of the dev command line interface, it gives me a message saying "bus error". Unfortunately my knowledge of compiling/linking/etc is pretty limited - I know the basic configure/make/make install but not much more than that.

I tried to compile entangle too but when I run configure I get a message telling me that it can't find the GTK libs.

Alternatively if somebody could point me to an ipk of version >= 2.5.3 that would do the trick. I've done a few searches but I haven't been able to find one.

If somebody could help me out I'd really appreciate it! :)
 
Thanks, but that seems a bit extreme. I have a bunch of stuff set up on my pandora the way I like it. Installing and configuring a new OS would probably be more effort than figuring out the compiling problems. But thanks for the suggestion, I'll keep it in mind.
 
It's just a matter of untarring a file on a new SD card, so not that much of an effort ;^) .
 
There's a lot more to it than that if I'm going to use it as my daily-driver-OS. I don't think I've ever spent less than a day tweaking and installing stuff when I've installed a new OS.

I did try out pandian very early on and found it was missing a whole bunch of pandora-specific stuff (for example there was no interface for turning wifi/usb/etc on/off, closing the lid didn't turn off the screen). That experience kinda turned me off using alternate OS's. Maybe things have improved in the last couple of years?

It might be a solution but it sounds tedious to me: either I have to configure a whole new OS to my liking, or I have to swap SD cards and reboot the pandora every time I want to use it with my camera. Not ideal.

Plus, I'd have to get another SD card (i don't have a spare one at the moment), which would mean going outside in daylight hours ;)

I searched the site you linked to for gphoto2 and I don't see any version >=2.5.3:
https://slackbuilds.org/result/?search=gphoto&sv=
Entangle is the "nice-to-have" one - the one I really need is gphoto2. Is it perhaps included but not listed on that site?

I really do appreciate the suggestion and maybe I'll give it a shot as a last resort, but I think I'll wait and see if somebody can help me get it running on the default pandora OS first.
 
You can chroot into the SL4P filesystem from Zaxxon, therefore you can avoid having to reboot.
Gphoto2 is already shipped in the Slackware distribution.
You can take the entangle SlackBuild script and adapt it to build the new version.
 
That could be a workable option.

A whole OS and SD card for maybe a few mb of program seems excessive though.

I'll take a look at the sl4p wiki page.
 
OK so I'm playing around with sl4p but I can't seem to figure out how to chroot into it. Can you point me to some instructions for that?

Also I'd love to be able to reduce the size of slackware. is there a way that I can figure out what is essential and what is safe to remove to turn it into a really minimal install, preferably only a few hundred MB? I'm thinking I could create an image file on my regular SD card with a minimal slackware install, mount that, and then chroot into it - more convenient than switching cards.

Sorry if these are dumb questions but I'm really not very familiar with slackware of with chrooting :)
 
See where the card is mounted with the "cat /proc/mounts" command.
Then "sudo su -", and finally "chroot path_of_the_mountpoint"

Look at threads like this one https://superuser.com/questions/165116/mount-dev-proc-sys-in-a-chroot-environment
to see how to bind useful directories and use them in the chroot.

Look for the SlackwareARM-14.2 minirootfs for a minimal install:
ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-devtools/minirootfs/roots/
 
Thanks for the tips. But I can't seem to figure out how to install stuff in the minimal image. I found the slackware package repo but it only seems to have i586, not arm...
 
For official SlackwareARM packages, select a mirror in /etc/slackpkg/mirrors then use slackpkg.
For other programs, install and use sbopkg.
 
I'd also really like to have entangle (http://entangle-photo.org) on my pandora. It's a nice GUI frontend for gphoto2.
Sorry but Entangle is a GTK3 program and on Pandora don't have it (only programs with GTK2 will be buildable).

Anyway, like you said the last version on gphoto2 just build fine on Codeblocks pnd. So i build the last revision (2.5.15) using the last revision of libgphoto2 (2.5.16) and just running it didn't segfault.
I can't do any other test now because don't find my Canon SX 220HS camera...so here is a zip package with my compiled version with the libs needed to run without Codeblocks pnd.

Please test it.
Unzip on a folder and open a terminal on this folder and run ./gphoto2.sh
You can change the line that run the program selecting one of the options available (exec ./gphoto2 --list-ports).

Hope it works
 

Attachments

  • gphoto2.zip
    1.8 MB · Views: 470
Hi Farox,

Thanks for your reply. I've been talking to ptitseb and he's been working on it. It looks like we're close to having both entangle and gphoto2 on the pandora! I guess GTK3 isn't enough to stop someone like ptitseb! Obviously I can't make any promises though, he's still working on it.

I tried the version you compiled but it doesn't want to communicate with my camera at all. It runs and it doesn't segfault, but it's not usable unfortunately.

I really appreciate you taking the time/effort to give this a try for me but I suspect that it's probably not worth you spending any more time on it just yet, since ptitseb is working on it. But if you're the obsessive type and you want to figure it out, here's some info on what happens when I try to run your version:

Code:
$ ./gphoto2.sh
Devices found: -2
Path                             Description
--------------------------------------------------------------

This should show my camera (the --list-ports option), like this:

Code:
$ gphoto2 --list-ports
Devices found: 4
Path                             Description
--------------------------------------------------------------
disk:/media/card1                 Media 'card1'                   
disk:/media/card2                   Media 'card2'                     
ptpip:                           PTP/IP Connection               
usb:                             Universal Serial Bus

When I change the parameters to actually take a photo or communicate with my camera I get an error saying "*** Error (-2: 'Bad parameters') ***". I tried both taking a picture and changing settings and I get the same error.

I added --debug to the output and here's what I got trying to take a picture:
Code:
$ ./gphoto2.sh
0.000153 main                        (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.001160 main                        (2): gphoto2 2.5.15
0.001617 main                        (2): gphoto2 has been compiled with the following options:
0.002014 main                        (2):  + gcc (C compiler used)
0.002258 main                        (2):  + popt (mandatory, for handling command-line parameters)
0.002441 main                        (2):  + exif (for displaying EXIF information)
0.002655 main                        (2):  + no cdk (for accessing configuration options)
0.002838 main                        (2):  + aa (for displaying live previews)
0.003021 main                        (2):  + jpeg (for displaying live previews in JPEG format)
0.003204 main                        (2):  + readline (for easy navigation in the shell)
0.003418 main                        (2): libgphoto2 2.5.16
0.003632 main                        (2): libgphoto2 has been compiled with the following options:
0.003845 main                        (2):  + all camlibs
0.004028 main                        (2):  + gcc (C compiler used)
0.004211 main                        (2):  + ltdl (for portable loading of camlibs)
0.004395 main                        (2):  + EXIF (for special handling of EXIF files)
0.004608 main                        (2): libgphoto2_port 0.12.0
0.004822 main                        (2): libgphoto2_port has been compiled with the following options:
0.005035 main                        (2):  + iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi
0.005218 main                        (2):  + gcc (C compiler used)
0.005737 main                        (2):  + ltdl (for portable loading of iolibs)
0.005981 main                        (2):  + USB (libusb1, for USB cameras)
0.006195 main                        (2):  + serial (for serial cameras)
0.006683 main                        (2):  + no resmgr (serial port access and locking)
0.006927 main                        (2):  + no ttylock (serial port locking)
0.007050 main                        (2):  + no lockdev (serial port locking)
0.007263 main                        (2): CAMLIBS env var not set, using compile-time default instead
0.007294 main                        (2): IOLIBS env var not set, using compile-time default instead
0.007385 main                        (2): invoked with following arguments:
0.007538 main                        (2):   --debug
0.007568 main                        (2):   --capture-image-and-download
0.008026 load_settings               (2): Creating gphoto config directory ('./.gphoto')
0.008545 verify_settings             (2): Can't open settings file './.gphoto/settings' for reading.
0.008881 load_settings               (2): Loading settings from file './.gphoto/settings'.
0.009033 load_settings               (2): Can't open settings file './.gphoto/settings' for reading.
0.009186 load_settings               (2): Creating gphoto config directory ('./.gphoto')
0.009308 verify_settings             (2): Can't open settings file './.gphoto/settings' for reading.
0.009460 load_settings               (2): Loading settings from file './.gphoto/settings'.
0.009521 load_settings               (2): Can't open settings file './.gphoto/settings' for reading.
0.009674 main                        (2): The user has not specified both a model and a port. Try to figure them out.
0.009979 gp_port_info_list_load      (2): Using ltdl to load io-drivers from '/mnt/utmp/codeblocks/usr/lib/libgphoto2_port/0.12.0'...
0.010590 gp_port_info_list_load [gphoto2-port-info-list.c:288](0): No iolibs found in '/mnt/utmp/codeblocks/usr/lib/libgphoto2_port/0.12.0'
0.010986 gp_abilities_list_load_dir  (2): Using ltdl to load camera libraries from '/mnt/utmp/codeblocks/usr/lib/libgphoto2/2.5.16'...
0.011566 gp_abilities_list_load_dir  (2): Found 0 camera drivers.
0.015655 gp_abilities_list_detect [gphoto2-abilities-list.c:408](0): Invalid parameters: 'list && info_list && l' is NULL/FALSE.
*** Error (-2: 'Bad parameters') ***       

0.016418 gp_camera_free              (2): Freeing camera...
0.016846 gp_port_free                (2): Freeing port...
0.017151 gp_filesystem_reset         (2): resetting filesystem
0.017425 gp_filesystem_lru_clear     (2): Clearing fscache LRU list...
0.017609 gp_filesystem_lru_clear     (2): fscache LRU list already empty
0.017670 delete_all_folders          (2): Internally deleting all folders from '/'...
0.017792 lookup_folder               (2): Lookup folder '/'...
0.017853 lookup_folder               (2): Found! / is 0x28320
0.018127 recurse_delete_folder       (2): Recurse delete folder 0x28320//
 
I've been talking to ptitseb and he's been working on it.
Ah good. Probably in a few days we have both programs adapted for Pandora (i'm still doubius on GTK3...but when ptitSeb is involved...)

No iolibs found in '/mnt/utmp/codeblocks/usr/lib/libgphoto2_port/0.12.0' 0.010986 gp_abilities_list_load_dir (2): Using ltdl to load camera libraries from '/mnt/utmp/codeblocks/usr/lib/libgphoto2/2.5.16'... 0.011566 gp_abilities_list_load_dir (2): Found 0 camera drivers.
Probably the program needs some more libs to work...
 
For anybody who searches the forums for gphoto2 in future, ptitseb compiled a PND for me with gphoto2 and a bunch of libraries, and then I wrote a pygtk tethering program called CameraLeash designed for the pandora (we couldn't get entangle working).

link: http://repo.openpandora.org/?page=detail&app=cameraleash

Huge thanks to ptitseb for doing the foundational work!
 
Sounds nice, but why is that so huge?
Darktable with all that features is a fragment of that and it includes the same libs.
 
We were initially trying to get entangle working but we weren't able to manage it, and then we never cleaned out all the unused stuff libraries (gtk3 was the big one). ptitseb compiled all that for me and I don't have the knowledge to know what is safe to get rid of. I'd welcome tips for things that can be safely removed :)

On the upside, the gphoto2 command line also has a partially-functional version of entangle available. It won't show you previews or camera roll stuff but it will take photos. Personally I much prefer CameraLeash (which is written for the pandora, so it works better with the small screen) but it's nice to have the option I guess.
[doublepost=1562462332,1562459511][/doublepost]Another point to make is that you only need to download the big PND once because CameraLeash has a differential auto-updater which will check for new versions and only download the changed files - updating to a new version will be a few KB on average, you won't need to download the 80MB PND again :)
 
*cough*
Thats 12 hours on my line, and a differntial updater wont work either as i cant go online with the pandora.
But hey, interessting concept there.

My pandora is equited with a light sensor so it eagers me to have the camera trigger exactly when light appears, might be cool for explosions, sparks or something like that.

At one point i was about to takle such camera control programm myself, but then i somehow ended up switching to film leaving my digital nikon to rot in the shelf.
 
Damn, that's a slow line! Why is is so slow? are you somewhere really remote?

There's a tarball of just the python files on the website (https://antisol.org/cameraleash/). You could spend the 12 hours (or perhaps make a trip to a library or something?) and download the PND once, then when there's a new version you want to update to you could just extract the tarball into the appropriate appdata directory (which is how the auto-updater works, it takes advantage of the unionfs to replace readonly files in the PND). A few hundred KB to update, no internet connection needed on the pandora. I'd be happy to help if you have trouble with that.

Another option would be if you have something like pandian you could just download the tarball and install only the required libraries in pandian (there's a readme with a list, but from memory you'll need python-gphoto2, numpy, PIL, and pygtk).

if you can give me more info about your light sensor I'd be more than happy to look into adding support for it, that sounds like a really cool thing to have and a very useful function. Or if you want to hack on my code I'll be happy to look at patches to add support :)
 
My light sensor is just a diode soldered to the spare shoulder button pads. I drilled a hole in the right shoulder trigger that can be opened to varying degree till it outputs "-".
Anything that detects a button works with that too.
 
Back
Top