Ricoh Theta Z1 Doesn't Accept My Request to Change File Format

240 Views Asked by At

I am using a Ricoh Theta Z1 updated to the most recent firmware (1.60.1). I am trying to debug an Android application, but I found that one of our commands was repeatedly failing, so I connected to the camera directly from my dev box and tested the protocol directly via curl.

It's my understanding from the documentation that this command should work:

$ curl -X POST -H "Content-Type: application/json; charset=UTF-8"   -d '{"name":"camera.setOptions", "parameters":{"options":{"captureMode":"image","fileFormat":{"height":3360,"type":"jpeg","width":6720}}}}'   http://192.168.1.1/osc/commands/execute

But when I run this command I get this response:

{"error":{"code":"invalidParameterValue","message":"Any input parameter or option name is recognized, but its value is invalid."},"name":"camera.setOptions","state":"error"}

This in spite of the fact that when I ask the camera about its options, it responds with the exact block it has just told me wouldn't parse:

$ curl -X POST -H "Content-Type: application/json; charset=UTF-8" -d '{"name":"camera.getOptions", "parameters":{"optionNames":["clientVersion","captureMode","fileFormat"]}}' http://192.168.1.1/osc/commands/execute

gets this response:

{"name":"camera.getOptions","results":{"options":{"captureMode":"image","clientVersion":2,"fileFormat":{"height":3360,"type":"jpeg","width":6720}}},"state":"done"}

Furthermore, when I run the first command and omit the fileFormat parameter, the command executes just fine.

Any ideas what I am doing wrong here?

2

There are 2 best solutions below

0
On BEST ANSWER

After a bunch of trial and error, I discovered that it is possible to use camera.setOptions to set the file format on the camera, but only if the fileFormat block is the only member of the options block. That is to say, this command:

$ curl -X POST -H "Content-Type: application/json; charset=UTF-8"   -d '{"name":"camera.setOptions", "parameters":{"options":{"fileFormat":{"height":3360,"type":"jpeg","width":6720}}}}'   http://192.168.1.1/osc/commands/execute

will succeed. I think this must be a bug in the Theta Z1 camera, because as far as I can discern from the docs (https://api.ricoh/docs/theta-web-api-v2/commands/camera.set_options/ and https://developers.google.com/streetview/open-spherical-camera/reference/camera/setoptions), there shouldn't be any restriction on what JSON goes into the options block. In any case, the workaround is simple enough: issue one command to set the file format and one or more as necessary to set the other options, and then you're good to go.

0
On

FYI, there is a similar bug with dateTimeZone. see this post

https://community.theta360.guide/t/how-setup-datetime-on-theta-camera-using-web-api/6572/3?u=craig

It seems like there are a few options that need to be set as a standalone option.

If you want to set dateTimeZone, it must be the only option set. I reported this to RICOH. I am going to post your findings on the community.theta360.guide forum to make it easier to find. Thanks.