Coder Social home page Coder Social logo

Comments (11)

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

As far as I can tell this should work. Is the camera visible with the lsusb command immediately before and after Python fails to detect it?

from python-gphoto2.

Steboss avatar Steboss commented on July 23, 2024

lsubs gives me this output both before and after Python failure:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:07dc Intel Corp.
Bus 001 Device 002: ID 04f2:b446 Chicony Electronics Co., Ltd
Bus 001 Device 006: ID 04b0:0414 Nikon Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Could me a permission error? I mean gphoto2 is trying to read the camera mounted (where?) and it cannot access

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

libgphoto2 (and hence the gphoto2 program and the Python interface) accesses a camera via libusb so it shouldn't be mounted. You could test permissions by using sudo to run your Python script.
Are you able to write a short C program to detect the camera using libgphoto2? If this fails then I think it might be worth asking on the gphoto2 mailing list.

from python-gphoto2.

Steboss avatar Steboss commented on July 23, 2024

Good idea for the sudo python, but nothing changes

I wrote a c code like this one:

#include <stdio.h>
#include <fcntl.h>

#include <gphoto2/gphoto2-camera.h>

int main(int argc, char **argv) {
    Camera      *camera;
    int     ret;
    char        *owner;
    GPContext   *context;
    CameraText  text;

  context = gp_context_new();
    gp_camera_new (&camera);

    ret = gp_camera_init (camera, context);
    if (ret < GP_OK) {
        printf("No camera auto detected.\n");
        gp_camera_free (camera);
        return 0;
    }
}

and the output is "No camera detected" :s but I am not totally sure I have used the correct headers from gphoto2

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

That looks the right sort of thing. I think the only include required is gphoto2/gphoto2.h. You could print out the value of ret to check it's -105.

from python-gphoto2.

Steboss avatar Steboss commented on July 23, 2024

Argh,
I have a "Segmentation fault (core dumped)" error

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

Sorry, I've not tried using libgphoto2 from C. (And I'm not much of a C programmer.) I don't know what else to suggest now.

from python-gphoto2.

Steboss avatar Steboss commented on July 23, 2024

No problems :)
I will find it out
I think I messed up gphoto2 with two different installation
I'll check and uninstall and install
finger cross :)
Thanks for your help!

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

The ldd command should show which version of libgphoto2 the Python modules are using and which version the gphoto2 command is using, if it's dynamically linked.

from python-gphoto2.

Steboss avatar Steboss commented on July 23, 2024

So I have re-installed everything and now I got this error after

gp.check_result(gp.gp_camera_init(camera, context))
(foreach_func [gphoto2-port-info-list.c:237]) Error during assembling of port list: 'Unspecified error' (-1).
(gp_port_serial_close [unix.c:461]) Invalid parameters: 'path' is NULL/FALSE.
(gp_context_error) Could not detect any camera

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on July 23, 2024

The first two error messages are typical of libgphoto2's excessive (in my view) verbosity. I'm not sure if they are really errors as I get them although everything appears to be working OK.
The last is what it says - your camera is not being detected.
(I'm on holiday at present, so I'm not able to give the same level of support as usual.)

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.