0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【gPhoto2】WSL2(Ubuntu)でデジタルカメラを操作

Last updated at Posted at 2025-03-15

必要なソフトウェア・環境

  • Windows11(24H2)
  • Ubuntu(WSL2:WSL バージョン: 2.0.14.0、カーネル バージョン: 5.15.133.1-1)
  • usbipd(usbipd-win 4.4.1)
  • gphoto2(gphoto2 2.5.27)

gphoto2のインストールは下記をターミナルへ入力

bash
sudo apt install gphoto2

//エラーが出たとき
sudo apt-get update

USBデバイスをWSL2で認識するように設定する。
下記の場合は、<busid>6-3に置き換える。

powershell
> usbipd list

Connected:
BUSID  VID:PID    DEVICE                                                        STATE
2-6    0a12:0001  Generic Bluetooth Radio                                       Not shared
6-1    046d:c52b  Logitech USB Input Device, USB 入力デバイス                   Not shared
6-3    04a9:32e2  Canon EOS RP                                                  Shared (forced)

> usbipd attach --wsl --busid <busid>

カメラの設定

MENU →(セットアップ)→[USB接続]→ PCリモート

インストールの確認(バージョン確認)

bash
> gphoto2 --version

gphoto2 2.5.27

Copyright (c) 2000-2021 Marcus Meissner and others

gphoto2 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of gphoto2 under the terms of the GNU General Public
License. For more information about these matters, see the files named COPYING.

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.27         gcc, popt(m), exif, cdk, aa, jpeg, readline
libgphoto2      2.5.27         standard camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, ltdl, EXIF, USB, serial without locking

接続の確認

bash
> lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 04a9:32e2 Canon, Inc. Canon Digital Camera
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

となり、

bash
> gphoto2 --summary

Camera summary:
Manufacturer: Canon.Inc
Model: Canon EOS RP
  Version: 3-1.6.0
  (続く)

となれば接続完了!

撮影

bash
gphoto2 --capture-image

参考文献

gphoto2対応カメラ一覧

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?