RICOH THETA API Over USB Cable - (X, Z1, SC2, V, S, SC models)

Is it something that Ricoh will fix or they will just leave it as what it is now?

There was some earlier discussion on this a week or two ago.

RICOH THETA API Over USB Cable - (Z1, V, S, SC models) - #98 by craig

We reported the bug to RICOH a few weeks ago. I have no further information.

Some things to consider:

  • I do not work for RICOH and do not have information on the development plans
  • this site does receive sponsorship from RICOH and we do report community feedback back to management

My personal opinion is that I do not think there will be a fix to the V firmware for the USB API unless it is easy to fix. The reason I suspect this is that the THETA V is no longer in production and the Z1 works with wake from sleep from the USB cable.

I realize that this is unfortunate as the Z1 is considerably more expensive than the V. Again, I do not have any special information on RICOH plans. This is just my opinion.

Try this modification to libptp2.

I tested this modification with the RICOH THETA V and it works to wake it up from sleep. I am making a video now of my test.

Here’s the workaround for the THETA V wake from sleep problem. Solution was contributed by community member nickel110.

The solutions works great in my tests!

Thanks Craig,
I will test it and come back with my result.

Enter sleep mode and wake from sleep works fine on a Theta V (firmware 3.70.1) with gphoto2 :

Enter sleep mode :

gphoto2 --set-config=/main/other/d80e=1

wake up (sudo needed):

sudo gphoto2 --set-config=/main/other/d80e=0

Hugues

3 Likes

It works perfectly. :smile:

2 Likes

Nice!

Wow, thanks for that tip about sudo. I’m pretty sure I would be stuck at that for a while.

1 Like

Great to hear. Please post some pictures of your wheeled robot with the NUC. Feel free to start a new topic for what you’re doing with 360 vision on your robot. There’s some information on the robot hugues built here. He may have a more advanced version now.

Will do. I started with the camera part and detection algorithms, and the robot body has not been built yet.

1 Like

Feel free to post a new topic as a build log of what you’re doing with the robot and detection algorithms. I’m curious if you’re using the live feed, video to file analysis, or still images. Also, there’s a question of whether the camera is usable using AI training with normal images or if you need to use a fisheye image database.

In order to experiment with the problems and solutions of robots, I built a toy robot myself and mounted the camera on it with a 1/4" by 20tpi bolt.

dot-guide robot - YouTube

In it’s current state, the robot has a Raspberry Pi 4 for controlling the robot motors and lights and a separate Jetson Nano for managing the camera. The main reason for two controllers is that the robot toy kit had nice instructions to get it running with the RPi4. I I then simply attached the Nano to the back chassis with zip ties and duct tape. My robot is currently unstable because I’ve maxed out the rechargeable battery power supply current delivery. However, it is still fun to use for testing as I can get a small taste of the excitement of other robot builders. :slight_smile:

Thanks to @Hugues , here’s my successful test of waking the THETA V up from sleep with gphoto2 on Jetson Nano.

  • used apt to install gphoto2 from pre-compiled binaries onto the Nano
  • I did not need to use sudo to wake the THETA V up from sleep
  • used JetPack 4.4, THETA V firmware 3.70.1

This is in addition to the technique to modify ptpcam with code from nickel110.

I still intend to create another video that shows libptp2 compilation on Jetson with all the modifications from nickel110.

1 Like

You are right, I have a more advanced version


The Theta part is the same. I’m using Theta V, I will probably switch to Z1 in a near future.
Theta is connected in usb and all works with gphoto2 (with a modification in the source code to get the shutterspeed working). There is no live streaming, it takes either photos or videos. I change the RaspberryPi 3b+ with a raspberryPi 4, downloading content from the Theta to the Pi is about 10 times faster. I didn’t have tested the UVC driver yet because I want to keep the original mp4 stream without decoding and mainly because this solution is working fine (live streaming is done with a “standard” low-light usb webcam)
Hugues

2 Likes

Awesome! It looks amazing with the new chassis and wheels.

Is this a security lock or do you attach a tether to the robot in case you need to retrieve it?

That looks like a custom 3d printed mount for the THETA? Looks awesome. Nice work.

Hi there.

I would like to make the recording time of the Theta SC2 video longer than 3 minutes.
Can this be configured using the USB API?

I have tried the following, but could not set it to more than 3 minutes.

ptpcam --set-property=0xD823 --val=1500

Sorry if this is the wrong thread.

thanks,

You can’t override the 3 minute limitation of the SC2 video with an API. For the V or Z1, you can use a plug-in.

If you need longer than 3 minutes, you can use the motionJPEG of the SC2 at 1920x960 @ 30fps and save to permanent storage on the device giving the API command (not the camera). No audio track on the motionJPEG.

1 Like

Update to nickel110 fork of libptp2

I noticed that nickel110 added a new commit to his fork of libptp2

I downloaded his new version and tested it on Ubuntu 21.04

it worked fine to wake up the Z1 and V with a --reset-delay=2000. Note that in my test below, I renamed ptpcam to theta to the original ptpcam unmodified for testing.

All tests below succeeded in waking up both cameras from sleep and putting the cameras to sleep.

craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 1
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.

craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 1
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA Z1
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ 

# test with V below
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA V
'UNKNOWN' is set to: 0
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA V
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA V
'UNKNOWN' is set to: 1
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=1

Camera: RICOH THETA V
'UNKNOWN' is set to: 0
Changing property value to 1 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --reset-delay=2000  --set-property=0xD80E --val=0

Camera: RICOH THETA V
'UNKNOWN' is set to: 1
Changing property value to 0 [(null)] succeeded.
craig@craig-desktop:~/Documents/Development/libptp2-theta$ 


System information used in the test

Camera Info

craig@craig-desktop:~/Documents/Development/libptp2-theta$ theta --info

THETA Device Info
==================
Model: RICOH THETA V
  manufacturer: Ricoh Company, Ltd.
  serial number: '00105377'
  device version: 3.70.1
  extension ID: 0x00000006
  image formats supported: 0x00000004
  extension version: 0x006e

RICOH THETA USB API Updated for THETA X

1 Like

This is a GitHub issue that was closed. I am including it here in case other people have the problem.

problem

For the TerminateOpenCapture call, where and how do I pass in the TransactionID.

I am using the Windows MTP example.

I am able to start the video recording with
res = command.Execute(MtpOperationCode.InitiateOpenCapture, new uint[2] { 0, 0 }, null);

but not able to execute the TerminateOpenCapture command.


solution (by original author)

Got it to work with the following command

res = command.Execute(MtpOperationCode.TerminateOpenCapture, new uint[1] { 0xFFFFFFFF }, null);

I connect camera Theta V to Raspberry PI 4 via USB cable. Can I stream it ?
When I connect to Windows machine, it can stream. I open VLC and the device capture name dshow
In Raspberry PI 4, it shows /dev/video10 11, 12, 13, 14, 15, 16. I try make stream from these video but does not work.