sony dsc-qx100 with bescor mp-101

24
Sony DSC-QX100 with Bescor MP-101 さいたま開発勉強会 vol10  島村 毅

Upload: xlf01512

Post on 14-Jul-2015

800 views

Category:

Devices & Hardware


0 download

TRANSCRIPT

Page 1: Sony DSC-QX100 with Bescor MP-101

Sony DSC-QX100 with Bescor MP-101

さいたま開発勉強会 vol10  島村 毅

Page 2: Sony DSC-QX100 with Bescor MP-101

自己紹介!

• POSレジのアプリなどを作っています。

• システム屋です。

• ガジェット大好き

• twitter ID:xlf01512

• Facebook:島村 毅

Page 3: Sony DSC-QX100 with Bescor MP-101

みなさん、知っていますか?昨年、10月にソニーから「夢」のレンズだけカメラが発売!!

!

!

!

!

     DSC-QX10      DSC-QX100

Page 4: Sony DSC-QX100 with Bescor MP-101

ギズモード・ジャパンの レビュー

!

!

ソニー「QX100」ギズレビュー:画質は最高、でも使用感は苦痛そのもの!!

(詳しくは、http://www.gizmodo.jp/2013/10/qx_100.html)

Page 5: Sony DSC-QX100 with Bescor MP-101

あちこちで操作性の悪さで こけにされています。

  そこで、ファインダーを付けてみました!!

Page 6: Sony DSC-QX100 with Bescor MP-101

Camera Remote API対応機種は、まだ少ないですが、最低限の操作ができるAPIが公開されてます。

https://developer.sony.com/downloads/all/sony-camera-remote-api-beta-sdk/

4月にアップデートされ、ピントの指定や半押しなどがサポートされました。

Page 7: Sony DSC-QX100 with Bescor MP-101

接続概要

7

Developer World developer.sony.com

Supported devices For a full list of supported devices, please see the Device section on http://developer.sony.com. To see which

APIs are supported for each compatible camera, please see the API Reference document also available in the

Camera Remote API SDK.

How to access camera functions There are three steps to access the camera functions from your app:

1) Connect the phone or tablet via Wi-Fi® to the Camera which acts as an access point.

2) From your app use SSDP (Simple Service Discovery Protocol) to discover the camera and get the URL

needed to call the APIs.

3) Now your app can call the APIs by HTTP POST with JSON.

Figure 2. Overview of how to access the camera functions.

1. Wi-Fi®

Connection

2. Device

Discovery

3. API

Calls

1. Wi-Fi® connection

2. Device Discovery

3. API Calls

Client Server

to get the URL to call APIs

to access camera functions

Camera Smartphone/Tablet

Application

※WiFi接続は、アドホックモードのみサポート

Page 8: Sony DSC-QX100 with Bescor MP-101

2.SSDPを使ってカメラデバイスの検索、 デバイスの詳細を取得

8

Developer World developer.sony.com

Step 1. Connect the phone or tablet to the camera over Wi-Fi®

First, you need to enable the remote control function on your camera. The camera will then act as an access point.

Then you should connect your phone or tablet to the camera access point. On the phone or tablet, select the camera access point and input the password displayed on the camera or described in the manuals.

The remote device, for example your smartphone or tablet can now establish a one-to-one connection with the camera via Wi-Fi®. Your application is now be ready to work as a client.

Step 2. Use SSDP to discover the camera

Any camera supporting the Camera Remote API can be discovered using SSDP (Simple Service Discovery Protocol). Your smartphone or tablet client app can get the endpoint URL of the API, and information about supported functionalities, over device discovery according to the below illustration. For details please see the sample code included in the Camera Remote API SDK.

Please note that an entire UPnP stack is not required to support Camera Remote API. Only the SSDP portion of UPnP is required.

Page 9: Sony DSC-QX100 with Bescor MP-101

2-1SSDP(simple service discovery protocol)

Page 10: Sony DSC-QX100 with Bescor MP-101

カメラの情報を取得(XML) (1回のみ)

10

Developer World developer.sony.com

Device description This is the example of the Device description. ("X_ScalarWebAPI_DeviceInfo" section only.)

<av:X_ScalarWebAPI_DeviceInfo xmlns:av="urn:schemas-sony-com:av">

<av:X_ScalarWebAPI_Version>1.0</av:X_ScalarWebAPI_Version>

<av:X_ScalarWebAPI_ServiceList>

<av:X_ScalarWebAPI_Service>

<av:X_ScalarWebAPI_ServiceType>guide</av:X_ScalarWebAPI_ServiceType>

<av:X_ScalarWebAPI_ActionList_URL>http://10.0.0.1:10000/sony</av:X_ScalarWebAPI_ActionList_URL>

</av:X_ScalarWebAPI_Service>

<av:X_ScalarWebAPI_Service>

<av:X_ScalarWebAPI_ServiceType>camera</av:X_ScalarWebAPI_ServiceType>

<av:X_ScalarWebAPI_ActionList_URL>http://10.0.0.1:10000/sony</av:X_ScalarWebAPI_ActionList_URL>

</av:X_ScalarWebAPI_Service>

</av:X_ScalarWebAPI_ServiceList>

</av:X_ScalarWebAPI_DeviceInfo>

The information of Camera Remote API is described by the following tags in "X_ScalarWebAPI_DeviceInfo"

element.

Tag  Name Explanation

X_ScalarWebAPI_ServiceList This element has the all provided "API service" information. Each "API service"

is described by "X_ScalarWebAPI_Service" tag.

X_ScalarWebAPI_Service This element has "API service" type and its URL of the service. This tag is sub

element of "X_ScalarWebAPI_ServiceList".

X_ScalarWebAPI_ServiceType Provided "API service" name.

This tag is sub element of “X_ScalarWebAPI_Service".

e.g) camera

X_ScalarWebAPI_ActionList_URL Each "API service" is set under this URL.

This tag is sub element of "X_ScalarWebAPI_Service".

e.g.) http://10.0.0.1:10000/sony

For details about the "API service", see the API service section in this document.

After receiving the discovery response, the client should retrieve the Device Description (e.g. HTTP GET

http://10.0.0.1:64321/dd.xml).

Cameras supporting Camera Remote API have "X_ScalarWebAPI_DeviceInfo" tag in Device Description. Its

name space is "urn:schemas-sony-com:av".

<av:X_ScalarWebAPI_DeviceInfo xmlns:av="urn:schemas-sony-com:av">

The client can get the URL to call APIs from the information in the "X_ScalarWebAPI_DeviceInfo" element. For

details, see the Endpoint URL section in this document.

Page 11: Sony DSC-QX100 with Bescor MP-101

3.API Calls(HTTP)

• パラメータは、JSON形式

• 設定などはPOSTで実行

• ライブ映像は、GETで取得

Page 12: Sony DSC-QX100 with Bescor MP-101

Bescor MP-101

ケーブルリモコンが付属している。

Page 13: Sony DSC-QX100 with Bescor MP-101

何とかワイヤレスにしたい。

「MP-101 改造」 でググってみた。

Page 14: Sony DSC-QX100 with Bescor MP-101

いました!

赤外線リモコンを使った システムで丁寧に解説しています。

また、ピンのアサインをPDFで公開(親切)。 http://www1.plala.or.jp/h-roku/MP-101.html

Page 15: Sony DSC-QX100 with Bescor MP-101

仕組み

リモコンの中には、左右、上下の4つのスイッチとスピードを変えるためのボリュームが入っています。

ここでは、ボーリュームは無視して4つのスイッチの代役を考えます。

Page 16: Sony DSC-QX100 with Bescor MP-101

スイッチの代わりになる物は?1.トランジスタ ここでは、流れる電流等が不明なためしっかり調べ(ハック)ないとダメ。

Page 17: Sony DSC-QX100 with Bescor MP-101

2.フォトカプラ  電気的に独立した回路になるので、 安全性が高いが流せる電流がそんなに大きくない。(多分大丈夫かな、試していません。)

Page 18: Sony DSC-QX100 with Bescor MP-101

3.リレー  フォトカプラより耐電圧が高い物が準備できるし、4回路が入った基板が安価で入手できる。

Page 19: Sony DSC-QX100 with Bescor MP-101

で、1回路分の回路図  

Page 20: Sony DSC-QX100 with Bescor MP-101

リレーを使うのはいいが無線部分はどうするか? さっきのホームページのIRDAを使うか?でも結構、高い。(キットで5千円ほど)

 

Page 21: Sony DSC-QX100 with Bescor MP-101

そこで見つけたのがこれ Wireless remote control 4CH Multifunctional Relay Module & 2x 4 Button Car Remote Control Kit(1,500円以下)

 

Page 22: Sony DSC-QX100 with Bescor MP-101

どうも、車載用のようだ 微弱無線(315MHz/433MHz)を使っている。日本の電波法に抵触しているかは、不明。かなりグレー。

ただ、ケースも付いているので結線するだけでOK

 

Page 23: Sony DSC-QX100 with Bescor MP-101
Page 24: Sony DSC-QX100 with Bescor MP-101

デモ