在树莓派上的node.js exec使用gphoto2制作图片

拍完一张照片后,我的相机卡住了。 我只是试图使用exec命令,因为它似乎是最简单的方法。 我使用了canon eos 400d,覆盆子pi模型B和node.js版本0.10.28。 谢谢你的帮助!

var Camera = function(){ } Camera.prototype = { sys: require('sys'), exec: require('child_process').exec } Camera.prototype.takePicture = function(imageCount, nextImagePosition, callback){ this.exec("gphoto2 --capture-image-and-download --filename '%Y%m%d%H%M%S.jpg' ", function(error, stdout, stderr){ console.log('stdout: ' + stdout); console.log('stderr: ' + stderr); if (error !== null) { console.log('exec error: ' + error); } }); }; 

以防万一有人有同样的问题解决scheme是用下面的脚本更新gphoto2: https : //github.com/gonzalo/gphoto2-updater