I have been able to get my a-7 camera to take pictures by using the api. However I am stuck trying to transfer those images. By following the documentation I called the setCameraFunction to change it to contents transfer mode using the json below:
{"method":"setCameraFunction","params":["Contents Transfer"],"id":1,"version":"1.0"}
However the camera always returns with:
{"id":1,"error":[1,"Not Available Now"]}
Below is the output of the sequence I use to take the image (5 sec pause between each call):
Request: {"method":"startRecMode","params":[],"id":1,"version":"1.0"}
Response: {"result":[0],"id":1}
Request: {"method":"getAvailableShootMode","params":[],"id":1,"version":"1.0"}
Response: {"result":["still",["still"]],"id":1}
Request: {"method":"actTakePicture","params":[],"id":1,"version":"1.0"}
Response: {"result":[["http:\/\/192.168.122.1:8080\/postview\/pict20170707_003048_0.JPG"]],"id":1}
Request: {"method":"stopRecMode","params":[],"id":1,"version":"1.0"}
Response: {"result":[0],"id":1}
Request: {"method":"getStorageInformation","params":[],"id":1,"version":"1.0"}
Response: {"id":1,"error":[1,"Not Available Now"]}
Request: {"method":"setCameraFunction","params":["Contents Transfer"],"id":1,"version":"1.0"}
Response: {"id":1,"error":[1,"Not Available Now"]}
Sometimes the getStorageInformation returns with:
{
"result": [
[
{
"storageDescription": "Storage Media",
"numberOfRecordableImages": 3275,
"storageID": "Memory Card 1",
"recordTarget": true,
"recordableTime": -1
}
]
],
"id": 1
}
However trying to change to content mode always yields a "Not Available Now".
I have been able to access the preview image using the url generated by the actTakePicture function however this is a low resolution image and it won't work for our application.
I have also tried not calling the "stopRecMode" function before trying to enter "Contents Transfer" mode but it made no difference.
Output of the "getEvent" function before trying to enter Contents Transfer mode:
{
"result": [
{
"type": "availableApiList",
"names": [
"getVersions",
"getMethodTypes",
"getApplicationInfo",
"getAvailableApiList",
"getEvent",
"startRecMode",
"stopRecMode"
]
},
{
"cameraStatus": "NotReady",
"type": "cameraStatus"
},
null,
{
"type": "liveviewStatus",
"liveviewStatus": false
},
null,
[],
[],
null,
null,
null,
[],
null,
{
"cameraFunctionCandidates": [
"Contents Transfer",
"Remote Shooting"
],
"type": "cameraFunction",
"currentCameraFunction": "Remote Shooting"
},
null,
null,
null,
null,
null,
null,
{
"postviewImageSizeCandidates": [
"2M"
],
"type": "postviewImageSize",
"currentPostviewImageSize": "2M"
},
null,
{
"shootModeCandidates": [
"still"
],
"type": "shootMode",
"currentShootMode": "still"
},
null,
null,
null,
null,
null,
{
"fNumberCandidates": [],
"type": "fNumber",
"currentFNumber": "--"
},
null,
null,
null,
null,
{
"type": "shutterSpeed",
"shutterSpeedCandidates": [],
"currentShutterSpeed": "1/60"
},
{
"type": "whiteBalance",
"currentColorTemperature": -1,
"checkAvailability": true,
"currentWhiteBalanceMode": "Auto WB"
},
null
],
"id": 1
}
Other information:
Upgraded the camera to the latest firmware (version 3.20), installed the latest Smart Remote Control App (version 4.30).
I'm totally stuck here, any advice would be awesome.
Thanks
I was able to resolve the issue and thought I'd post it here in case it helps someone else.
Instead of using the "Contents Transfer" mode, what I had to do is use the "setPostviewImageSize" and set the preview image to original. With that changed the url returned by "actTakePicture" will be to the image just taken and the size of the image will be the full resolution, 6000x4000 in this case.
Here is the json for the setPostviewImageSize request:
{
"method": "setPostviewImageSize",
"params": [
"Original"
],
"id": 1,
"version": "1.0"
}