Originally published at: MACOS and RICOH THETA USB API - RICOH THETA Developer Community
The USB API is very popular with RICOH THETA cameras for use cases such as time lapse or high volume pictures with a device such as a Raspberry Pi. Although most people use the USB API from Linux, it is also possible to use it from the MacOS.
The main reason people use the USB API on Linux is due to the lower cost of hardware such as the Raspberry Pi or Jetson Nano. If you are comfortable using Linux, you may find more community support and examples for using the RICOH THETA USB API on Linux.
This article covers two different free and open source applications that run on MacOS that can configure the USB API of RICOH THETA cameras.
- gphoto2
- ptpcam
gphoto2 Installation on MacOS using brew
You can easily install gphoto2 on a Mac with
brew install gphoto2
If you do not have brew installed on your Mac, see this site:
Basic gphoto2 commands
If you run gphoto2 with no command, you can see the options.
Getting Summary Information on THETA Z1
On your Mac use gphoto2 --summary
List Files on THETA
gphoto2 --list-files
Set shutter volume
Download Files from RICOH THETA To Your Mac
Viewing Images on Mac
Take Still Image
craig@craigs-air ~ % gphoto2 --capture-image
New file is in location /store_00020001/DCIM/101RICOH/R0020127.JPG on the camera
craig@craigs-air ~ %
Capture Image and Download
This will delete the file from the RICOH THETA camera after downloading to your Mac.
gphoto2 --capture-image-and-download
New file is in location /store_00020001/DCIM/101RICOH/R0020128.JPG on the camera
Saving file as R0020128.JPG
Deleting file /store_00020001/DCIM/101RICOH/R0020128.JPG on the camera
craig@craigs-air Documents %
Verify download with RICOH THETA desktop application for Mac.
Get Battery Level of RICOH THETA Z1
gphoto2 --get-config=batterylevel
Label: Battery Level
Readonly: 1
Type: TEXT
Current: 100%
END
craig@craigs-air Documents %
Get White Balance
% gphoto2 --get-config=whitebalance
Label: WhiteBalance
Readonly: 0
Type: RADIO
Current: Automatic
Choice: 0 Automatic
Get Capture Mode
gphoto2 --get-config=capturemode
Label: Still Capture Mode
Readonly: 0
Type: RADIO
Current: Unknown value 8002
Choice: 0 Single Shot
Choice: 1 Timelapse
Show Info on Specific Image in RICOH THETA Camera
gphoto2 --show-info 1
Information on file 'R0020117.JPG' (folder '/store_00020001/DCIM/101RICOH'):
File:
Mime type: 'image/jpeg'
Size: 8076696 byte(s)
Width: 6720 pixel(s)
Height: 3360 pixel(s)
Permissions: read/delete
Time: Tue Apr 26 09:09:08 2022
Thumbnail:
Mime type: 'image/jpeg'
Size: 10724 byte(s)
Width: 320 pixel(s)
Height: 160 pixel(s)
Audio data:
None available.
Put RICOH THETA to Sleep
% gphoto2 --set-config=/main/other/d80e=1
Wake RICOH THETA Camera From Sleep
gphoto2 --set-config=/main/other/d80e=0
Set ExposureProgram to Manual
gphoto2 –set-config=500e=1
Get ISO
With Exposure Program set to Manual.
gphoto2 --get-config /main/imgsettings/iso
Label: ISO Speed
Readonly: 0
Type: RADIO
Current: 100
Choice: 0 80
Choice: 1 100
Choice: 2 125
Choice: 3 160
Choice: 4 200
Choice: 5 250
Choice: 6 320
Choice: 7 400
Choice: 8 500
Choice: 9 640
Choice: 10 800
Choice: 11 1000
Choice: 12 1250
Choice: 13 1600
Choice: 14 2000
Choice: 15 2500
Choice: 16 3200
Set ISO to 6400
Set Mode to Video
gphoto2 --get-config=5013
Label: Still Capture Mode
Readonly: 0
Type: MENU
Current: 32772
Choice: 0 1
Choice: 1 3
Choice: 2 32770
Choice: 3 32771
Choice: 4 32772
Choice: 5 32773
Choice: 6 32774
Choice: 7 32775
END
craig@craigs-air Documents % gphoto2 --set-config=5013=2
Alternative to gphoto2 – libptp2
libptp2 is an alternative to gphoto2 and more popular on Linux for accessing the RICOH THETA USB API.
You can install libptp2 v1.1.10 using MacPorts.
https://ports.macports.org/port/libptp2/
Information on installing MacPorts is available here:
https://www.macports.org/install.php
I’m using Monterey.
Get Camera Info with ptpcam
Set GPS Information with ptpcam
ptpcam --set-property=0xD801 --val="23.532000,23.532000+999.00m@20210904T170429.0+0900,WGS84"
Camera: RICOH THETA Z1
‘UNKNOWN’ is set to: “23.532000,23.532000+999.00m@20210904T080429,WGS84”
Changing property value to 23.532000,23.532000+999.00m@20210904T170429.0+0900,WGS84 [(null)] succeeded.
craig@craigs-air tmp %
Show GPS Setting with ptpcam
ptpcam --show-property=0xd801
Camera: RICOH THETA Z1
‘UNKNOWN’ is set to: “23.532000,23.532000+999.00m@20210904T080429,WGS84”
craig@craigs-air tmp %
Set RICOH THETA to Video Mode with ptpcam
List Files with ptpcam
Set Time Lapse to 10
craig@craigs-air tmp % ptpcam --set-property=0x501A --val=10
Camera: RICOH THETA Z1
‘Timelapse Number’ is set to: 0
Changing property value to 10 [(null)] succeeded.
craig@craigs-air tmp %
API Reference
https://api.ricoh/docs/theta-usb-api/
Environment Used in this Article
- RICOH THETA Z1 with firmware 2.01.0
- gphoto2 2.5.28
- MacOS Monterey 12.3
- Apple M1 chip