GithubHelp home page GithubHelp logo

Comments (4)

philip100 avatar philip100 commented on August 17, 2024

I repeat the question - Is it possible to re-check camera connection?

I've tried destroying and creating new gphoto2 object each time, but it causes "segmentation fault" error.

F.ex:

var gphoto2 = require('gphoto2');
var camera = null;
var GPhoto = null;

function checkCam(){
    GPhoto = new gphoto2.GPhoto2();
    GPhoto.list(function (list) {
        if (list.length){
            camera = list[0];
            console.log('Found', camera.model);
        }
    });
}

checkCam();

function shoot(){
    if(camera){
        camera.takePicture({download: false}, function (er, path) {
            if(err}{
                GPhoto = null;
                camera = null;
            }
        });
    }else{
        console.log('No camera detected');
        checkCam();
    }
}

I can't imagine that I have to restart the whole app when camera goes sleep :-)
I mean, don't get me wrong - I admire your work and your time spent on this project, but what I'm asking is just basic functionality...

kindly,
Artur.

from node-gphoto2.

philip100 avatar philip100 commented on August 17, 2024

I did some research on my own and I see that re-connection isn't implemented :-/
Thanks for support! :-)

Kindly,
Artur.

from node-gphoto2.

apsylone avatar apsylone commented on August 17, 2024

You should probably turn off the "autopoweroff" settings of you camera by settings it's value to "0".
That's what i've done :-)

Hope it'll help you !

from node-gphoto2.

lwille avatar lwille commented on August 17, 2024

I'm sorry this is something the gphoto APIs don't support (and even the cameras may not be able to do it); I remember asking the original author about it long time ago - as always, feel free to get involved there.

The quickest solution I came up with 8 years ago was a usb-controlled switch and power cycle the camera (see #13)

I investigated disabling and re-enabling the entire USB port, but this is quite low-level and platform specific and gave more troubles than it actually helped to solve.

from node-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.