必要なソフトウェア・環境
- 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対応カメラ一覧