Comments (4)
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.
I did some research on my own and I see that re-connection isn't implemented :-/
Thanks for support! :-)
Kindly,
Artur.
from node-gphoto2.
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.
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)
- Build issue with macports HOT 2
- No preview / no download
- Segmentation fault: 11 HOT 12
- Capture Movie with additional parameters possible? HOT 1
- node-gphoto2 internal error
- Error on importing the module HOT 1
- Raspberry pi 3 b+
- GPhoto2 and Socket.IO incompatible HOT 2
- Pre-install should not install libgphoto2 on Mac OS HOT 2
- Capture movie with lib ? HOT 1
- windows support HOT 4
- Build error on node 12 HOT 3
- error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’ HOT 4
- Event listeners
- After using "takePicture" the camera is stuck. HOT 2
- Nan::ObjectWrap::Unref(): Assertion `!persistent().IsWeak()' failed. HOT 3
- change binding.gyp for mac for build the package HOT 1
- mach-o file have 'x86_64', need 'arm64e' HOT 1
- please make a release HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-gphoto2.