0

I am trying to add support of Sony remote camera API to Open camera project (https://github.com/almalence/OpenCamera)

To begin with I download sample application and try to integrate it to Open camera. So, I can search for device and even launch Liveview. But I want to take more control of camera parameters. So, I implement some methods, to get info about camera parameters. For example, to get available exposure compensation I do following:

public JSONObject getAvailableExposureCompensation() throws IOException {
    String service = "camera";
    try {
        JSONObject requestJson =
                new JSONObject().put("method", "getAvailableExposureCompensation") //
                        .put("params", new JSONArray()).put("id", id()) //
                        .put("version", "1.0");
        String url = findActionListUrl(service) + "/" + service;

        log("Request:  " + requestJson.toString());
        String responseJson = SimpleHttpClient.httpPost(url, requestJson.toString());
        log("Response: " + responseJson);
        return new JSONObject(responseJson);
    } catch (JSONException e) {
        throw new IOException(e);
    }
}

It's just modified copy of another method from example application.

When I connect to Sony qx 10 and try to get info about exposure compensation, I get an exception:

03-03 00:25:31.098: W/SimpleHttpClient(32662): httpPost: Response Code Error: 403: http://10.0.0.1:10000/sony/camera
03-03 00:25:31.098: W/SimpleHttpClient(32662): httpPost: IOException: Response Error:403
03-03 00:25:31.098: W/System.err(32662): java.io.IOException: Response Error:403
03-03 00:25:31.098: W/System.err(32662):    at com.almalence.sony.cameraremote.utils.SimpleHttpClient.httpPost(SimpleHttpClient.java:180)
03-03 00:25:31.098: W/System.err(32662):    at com.almalence.sony.cameraremote.utils.SimpleHttpClient.httpPost(SimpleHttpClient.java:135)
03-03 00:25:31.098: W/System.err(32662):    at com.almalence.sony.cameraremote.SimpleRemoteApi.getAvailableWhiteBalance(SimpleRemoteApi.java:414)
03-03 00:25:31.098: W/System.err(32662):    at com.almalence.opencam.cameracontroller.SonyRemoteCamera.getSupportedWhiteBalance(SonyRemoteCamera.java:825)
03-03 00:25:31.098: W/System.err(32662):    at com.almalence.opencam.cameracontroller.SonyRemoteCamera.initRemoteCameraFeatures(SonyRemoteCamera.java:667)
03-03 00:25:31.098: W/System.err(32662):    at com.almalence.opencam.cameracontroller.SonyRemoteCamera$3.run(SonyRemoteCamera.java:274)

403 Forbidden

Same result have other requests, such as: getAvailableWhiteBalance, getAvailableFocusMode, getAvailableIsoSpeedRate, getAvailableStillSize...

But on the other hand, Sony's PlayMemories app has exposure compensation control and different white balance modes.

What I've missed? Or PlayMemories app has some hacks, to overcome this issue?

EDIT:

What I found during my attempts:

  1. getAvailableLiveviewSize is not supported by qx10 (and some other devices). But what to do, if I need info about Liveview size? Is there any other way to get measure of preview images?
  2. getAvailableStillSize, getAvailableExposureCompensation, getAvailableWhiteBalance, getAvailableFocusMode, getAvailableIsoSpeedRate - this methods declares as supported by qx10, and device says, the they are even available. But request to them responds with 403 error. Why? May be there is some special order of requests or I should change "version" field of requests? For now I use 1.0 version, as examples from documentation.
  3. Sony PlayMemories can control exposure and white balance. So, at least this 2 parameters should work on my qx10 device. Or It uses some other API, not available for 3rd party developers?

EDIT 2:

So, I can get available sizes:

03-10 13:22:50.820: D/SimpleRemoteApi(4418): Request:  {"method":"getAvailableStillSize","params":[],"id":10,"version":"1.0"}
03-10 13:22:50.826: D/SimpleRemoteApi(4418): Response: {"id":7,"result":[{"aspect":"4:3","size":"18M"},[{"aspect":"4:3","size":"18M"},{"aspect":"4:3","size":"5M"},{"aspect":"16:9","size":"13M"},{"aspect":"16:9","size":"2M"}]]}

But when I try to get available exposure compensations:

03-10 13:22:50.830: D/SimpleRemoteApi(4418): Request:  {"method":"getAvailableExposureCompensation","params":[],"id":11,"version":"1.0"}
03-10 13:22:51.012: D/SimpleRemoteApi(4418): Response: {"error":[1,""],"id":11}

According to documentation, error code 1 is common. So, there is not any specifics about issue. Same error have getISOmodes and getWBModes requests.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Maxim Metelskiy
  • 1,389
  • 14
  • 29
  • where you able to add qx10 to opencamera, i was planning on doing the same and saw this. – shaN Nov 28 '16 at 12:08

1 Answers1

1

Some of the APIs you are trying to call are not supported on the QX10. See the section "Supported API groups for each compatible cameras" in the API reference PDF that comes with the Camera Remote API SDK.

Regarding Edit 2: Most likely this is occurring because your mode is set to Intelligent or Superior Auto. Try changing to either Program Auto, Aperture, or Shutter using setExposureMode API and try calling getAvailableExposureCompensation again.

Also, the client app can get a list of available APIs using “getAvailableApiList” API or “getEvent” API at the moment and the app can confirm in advance which APIs are available.

mldeveloper
  • 2,253
  • 1
  • 13
  • 14
  • This methods are marked as supported for qx10: getAvailableExposureCompensation and getAvailableWhiteBalance. The result of getAvailableApiList request is also contain this methods. Besides, PlayMemories has controls for exposure and white balance. So, everything looks like getAvailableExposureCompensation and getAvailableWhiteBalance are supported? – Maxim Metelskiy Mar 03 '15 at 02:19
  • 1
    Which version of the FW are you running? If you aren't running v3.0, would recommend upgrading and see if that fixes the issue. http://www.sony.co.uk/support/en/product/dsc-qx10/updates – mldeveloper Mar 03 '15 at 18:38
  • Thank you @marlin! Updating to v3.0 solves the issue. But now I have a new one. I edited my question, please tell me, if you can help? – Maxim Metelskiy Mar 10 '15 at 07:38