Is Theta S a MTP device?

The place to discuss development topics.
Discussions on the RICOH THETA API and SDK, image processing of spherical images, other hardware related topics, introduction of useful libraries, etc.

Is Theta S a MTP device?

Postby XiaomingYang » 17 Jun 2016, 09:51

HI,

I am tring to control theta S from raspberry pi using USB api. The first problem I have is to detect the device. With "mtp-detect", I could find my Android phone but not Theta S. I have this message:
$ mtp-detect
Unable to open ~/.mtpz-data for reading, MTPZ disabled.
libmtp version: 1.1.11

Listing raw device(s)
No raw devices found.


According to https://wiki.debian.org/mtp I am done and theta s is not a MTP device.
Has anyone used USB api on Linux? It would be really helpful if someone used this api could share his/her experience. Thank you.
XiaomingYang
 
Posts: 4
Joined: 16 Jun 2016, 17:31

Re: Is Theta S a MTP device?

Postby XiaomingYang » 17 Jun 2016, 10:16

Just trid gphoto2 --auto-detect and Theta S is recogonised as USB PTP Class Camera. Any suggestions on how to use PTP with Theta S? Thx.
XiaomingYang
 
Posts: 4
Joined: 16 Jun 2016, 17:31

Re: Is Theta S a MTP device?

Postby XiaomingYang » 17 Jun 2016, 15:35

Another update, gphoto2 could find Theta S and take photos. Almost all function except 0xD00F ShutterSpeed. gphoto2 is reading it as:
(type=0x8) Enumeration [Unknow 8] value: Unknow 8

Any suggestion on how to get/set extended PTP properties?
XiaomingYang
 
Posts: 4
Joined: 16 Jun 2016, 17:31

Re: Is Theta S a MTP device?

Postby XiaomingYang » 23 Jun 2016, 14:12

Finally get it to work. I am working on Raspberry Pi with libptp http://libptp.sourceforge.net/
I have problem with gphoto2. The problem comes from the rational number used for shutter speed in USB API. None of these package support it directly. gphoto 2.5.10 may support m15 but does not work Theta S from my test.

With ptpcam -R, it can send a raw generic PTP request with parameters. The returned result could be reformated to shutter speed settings of Theta S. First read properties available, 0x1014 for reading device property description and 0xd00f for shutter speed. In the returned values, all the possible shutter speed is listed. For example, 01 00 00 00 a0 0f 00 are two 4-bype integers, 01 00 00 00 is 1 and a0 0f 00 00 is actually 0f a0 which is 6400.

$ ptpcam -R 0x1014,0xd00f,0,0,0,r
Camera: RICOH THETA S
Sending generic request: reqCode=0x1014, params=[0x0000d00f,0x00000000,0x00000000,0x00000000,0x00000000]
0f d0 08 00 01 00 00 00 00 00 00 00 00 01 00 00 - ................
00 3c 00 00 00 02 37 00 01 00 00 00 00 19 00 00 - .<....7.........
01 00 00 00 88 13 00 00 01 00 00 00 a0 0f 00 00 - ................
01 00 00 00 80 0c 00 00 01 00 00 00 c4 09 00 00 - ................
01 00 00 00 d0 07 00 00 01 00 00 00 40 06 00 00 - ............@...
...........


To get current setting of a property, 0x1015 for get property and 0xd00f for shutter speed:

$ptpcam -R 0x1015,0xd00f,0,0,0,r

Camera: RICOH THETA S
Sending generic request: reqCode=0x1015, params=[0x0000d00f,0x00000000,0x00000000,0x00000000,0x00000000]
01 00 00 00 3c 00 00 00 00 00 00 00 - ....<.......
PTP: response OK


The result 01 00 00 00 3c 00 00 00 could be read as (01)/(3c) = 1/60
To set shutter speed, could send binary data with ptpcam -R. To send 1/8, use 0x1016 for set property:
echo -e -n '\x01\x00\x00\x00\x08\x00\x00\x00' > shutter.bin
ptpcam -R 0x1016,0x00f,0,0,0,0,shuuter.bin


Have fun!
XiaomingYang
 
Posts: 4
Joined: 16 Jun 2016, 17:31

Re: Is Theta S a MTP device?

Postby codetricity » 29 Jun 2016, 22:42

This is awesome!!! Thank you for sharing this.
I tested the API over USB for about an hour. It works great. I documented my progress here.

I can set options, take a pictures, list and download files. I can also set mode to video and initiate video capture. However, I'm getting an I/O error when I try to stop video capture. Have you been able to overcome this problem? Other than this, it looks like I can access all of the v2 USB API.
codetricity
 
Posts: 612
Joined: 31 Jul 2015, 01:56



Return to Development



All times are UTC