We have moved to a new Sailfish OS Forum. Please start new discussions there.
14

[Wiki] Use your digital camera with Jolla: Porting gphoto2

asked 2015-03-10 16:21:43 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2015-03-10 20:20:48 +0300

MikErk gravatar image

Hello everyone,

I have an old Canon 20D which still works fine. I do tethered shooting via gphoto2 in Debian. This library allows the pc to communicate with the camera over USB in Linux. So I can shoot directly into the PC, see the picture on a larger screen and even do some fancy stuff like time-lapse series or set settings via pc.

I really would love to have this on Jolla. I could then make an attachment at the flash shoe and have the Jolla connected to it. I would have a large screen and even better I could send my pictures via LTE/Wifi directly to my home server. In the end a native Jolla frontend could be developed.

Therefore I am planning to port gphoto2 to Jolla, but as I am really not a linux-expert, I could need some help. I propose to open a wiki here to get everyone to collaborate:

First Step: Compiling and installing the necessary dependencies

Dependencies:

http://www.gphoto.org/doc/manual/compilation.html

Highly required libs: pkgconfig libusb-dev libexif-dev libjpeg-dev libpopt-dev libltdl-dev

Libs succesfully installed by now:

pkgconfig (MikErk): pkcon install pkgconfig //I know that was simple, the other ones aren't listed in pkcon

libusb-dev (MikErk): see first answer //seemed to have worked but I haven't tested it yet

libexif-dev (MikErk): see second answer //seemed to have worked but I haven't tested it yet

Second Step: Try to compile and install libgphoto2 and gphoto2

I hope you are as excited as I am! Cheers Mika

edit retag flag offensive close delete

Comments

Interesting idea , All the best .. Happy compiling ;)

pavi ( 2015-03-10 16:23:19 +0300 )edit

Awesome idea. I'm not a typical user for this but I think this idea needs support.

PatsJolla ( 2015-03-10 16:25:00 +0300 )edit

You should be able to use pre-made srpms (with perhaps some slight modifications) from Fedora (or any other RPM using distro). They most likely have all dependencies and gphoto already done.

onion ( 2015-03-12 15:54:31 +0300 )edit

3 Answers

Sort by » oldest newest most voted
3

answered 2015-03-11 12:40:33 +0300

zuh gravatar image

Unless the situation has changed, it is not possible to have the Jolla phone in USB host mode.

This means that even if you do compile gphoto2 for SailfishOS and happen to find or craft a suitable cable, connecting the phone and camera will not work as intended.

It will be the same as if two people would go sit on the back seat of the car when the intention was to go for a cruise; nobody's driving so nothing happens.

edit flag offensive delete publish link more

Comments

hmm that is indeed a tough one, from this discussion (https://together.jolla.com/question/50/why-its-not-possible-to-use-usb-otg/) at least there is some hope but for now, you are right... :(

Maybe using the wifi-PTP/IP connection for newer Canon Cameras could work but I don't own one with wifi so...

MikErk ( 2015-03-11 12:59:22 +0300 )edit

The tablet though seems to have usb-otg, so there one could have a chance.

MikErk ( 2015-03-11 13:13:17 +0300 )edit
1

If you're going for the wifi connection, you may look at (and maybe use) the code for the eye-fi. (is a sd card with wifi to send pictures to a computer or a mobile phone in real time)

EDIT: eye-fi thread on TJC

c.la ( 2015-03-11 15:07:58 +0300 )edit

Thx c.la for the idea with the eye-fi, it is a good compromise for the beginning but yet it suffers in functionality. With eye-fi you only transfer the images, with gphoto2 you remote control basically the camera

MikErk ( 2015-03-11 19:35:07 +0300 )edit
2

answered 2015-03-10 19:13:28 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2015-03-10 19:38:45 +0300

MikErk gravatar image

For libusb: Got the source from http://sourceforge.net/projects/libusb/files/

send it via ssh to Jolla and started ./configure:

    [nemo@Jolla libusb-1.0.19]$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

Ok, so I installed gcc:

pkcon install gcc gcc-c++

Aha, compilers are found and everythink works fine till:

configure: error: "udev support requested but libudev not installed"

Hmm, anyone has an idea what now?

Update: let's try to disable udev

./configure --disable-udev

and the ./configure-command runs through without errors!

Update: now let's make it

pkcon install make //first we have to install make

[nemo@Jolla libusb-1.0.19]$ make
make  all-recursive
make[1]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19'
Making all in libusb
make[2]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/libusb'
  CC       libusb_1_0_la-core.lo
  CC       libusb_1_0_la-descriptor.lo
  CC       libusb_1_0_la-io.lo
  CC       libusb_1_0_la-strerror.lo
  CC       libusb_1_0_la-sync.lo
  CC       libusb_1_0_la-hotplug.lo
  CC       os/libusb_1_0_la-threads_posix.lo
  CC       os/libusb_1_0_la-linux_usbfs.lo
  CC       os/libusb_1_0_la-poll_posix.lo
  CC       os/libusb_1_0_la-linux_netlink.lo
  CCLD     libusb-1.0.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/libusb'
Making all in doc
make[2]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/doc'
make[2]: Für das Ziel »all« ist nichts zu tun.
make[2]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/doc'
make[2]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19'
make[2]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19'
make[1]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19'

and it seems to have worked! No try to make install under devel-su

[nemo@Jolla libusb-1.0.19]$ devel-su
Password: 
[root@Jolla libusb-1.0.19]# make install
Making install in libusb
make[1]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/libusb'
make[2]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/libusb'
 /bin/mkdir -p '/usr/local/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libusb-1.0.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libusb-1.0.so.0.1.0 /usr/local/lib/libusb-1.0.so.0.1.0
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.1.0 libusb-1.0.so.0 || { rm -f libusb-1.0.so.0 && ln -s libusb-1.0.so.0.1.0 libusb-1.0.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.1.0 libusb-1.0.so || { rm -f libusb-1.0.so && ln -s libusb-1.0.so.0.1.0 libusb-1.0.so; }; })
libtool: install: /usr/bin/install -c .libs/libusb-1.0.lai /usr/local/lib/libusb-1.0.la
libtool: install: /usr/bin/install -c .libs/libusb-1.0.a /usr/local/lib/libusb-1.0.a
libtool: install: chmod 644 /usr/local/lib/libusb-1.0.a
libtool: install: ranlib /usr/local/lib/libusb-1.0.a
libtool: finish: PATH="/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/nemo/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/include/libusb-1.0'
 /usr/bin/install -c -m 644 libusb.h '/usr/local/include/libusb-1.0'
make[2]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/libusb'
make[1]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/libusb'
Making install in doc
make[1]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/doc'
make[2]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/doc'
make[2]: Für das Ziel »install-exec-am« ist nichts zu tun.
make[2]: Für das Ziel »install-data-am« ist nichts zu tun.
make[2]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/doc'
make[1]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19/doc'
make[1]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19'
make[2]: Entering directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19'
make[2]: Für das Ziel »install-exec-am« ist nichts zu tun.
 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19'
make[1]: Leaving directory `/home/nemo/PortGphoto2Sailfish/PortingGphoto2Sailfish/libusb-1.0.19'
edit flag offensive delete publish link more

Comments

Could someone with better sailfish knowledge than me comment, if everythings is okay with this compilation?

MikErk ( 2015-03-10 19:46:47 +0300 )edit
2

answered 2015-03-10 20:16:00 +0300

MikErk gravatar image

For libexif-dev this works as for the libusb:

Get source from: http://sourceforge.net/projects/libexif/files/?source=navbar

Then go to directory and enter:

./configure
make
devel-su
make install

It shows basically the same output as libusb

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2015-03-10 16:21:43 +0300

Seen: 819 times

Last updated: Mar 11 '15