Kadecot: Android Web API Server for Home Appliances and Sensors - - PowerPoint PPT Presentation

kadecot android web api server for
SMART_READER_LITE
LIVE PREVIEW

Kadecot: Android Web API Server for Home Appliances and Sensors - - PowerPoint PPT Presentation

Kadecot: Android Web API Server for Home Appliances and Sensors Shigeru Owada, Sony Computer Science Labs, Inc. Kazuhito Nakamura, Sony corp. Masahiro Karaki, Crestec Inc. Confidential need to know basis only / do not distribute Talk


slide-1
SLIDE 1

Confidential – need to know basis only / do not distribute

Kadecot: Android Web API Server for Home Appliances and Sensors

Shigeru Owada, Sony Computer Science Labs, Inc. Kazuhito Nakamura, Sony corp. Masahiro Karaki, Crestec Inc.

slide-2
SLIDE 2

Confidential – need to know basis only / do not distribute

  • We develop a Web API server ‘Kadecot’ runs
  • n Android for home appliances/sensors
  • It internally adopts WAMP-based framework

for managing the whole system.

  • We develop a 3D agent-based user interface
  • n top of them.

Talk Summary

slide-3
SLIDE 3

Confidential – need to know basis only / do not distribute

WAMP is an open WebSocket subprotocol that provides two application messaging patterns in one unified protocol : Remote Procedure Calls + Publish & Subscribe.

  • Actually, WAMP does not require using WebSocket.

Other transports are possible if some requirements are met.

– We use both WebSocket connection and function call as the transport

WAMP : The Web Application Messaging Protocol

Copied from WAMP HP http://wamp.ws/

slide-4
SLIDE 4

Confidential – need to know basis only / do not distribute

System architecture

Android OS Protocols manager WAMP API Web API Users Applications

Server

Home Appliances and Sensors

slide-5
SLIDE 5

Confidential – need to know basis only / do not distribute

System architecture

Android OS Protocols manager WAMP API Web API Users Applications

Server

Home Appliances and Sensors

slide-6
SLIDE 6

Confidential – need to know basis only / do not distribute

  • Device communication protocol independent
  • Flexible, Easy-to-use WebAPI
  • Use public messaging protocol

Goal of Server Design

slide-7
SLIDE 7

Confidential – need to know basis only / do not distribute

  • Resource : a piece of information or a controlled

property in a device

– Eg. Power, Temperature setting, Brightness sensor value

Definition

slide-8
SLIDE 8

Confidential – need to know basis only / do not distribute

WAMP messaging petterns

RPC pattern

  • Active resource request

from consumer (‘Caller’ in WAMP terminology) to provider (Callee)

PubSub pattern

  • Asynchronous resource

delivery from provider (Publisher) to consumer (Subscriber)

Caller Callee

Call Reply

Subscriber Publisher

Subscribe in advance Asynchronus Notifications (Publication)

slide-9
SLIDE 9

Confidential – need to know basis only / do not distribute

  • WAMP is NOT a one-to-one messaging architecture
  • There is another entity, called a ‘Router’, deals with

message deliveries.

  • All other entities are called ‘Client’
  • ‘Caller’, ‘Callee’, ‘Publisher’, ‘Subscriber’ are compatible

Roles of each client.

– They switch roles on types of messages

WAMP in-depth

Router

Client #1

Role: Caller&Subscriber

Client #2

Role: Caller & Publisher

Client #3

Role: Caller&Callee

Client #4

Role: Publisher

slide-10
SLIDE 10

Confidential – need to know basis only / do not distribute

Our Home Server Architecture

Router

Web App #1

Caller&Subscriber

Protocol #1 (ECHONET Lite)

Callee&Publisher&Subscriber

Protocol #2 (Sony protocol)

Callee&Publisher&Subscriber

Web App #2

Caller&Subscriber

Web App #3

Protocol #3

White Goods / Sensors Black Goods

Polling Manager

Publisher

Device Manager

Callee

DB

: WebSocket : Function Call

slide-11
SLIDE 11

Confidential – need to know basis only / do not distribute

Router

Web App #1

Caller&Subscriber

Protocol #1 (ECHONET Lite)

Callee&Publisher&Subscriber

Protocol #2 (Sony protocol)

Callee&Publisher&Subscriber

Web App #2

Caller&Subscriber

Web App #3

Protocol #3

Polling Manager

Publisher

Device Manager

Callee

DB

Our Home Server Architecture

White Goods / Sensors Black Goods

slide-12
SLIDE 12

Confidential – need to know basis only / do not distribute

  • Receives devices list information from protocols

and assigns unique ID to each device

  • Keeps all recognized devices list and their

available resources as a cache

– Provides fast replies on..

  • Devices ability query from the apps
  • Information recovery on reboot

Device Manager

slide-13
SLIDE 13

Confidential – need to know basis only / do not distribute

Our Home Server Architecture

White Goods / Sensors Black Goods

Router

Web App #1

Caller&Subscriber

Protocol #1 (ECHONET Lite)

Callee&Publisher&Subscriber

Protocol #2 (Sony protocol)

Callee&Publisher&Subscriber

Web App #2

Caller&Subscriber

Web App #3

Protocol #3

Polling Manager

Publisher

Device Manager

Callee

DB

slide-14
SLIDE 14

Confidential – need to know basis only / do not distribute

  • Polling is necessary to let

passive sensors act as a publisher

  • However, in IoT

environment, it is not desirable to poll all available resources

  • Even if a resource is

subscribed by multiple apps, the polling should not be multiplied.

Polling requirement

App 1 App 2 App 3 Polling Manager Multiple Requests from Apps Single, management polling access

slide-15
SLIDE 15

Confidential – need to know basis only / do not distribute

Router

  • Our solution

– Polling manager publishes the counter how many apps are interested in each resource. – Each protocol subscribes the related counter to determine which resource value should be polled. – Polling interval is internally determined within protocol client.

  • This violates WAMP framework, since information about

subscription exists in the router (router cannot be a callee nor a publisher)

Polling Manager

Protocol Protocol Polling Manager

Reference Counter

Subscribe Subscribe Publish Non-WAMP message passing about subscribers Subscriber DB

slide-16
SLIDE 16

Confidential – need to know basis only / do not distribute

Router

Web App #1

Caller&Subscriber

Protocol #1 (ECHONET Lite)

Callee&Publisher&Subscriber

Protocol #2 (Sony protocol)

Callee&Publisher&Subscriber

Web App #2

Caller&Subscriber

Web App #3

Protocol #3

Polling Manager

Publisher

Device Manager

Callee

DB

Our Home Server Architecture

White Goods / Sensors Black Goods WebAPI

slide-17
SLIDE 17

Confidential – need to know basis only / do not distribute

  • Web (and other) application participate in the system

through standard WAMP protocol

– Such as ‘HELLO’, ‘SUBSCRIBE’, etc..

  • Tips:

– Resource types are represented as topics/procedures string – Device ID (, assigned by Device Manager client,) is specified as ‘Options’ field in WAMP Eg)

[CALL,1,{“deviceID”:1},”com.sonycsl.kadecot.provider.procedure.getDeviceList”]

, in the format of RPC messsaging : [CALL, Request|id, Options|dict, Procedure|uri]

WebAPI

slide-18
SLIDE 18

Confidential – need to know basis only / do not distribute

Router

Web App #1

Caller&Subscriber

Protocol #1 (ECHONET Lite)

Callee&Publisher&Subscriber

Protocol #2 (Sony protocol)

Callee&Publisher&Subscriber

Web App #2

Caller&Subscriber

Web App #3

Protocol #3

Polling Manager

Publisher

Device Manager

Callee

DB

Our Home Server Architecture

White Goods / Sensors Black Goods

slide-19
SLIDE 19

Confidential – need to know basis only / do not distribute

APPLICATION

slide-20
SLIDE 20

Confidential – need to know basis only / do not distribute

  • We are currently running

the “Moekaden” project which tries to combine IoT service and personification / concierge characters

Moekaden Project

Personified Blu-ray recorder acts as a concierge

slide-21
SLIDE 21

Confidential – need to know basis only / do not distribute

Demos

RPC demo

  • The remote controller

function uses RPC messaging

PubSub Demo

  • Error notification is subscribed

by the application. If an error is notified, related manuals are shown

slide-22
SLIDE 22

Confidential – need to know basis only / do not distribute

  • We develop a home WebAPI server with WAMP
  • Efficient polling requires non-WAMP message sharing

between router and polling manager

  • We run Moekaden
  • Announcements

– Moekaden HP (http://moekaden.com) is currently under maintenance, will be open on July 5th – New version of Moekaden will be released on September. – Pure Java implementation of WAMP (not available on WAMP HP) will be soon released by us

Conclusion