最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

Gphoto2节点###在IO库发生错误(“无法权利要求USB设备”)

IT培训 admin 2浏览 0评论

Gphoto2节点###在IO库发生错误(“无法权利要求USB设备”)

我树莓派3和单反相机(佳能1300 d)之间的连接工作。当我运行命令捕获图像,第一次是工作,当我再次运行我有以下问题:

An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Device or resource busy). Make sure no other program (gvfs-gphoto2-volume-monitor) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.

请给我一个解决方案“如何树莓派3使用DSLR沟通的NodeJS?”

代码示例:

app.post('/onDemand', function(req, res) {
  GPhoto.list(function (list) {
  console.log('List:', list);
  if (list.length === 0) return;
  var camera = list[0];
  camera.takePicture({download: true,keep: true}, function (er, data) {
    fs.writeFileSync(__dirname + '/input/picture1.jpg', data);
    var filePath = "./input/picture1.jpg";
    var params = {
      Bucket: 'marzs',
      Body : fs.createReadStream(filePath),
      Key : "marzs/"+Date.now()+"_"+path.basename(filePath)
    };

    s3.putObject(params, function (err, data) {
      if (err) {
          console.log('ERROR MSG: ', err);
          res.status(500).send(err);
      } else {
          console.log('Successfully uploaded data');
          res.status(200).send({ imageURL: data.Location });
      }
      res.status(200).send({ imageURL: data.Location });
  });
  });
});

});

提前致谢。

约杰什Waghmare

回答如下:

我们需要在服务器和运行以下命令安装libusb的。

gphoto2 --get-config=capturetarget
gphoto2 --set-config=capturetarget=1
gphoto2 --set-config shutterspeed=bulb
gphoto2 --wait-event=2s --set-config eosremoterelease=Immediate --wait-event=5s --set-config eosremoterelease=Off --wait-event-and-download=5s

之后,我们需要退出进程“process.exit();”过程完成后。并通过永远命令运行

现在的代码运行正常。

感谢和问候,约杰什Waghmare

Gphoto2节点###在IO库发生错误(“无法权利要求USB设备”)

我树莓派3和单反相机(佳能1300 d)之间的连接工作。当我运行命令捕获图像,第一次是工作,当我再次运行我有以下问题:

An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Device or resource busy). Make sure no other program (gvfs-gphoto2-volume-monitor) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.

请给我一个解决方案“如何树莓派3使用DSLR沟通的NodeJS?”

代码示例:

app.post('/onDemand', function(req, res) {
  GPhoto.list(function (list) {
  console.log('List:', list);
  if (list.length === 0) return;
  var camera = list[0];
  camera.takePicture({download: true,keep: true}, function (er, data) {
    fs.writeFileSync(__dirname + '/input/picture1.jpg', data);
    var filePath = "./input/picture1.jpg";
    var params = {
      Bucket: 'marzs',
      Body : fs.createReadStream(filePath),
      Key : "marzs/"+Date.now()+"_"+path.basename(filePath)
    };

    s3.putObject(params, function (err, data) {
      if (err) {
          console.log('ERROR MSG: ', err);
          res.status(500).send(err);
      } else {
          console.log('Successfully uploaded data');
          res.status(200).send({ imageURL: data.Location });
      }
      res.status(200).send({ imageURL: data.Location });
  });
  });
});

});

提前致谢。

约杰什Waghmare

回答如下:

我们需要在服务器和运行以下命令安装libusb的。

gphoto2 --get-config=capturetarget
gphoto2 --set-config=capturetarget=1
gphoto2 --set-config shutterspeed=bulb
gphoto2 --wait-event=2s --set-config eosremoterelease=Immediate --wait-event=5s --set-config eosremoterelease=Off --wait-event-and-download=5s

之后,我们需要退出进程“process.exit();”过程完成后。并通过永远命令运行

现在的代码运行正常。

感谢和问候,约杰什Waghmare

发布评论

评论列表 (0)

  1. 暂无评论