Bloodevil / sony_camera_api

sony camera remote api
http://developer.sony.com/develop/cameras/
MIT License
255 stars 61 forks source link

scan_for_cameras.py cannot find Sony A7C #76

Open qdwang opened 3 years ago

qdwang commented 3 years ago

The result of scan_for_cameras.py is

Available cameras: []

with the latest develop branch of the repo.

But http://192.168.122.1:64321/dd.xml can be opened in brower, so the camera must has been connected to the computer.

mungewell commented 3 years ago

Finding cameras is 2 phase; first it has to locate the IP and then it parses the XML. Previously we had to tweak the parsing to account for slight differences in the response.... but I think that the code has moved on since then. https://github.com/Bloodevil/sony_camera_api/commit/aefce98732313c53460375e415c90a73ca9d9848#diff-c13b209edfca4d5d90b0f4a442d06dca9fa15657a48d99d10524fce39c6d5b9e

Maybe you can dump/print out the data sent to "_parse_ssdp_response()" and look for differences. https://github.com/Bloodevil/sony_camera_api/blob/develop/src/pysony.py#L80

Also note, you can alter the script 'scan_for_cameras.py" to force the IP address to a particular value.

mungewell commented 3 years ago
commit d65482cb4c10060c6b93ac11a177a17cd1387a55 (HEAD -> develop)
Author: yeaji.shin <yeajishin@nway.com>
Date:   Mon May 25 15:52:50 2020 -0700

On my QX-10 gives:

simon@thevoid:~/sony_camera_api-github$ python3 examples/scan_for_cameras.py 
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=1800\r\nEXT: \r\nLOCATION: http://10.0.0.1:64321/DmsRmtDesc.xml\r\nSERVER: UPnP/1.0 SonyImagingDevice/1.0\r\nST: urn:schemas-sony-com:service:ScalarWebAPI:1\r\nUSN: uuid:00000000-0005-0010-8000-98f1700fa96e::urn:schemas-sony-com:service:ScalarWebAPI:1\r\nX-AV-Physical-Unit-Info: pa=""; pl=;\r\nX-AV-Server-Info: av=5.0; hn=""; cn="Sony Corporation"; mn="SonyImagingDevice"; mv="1.0";\r\n\r\n'
Available cameras: ['http://10.0.0.1:10000']

Checking Camera: http://10.0.0.1:10000
{'id': 1, 'result': [['getMethodTypes', 'getAvailableApiList', 'setShootMode', 'getShootMode', 'getSupportedShootMode', 'getAvailableShootMode', 'setSelfTimer', 'getSelfTimer', 'getSupportedSelfTimer', 'getAvailableSelfTimer', 'setPostviewImageSize', 'getPostviewImageSize', 'getSupportedPostviewImageSize', 'getAvailablePostviewImageSize', 'startLiveview', 'stopLiveview', 'actTakePicture', 'startMovieRec', 'stopMovieRec', 'awaitTakePicture', 'actZoom', 'setExposureMode', 'getExposureMode', 'getSupportedExposureMode', 'getAvailableExposureMode', 'setBeepMode', 'getBeepMode', 'getSupportedBeepMode', 'getAvailableBeepMode', 'setCameraFunction', 'getCameraFunction', 'getSupportedCameraFunction', 'getAvailableCameraFunction', 'setStillSize', 'getStillSize', 'getSupportedStillSize', 'getAvailableStillSize', 'actFormatStorage', 'getStorageInformation', 'setTouchAFPosition', 'cancelTouchAFPosition', 'getTouchAFPosition', 'setExposureCompensation', 'getExposureCompensation', 'getSupportedExposureCompensation', 'getAvailableExposureCompensation', 'setWhiteBalance', 'getWhiteBalance', 'getSupportedWhiteBalance', 'getAvailableWhiteBalance', 'setIsoSpeedRate', 'getIsoSpeedRate', 'getSupportedIsoSpeedRate', 'getAvailableIsoSpeedRate', 'actHalfPressShutter', 'cancelHalfPressShutter', 'getApplicationInfo', 'getVersions', 'getEvent']]}
mungewell commented 3 years ago

Also, on my the A5000 the factory installed WiFi app was pretty crappy, make sure that you install the latest from the Sony App Store.

qdwang commented 3 years ago

It seems A7C does not support http api now. It only supports PTP/IP protocol.

zonyl commented 3 years ago

Any reference to that ptp/ip protocol is?