Bloodevil / sony_camera_api

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

Adaptation for Action Cams #22

Open marcperuz opened 8 years ago

marcperuz commented 8 years ago

Hello,

Thanks a lot for sharing this code!

I'm using it to control an Action Cam (X1000V). I've changed the pysony.py file, it's in my repo in the X1000V branch. It's still under progress, it may not work properly yet (especially the function to get files within a specified time rang, getFileInRange).

I've changed the default IP address in SonyAPI(), for Action Cams it seems to be :

http://192.168.122.1:8080

A problem I had is that the APIs to retrieve data from the camera where not listed in getAvailableApiList() (even in Contents Transfer function), so I could not use them with the test written in _cmd that checks if the method is listed by getAvailableApiList(). Thus I run the test only if the target is /camera. Not very elegant but it works...

I also changed the attributes of the SonyAPI class : on my version the attributes are the IP addres, the uri of the scheme and the uri of the storage source. I'd rather define the parameters used for the API only in the _cmd method, it seems to me somehow more flexible.

I added a few methods to access data more conveniently than with the original getContentList.

Regards, Toufraita

mungewell commented 8 years ago

We recently implemented the uPNP scheme for finding the camera's IP. Try running the 'src/example/dump_camera_capabilities.py' script. It should find the camera and dump a list of the API calls it handles. If you can upload it, it would be interesting to see what the camera handles.

mungewell commented 8 years ago

also in '_read_device_definition()' the XML actually lists multiple endpoints, but we only return 'camera'. https://github.com/toufraita/sony_camera_api/blob/master/src/pysony.py#L129

Probably need to figure out how to use all of them...

marcperuz commented 8 years ago

I ran dump_camera_capabilities, but it doesn't return anything... Yet it does work when I specify the camera IP address.

mungewell commented 8 years ago

splitting out bug #23 for uPNP not finding camera.

Bloodevil commented 8 years ago

you can use the custom uri like

camera = pysony.SonyAPI(QX_ADDR='http://192.168.122.1:8080')

after connect the camera, then you can get a list of support api.