THETA V and THETA Z1 not answering web requests

#1

Greetings,

I am trying to send https requests to theta V and theta Z1, but I have no anwsers :

Theta V:
I can get info and state (http://192.168.1.1/osc/state and http://192.168.1.1/osc/info)
I can start the session (camera.startSession)
I can take a picture (camera.takePicture)

I can’t get anwser for any other command.

Theta Z1:
Only state and info are working.

I tried with theta SC, and everything works.
Firmwares are updated.
I send an email to the support, but I got the following anwser :
“We don’t support the API and SDK issues”* (translated*)

(i’m using c#)

I hope you can help me !

1 Like
#2

Are you passing this in the header?

Content-Type: application/json;charset=utf-8

I did another test. The command is successful with a content-type header. It will fail without the header. Test is with a Z1.

POST /192.168.1.1/osc/commands/execute HTTP/1.1
Content-Length: 63
Host:
Content-Type: application/json;charset=utf-8

{
    "name": "camera.takePicture",
    "parameters": {
    }
}

HTTP/1.1 200 OK
Connection: Keep-Alive
X-Content-Type-Options: nosniff
Content-Length: 91
Content-Type: application/json; charset=utf-8

{"id":"78","name":"camera.takePicture","progress":{"completion":0.00},"state":"inProgress"}

image

2 Likes
#3

Hey, thank you for anwsering !
I didnt try the charset.

I’ll try this out and come back to you then.

2 Likes
#4

If you get another error, can you post the exact HTTP response back? You can either copy and paste or take a screenshot.

It might say something under HTTP/1.1 404… with more information.

Ideally, it will say, HTTP/1.1 200 OK … and everything will be hapy.

#5

Greetings,

Thank you for your help. I finaly can talk kindly with my cameras !

I added chartset=utf-8 to my Content-Type although the problem was not there.

Theta V and Theta Z1 don’t use the camera.startSession command that I was doing no matter which camera I was using. It actualy just needs the basic request to work. I figured it out thank to your screens.

Thank you again.

Best regards,
Samuel

2 Likes
#6

Samuel, thank you for the report back on success.

I should have thought of this and pointed it out to you. The SC and S use an older version of the API by default and need to be told to use the newer API. The V and Z1 use the newer API by default. I’ve struggled with this in the past myself.

https://developers.theta360.com/en/docs/v2.1/api_reference/getting_started.html

It’s explained in the official documentation, but easy to overlook and IMO, would benefit from more examples.

2 Likes