Coder Social home page Coder Social logo

Comments (9)

jim-easterbrook avatar jim-easterbrook commented on June 24, 2024

I just tried it on my Pi and got the same result. It's got an earlier version of SWIG (2.0.7) than I've been using on my main machine (2.0.10). The problem is in the typemaps for gp_port_info_new(), which I don't think would ever be called from Python, so doesn't really need wrapping. (But who knows what someone might want to do...)
I'll commit a bug fix now.

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 24, 2024

PS I haven't tested any image capture stuff - you may find things you need are missing or "not properly joined up". Do let me know of any problems you run into.

from python-gphoto2.

fsoustra avatar fsoustra commented on June 24, 2024

Thanks Jim.
Will do.

from python-gphoto2.

tomriddle1234 avatar tomriddle1234 commented on June 24, 2024

Thanks Jim, I got the same issue but on ubuntu 12.04 with default swig 2.04 installation.

from python-gphoto2.

fsoustra avatar fsoustra commented on June 24, 2024

Got this issue arising now:

*gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/lib/gphoto2_camera_wrap.c -o build/temp.linux-armv6l-2.7/source/lib/gphoto2_camera_wrap.o -O3 -Wno-unused-variable
source/lib/gphoto2_camera_wrap.c: In function ‘_wrap_gp_camera_get_port_info’:
source/lib/gphoto2_camera_wrap.c:5536:5: error: incompatible type for argument 2 of ‘SWIG_Python_NewPointerObj’
source/lib/gphoto2_camera_wrap.c:2547:1: note: expected ‘void ’ but argument is of type ‘GPPortInfo’
error: command 'gcc' failed with exit status 1

gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
and
SWIG Version 2.0.7
and python 2.7.3

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 24, 2024

Doh! The perils of testing on one machine and committing to GitHub from a different one. I removed the wrong asterisk in commit 9e7f9f2. This is still the same problem. Commit 533eb33 should fix it.

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 24, 2024

Unfortunately, although this change allows it to compile with older SWIG versions, it causes a segfault when gp_camera_set_port_info() is called. Some more work needed.

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 24, 2024

I think I've found the problem. It's nothing to do with SWIG, it's the version of libgphoto2. The API changed in version 2.5 (see http://www.gphoto.org/news/) - my Pi only has version 2.4.14. I'm surprised I managed to build python-gphoto2 at all. You certainly need version 2.5 to run the example programs.
(The difference responsible for this bug is that in 2.5 GPPortInfo is a pointer to a structure, in 2.4 it's the structure itself. Quite a big difference!)

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 24, 2024

Commit 9d1f71e allows building with gphoto2 version 2.4 or 2.5. Some of the examples work with version 2.4 as well (tested with my Canon DSLR connected to a Raspberry Pi).

from python-gphoto2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.