This is fantastic. What version of Python and gphoto are you using?
python main.py
[debug] check_if_theta 処理開始
[debug] [0]:[usb:003,009] [USB PTP Class Camera]
can't get debug descriptor: Resource temporarily unavailable
[debug] [b' iProduct 2 RICOH THETA Z1\n']
[debug]シータです
[debug] check_if_thetaは正常終了
[/run/user/1000/gvfs/gphoto2:host=%5Busb%3A003%2C009%5D]はアンマウント済みです
Exception in thread usb:003,009:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/craig/Development/ricoh/usb/multi_view_image/scripts/pytheta.py", line 198, in inner_start_capture
camera.set_config(camera_config)
gphoto2.GPhoto2Error: [-1] Unspecified error
...
*** Error ***
Failed to set new configuration value 0x1018,0xFFFFFFFF for configuration entry /main/actions/opcode.
*** Error (-1: 'Unspecified error') ***
Exception in thread usb:003,009:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/craig/Development/ricoh/usb/multi_view_image/scripts/pytheta.py", line 226, in inner_finish_capture
sp.check_output(cmd, shell=True)
File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'gphoto2 --set-config=/main/actions/opcode=0x1018,0xFFFFFFFF --port=usb:003,009' returned non-zero exit status 1.
Did you find out that you need to unmount gvfs?
def unmount_theta(theta_list):
"""
マウントされているThetaをアンマウントする。
そもそもマウントしないようにすれば良いかもしれないが、
他の機材の使用に師匠が出うる設定が必要なのでこの実装となった。
Parameters
----------
theta_list : list
接続されているThetaのリスト
"""
for addr in theta_list:
path = "/run/user/1000/gvfs/gphoto2:host=%5B"+url.quote(addr)+"%5D"
if os.path.exists(path):
print("[{:s}]をアンマウントします".format(path) )
sp.check_output(["gvfs-mount", "-u", path])
# cmd = "gvfs-mount -u /run/user/1000/gvfs/mtp:host=%5B"+url.quote(addr)+"%5D"
# sp.check_output(cmd,shell=True) #こういう書き方もある。
else:
print("[{:s}]はアンマウント済みです".format(path))
the THETA Z1 is not mounted on my system.
$ gvfs-mount -l
This tool has been deprecated, use 'gio mount' instead.
See 'gio help mount' for more info.
Drive(0): Samsung SSD 860 QVO 1TB
Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
Drive(1): ST2000LM007-1R8174
Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
Volume(0): 2.0 TB Volume
Type: GProxyVolume (GProxyVolumeMonitorUDisks2)