Using USB API (MTP) with libghoto2 and Python bindings on MacOS, Raspberry Pi, Linux, ROS

  1. @jcasman and I are translating the documentation to help us practice using github fork and pull requests
  2. we’re using pydoc to convert the Python docstrings into html for pytheta.py. I’m still thinking of how to have both the Japanese and English in the same document.
  3. I’ve installed Ubuntu 16.04 on a separate SSD and have replicated your environment. I am still getting errors. I will test this more
  4. I am using pip and pipenv to create a Pipfile of the specific Python version and module used
  5. I installed the same version of gphoto2 as you did by compiling from source

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


current error

$ python main.py 
[debug] check_if_theta 処理開始
[debug] [0]:[usb:003,009] [USB PTP Class Camera]
[debug] ['  iProduct                2 RICOH THETA Z1\n']
[debug]シータです
[debug] check_if_thetaは正常終了
[/run/user/1000/gvfs/gphoto2:host=%5Busb%3A003%2C009%5D]はアンマウント済みです
[usb:003,009]
Exception in thread usb:003,009:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/craig/Documents/Development/multi_view_image_modified/scripts/pytheta.py", line 274, in inner_start_capture
    camera.set_config(camera_config) # EN: Change to appropriate value. JP:値を適応
GPhoto2Error: [-1] Unspecified error

[95]
['2822']

[95]
['2822']

Exception in thread usb:003,009:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/craig/Documents/Development/multi_view_image_modified/scripts/pytheta.py", line 322, in inner_finish_capture
    camera.set_config(camera_config) # JP: 値を適応  EN: Set value
GPhoto2Error: [-1] Unspecified error

I’m going to test the module functions individually next.

1 Like