UPDATED in 2022: Examples of setting GPS Info

Updated May 2022

craig@jetson:~/Documents/Development$ theta --set-property=0xD801 --val="23.532000,23.532000+999.00m@20210904T170429.0+0900,WGS84"

Camera: RICOH THETA Z1
'UNKNOWN' is set to: "(null)"
Changing property value to 23.532000,23.532000+999.00m@20210904T170429.0+0900,WGS84 [(null)] succeeded.
craig@jetson:~/Documents/Development$ 

craig@jetson:~/Documents/Development$ theta --set-property=0xD801 --val="23.532000,23.532000+999.00m@20210904T170429.0Z,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.0Z,WGS84 [(null)] succeeded.


Original OLD example from 2017

Different examples setting GPS info.

from community member 200cm3

- (void)setGpsLocation:(double)lat lng:(double)lng alt:(double) alt
{
 [self setOptions:@{@"gpsInfo":
                           @{@"lat": [NSNumber numberWithDouble: lat],
                             @"lng": [NSNumber numberWithDouble: lng],
                             @"dateTimeZone": @"2014:05:18 01:04:29+08:00",
                             @"_altitude": [NSNumber numberWithDouble:alt],
                             @"datum": @"\"WGS84\""}}];
    
}

Using shell script from Jason Charcalla.

JSON_GPS_SET_REQ=$(< <(cat <<EOF
{
  "name": "camera.setOptions",
  "parameters": {
    "sessionId": "SID_${SID}",
    "options": {
                  "gpsInfo": {
                 "lat": ${GPS_LAT},
                 "lng": ${GPS_LON},
                 "_altitude": ${GPS_ALT},
                 "_dateTimeZone":"${GPS_DATE} ${GPS_TIME}+00:00",
                  "_datum":"WGS84"
            }
        }
  }
}
EOF
))
                   # Set the gps values on the camera via wifi
                echo ${JSON_GPS_SET_REQ}
                   curl -s -X POST -d "${JSON_GPS_SET_REQ}" http://${CAMIP}:${PORT}/osc/commands/execute >> /dev/null
             else
            # Set the gps via usb
            ptpcam --set-property=0xD801 --val="${GPS_LAT},${GPS_LON},${GPS_ALT}m@${GPS_DATE}${GPS_TIME}Z,WGS84"
         fi

       else
          echo "GPS enabled but now location found."
       fi
    fi

Full code for the shell script, including use of input from a GPS unit connected to a Raspberry Pi

1 Like

Hello.

I am able to communicate with THETA Z1 using Raspberry Pi and ptpcam, but I cannot update GpsInfo (0xD801).

What’s wrong?

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"


$ sudo ptpcam --list-devices

Listing devices...
bus/dev vendorID/prodID device model
001/008 0x05CA/0x2716   RICOH THETA Z1

$ sudo ptpcam --info

Camera information
==================
Model: RICOH THETA Z1
  manufacturer: Ricoh Company, Ltd.
  serial number: '10113717'
  device version: 2.00.1
  extension ID: 0x00000006
  extension description: (null)
  extension version: 0x006e



$ sudo ptpcam --set-property=0xD801 --val="45.000000,136.000000,1234.00m@202109041753000900Z,WGS84"

Camera: RICOH THETA Z1
'UNKNOWN' is set to: "(null)"
Changing property value to 45.000000,136.000000,1234.00m@202109041753000900Z,WGS84 [(null)] FAILED!!!

@jcasman and I would like to try and test this more first.

The project below used to work with an older RICOH THETA model. The format of the ptpcam command looks the same as the format you used on the Z1. Can you take a look at line 819 in the script below and try it with the Z1?

We can also try and compare the USB API behavior with this:

gpsInfo

Though, the format of dateTimeZone appears to be different.

We can also try with different camera models to try and verify that the command format works on a different model.


command to test

$ sudo ptpcam --set-property=0xD801 --val="45.000000,136.000000,1234.00m@202109041753000900Z,WGS84"

Update:

I’m unable to use this with either the Z1 or the V. I think I have the format of value of the device property incorrect.

Camera information
==================
Model: RICOH THETA Z1
  manufacturer: Ricoh Company, Ltd.
  serial number: '10010104'
  device version: 2.00.1
  extension ID: 0x00000006
  extension description: (null)
  extension version: 0x006e


Initiating captue...
Object added 0x00000581
Capture completed successfully!

Camera: RICOH THETA Z1
'UNKNOWN' is set to: "(null)"
Changing property value to 45.000000,136.000000,1234.00m@20210904T175300.1Z,WGS84 [(null)] FAILED!!!
PTP: Invalid Device Prop Value
craig@craig-desktop:~/Development/ricoh/usb/gps$ bash gps_test.sh 

Camera information
==================
Model: RICOH THETA Z1
  manufacturer: Ricoh Company, Ltd.
  serial number: '10010104'
  device version: 2.00.1
  extension ID: 0x00000006
  extension description: (null)
  extension version: 0x006e


Initiating captue...
Object added 0x00000582
Capture completed successfully!

Camera: RICOH THETA Z1
'UNKNOWN' is set to: "(null)"
Changing property value to 45.000000,136.000000,+1234.00m@20210904T175300Z,WGS84 [(null)] FAILED!!!
PTP: Invalid Device Prop Value

Test Setup

  • Set GPS information with mobile app
  • use USB API to get GPS information from image and recheck format

Acquire GPS information using USB API after setting with WebAPI

$ ptpcam_mod --show-property=0xD801

Camera: RICOH THETA Z1
'UNKNOWN' is set to: "23.532000,23.532000+999.00m@20140517T170429,WGS84"
craig@jetson:~/Documents/tools/power_on$ 

Test of setting 0xd801 with result from --show-property

$ ptpcam_mod --set-property=0xD801 --val="23.532000,23.532000+999.00m@20140517T170429,WGS84"

Camera: RICOH THETA Z1
'UNKNOWN' is set to: "23.532000,23.532000+999.00m@20140517T170429,WGS84"
Changing property value to 23.532000,23.532000+999.00m@20140517T170429,WGS84 [(null)] FAILED!!!
PTP: Invalid Device Prop Value

test with no quotes

$ ptpcam_mod --set-property=0xD801 --val=23.532000,23.532000+999.00m@20140517T170429,WGS84

Camera: RICOH THETA Z1
'UNKNOWN' is set to: "23.532000,23.532000+999.00m@20140517T170429,WGS84"
Changing property value to 23.532000,23.532000+999.00m@20140517T170429,WGS84 [(null)] FAILED!!!

test with gphoto2

failed

The property 'PTP Property 0xd801' / 0xd801 was not set (0x201b: PTP Invalid Device Prop Format).

Test with SC2

SC2 with firmware 1.64

craig@jetson:~/Documents/tools/power_on$ ptpcam --info

Camera information
==================
Model: RICOH THETA SC2
  manufacturer: Ricoh Company, Ltd.
  serial number: '20001005'
  device version: 01.64
  extension ID: 0x00000006
  extension description: (null)
  extension version: 0x006e

set GPS value works with SC2

$ ptpcam_mod --set-property=0xD801 --val="23.532000,23.532000+999.00m@20140517T170429,WGS84"

Camera: RICOH THETA SC2
'UNKNOWN' is set to: "23.532000,23.532000+999.00m@20140517T170429.0-0700,WGS84"
Changing property value to 23.532000,23.532000+999.00m@20140517T170429,WGS84 [(null)] succeeded.
craig@jetson:~/Documents/tools/power_on$ 

SC2 result success with same string sent to Z1 and failed.

get GPS value works with SC2

$ ptpcam_mod --show-property=0xD801

Camera: RICOH THETA SC2
'UNKNOWN' is set to: "23.532000,23.532000+999.00m@20140517T170429.0-0700,WGS84"
craig@jetson:~/Documents/tools/power_on$ 

SC2 value was correctly saved using USB API


Test with V firmware 3.70.1

$ ptpcam_mod --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

set GPS info fails

$ ptpcam_mod --set-property=0xD801 --val="23.532000,23.532000+999.00m@20140517T170429,WGS84"

Camera: RICOH THETA V
'UNKNOWN' is set to: "(null)"
Changing property value to 23.532000,23.532000+999.00m@20140517T170429,WGS84 [(null)] FAILED!!!
PTP: Invalid Device Prop Value

conclusion

We will report to RICOH.

Hello Community,

Would like to start by saying thanks to the fantastic community! I am just starting out and have been learning a lot from the posts along with the great videos the community is producing. I was wondering if there has been any progress on this or an update?

Thanks!

1 Like

Are you using the USB API? Can you confirm that your use case does not allow the use of the WebAPI?

It appears that you can set the GPS information with the WebAPI.

I am using the USB API and was hopping to avoid the WebAPI as the USB seems to be a bit more strait forward for me and have not tried the WebAPI yet, but will give it a go.

My initial thought is to use the USB API in hopes to reduce power consumption with the RPi Zero W, GPS module and the Z1 as I am running off a an external battery. I have not tried the WebAPI, but will look into it.

I was thinking maybe splitting the load between the USB API and Bluetooth API assuming this can be done. The Bluetooth API can possible sync the GPS data. Just looking at keeping the power consumption low.

Update May 12, 2022 - now works

I had an error in the syntax of my original test.

The documentation here appears to be correct. If you follow it closely, the syntax works.

0xD801 GpsInfo

In the example below, theta is the same as ptpcam

THETA Device Info
==================
Model: RICOH THETA Z1
  manufacturer: Ricoh Company, Ltd.
  serial number: '10010104'
  device version: 2.01.0
  extension ID: 0x00000006
  image formats supported: 0x00000005
  extension version: 0x006e

craig@jetson:~/Documents/Development$ theta --set-property=0xD801 --val="23.532000,23.532000+999.00m@20210904T170429.0+0900,WGS84"

Camera: RICOH THETA Z1
'UNKNOWN' is set to: "(null)"
Changing property value to 23.532000,23.532000+999.00m@20210904T170429.0+0900,WGS84 [(null)] succeeded.
craig@jetson:~/Documents/Development$ 

craig@jetson:~/Documents/Development$ theta --set-property=0xD801 --val="23.532000,23.532000+999.00m@20210904T170429.0Z,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.0Z,WGS84 [(null)] succeeded.

2 Likes