skku embedded software lab. 13 1 remote sensor byunghei jun dongsu kim dongig sin

13
SKKU Embedded Software Lab. 13 1 https://github.com/sensor- virtualization Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

Upload: chester-bates

Post on 21-Dec-2015

219 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

1

https://github.com/sensor-virtualization

Remote Sensor

Byunghei Jun Dongsu KimDongig Sin

Page 2: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

2Motivation

• Tizen software supports the environment to use many sensor

devices

• Odroid-u3 doesn’t have actual sensor hardware devices→ We need to make an alternative way to support it

Page 3: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

3Project Goal

• Implement remote-sensors by using sensors on mobile phone

• User-application doesn’t care about the remote-sensors

– Framework supports all of the function for the remote-sensor

Page 4: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

4

• Polling Based Architecture (Tizen 2.2)

Server (get sensor data from plugin) - Create worker thread for a client - Command handler: decode received command - Data stream layer: determine sensor plugin - Common plugin layer: implement for all the common functionality for the various sensor plugins

SensorManager (Sensor API)

- Add and remove sensor listeners - Check available sensors - Get and set sensor information - Get sensor data

Plugin - get raw sensor data - filtering the data

Tizen Sensor Architecture

# Improved Event Driven Architecture for Tizen Sensor Framework, MOBILESoft’14, June 2–3, 2014, Hyderabad, India

Page 5: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

5Implement

• Add new plugin with using existing sensor type

Remote GYRO

Remote Driver

(Bluetooth)

If some sensor device doesn’t exist

Page 6: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

6Remote-sensor Overall

Modified Module

① Android Bluetooth Sender App

② Bluetooth Receiver

③ Virtual Sensor device

④ Sensor Plugin

⑤ Tizen Test App

Tizen Odroid U3Tizen Odroid U3

Bluetooth

Receiver Service

Virtual Sensor Device Daemon(/dev/virtual_sensor)

Sensor Framework

Sensor App

Sensor Plugin

(sensor,processor)

Sensor Plugin

(sensor,processor)BluetoothSender App

② ③

Kernel

Page 7: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

7Android Application

• Send the sensor data to Odroid-U3 through Bluetooth

Bluetooth connection part

Current sensor data (GYRO)Start to send

e.g., “-0.445320 -0.17623 0.319171”

√ Send a string including all of the data

# https://github.com/sensor-virtualization/remote-sensor-android-client

Page 8: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

8

• Bluetooth data receiver

– Manage Bluetooth connection and data communication

→ Write the data received to virtual sensor device

# https://github.com/sensor-virtualization/remote-sensor-framework-service

• Virtual Sensor Device

– Device daemon; managing read/write of sensor data

– Write the data received from Bluetooth Data Receiver

– The data is read by Sensor Plugin

→ Implement the part of adding device and callback function on Linux

Module Program

# https://github.com/sensor-virtualization/virtual_sensordev

Sensor Data Receiving

Page 9: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

9

• Components of plugin

– Sensor plugin : read data from Sensor Device

– Processor Plugin : Interface with Sensor Framework

– Filter plugin : convert raw data

• The data received is already converted, so we don’t care this part

• Implement Remote-GYRO plugin

– The source code of existing sensors plugin is NOT provided (Only

“.so” file)

– Refer the plugin source code of emulator

• Path : platform/sdk/emulator-plugin-gyro-pkgs

– Pass the transmitted data to sensor framework

• Path : /dev/virtual-sensor

# https://github.com/sensor-virtualization/remote-gyro-plugin-pkgs

Sensor Framework Plugin

Page 10: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

10

• sf_sensor.conf

– /usr/etc/sf_sensor.conf

– Set sensor id, polling_interval, plugin file path, etc

– Change plugin file path to make the new plugin

available

Sensor Plugin Configuration

Page 11: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

11Tizen User Application

• Use existing API (SensorManager)

Page 12: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

12Github

# https://github.com/sensor-virtualization

Remote-plugin(GYRO)

Tizen Testing ApplicationVirtual Sensor device

Bluetooth Receiver

Android Bluetooth Sender

Page 13: SKKU Embedded Software Lab. 13 1  Remote Sensor Byunghei Jun Dongsu Kim Dongig Sin

SKKU Embedded Software Lab.

13

13

Demo

Demo

http://www.youtube.com/watch?v=vya2PEhQoHU&feature=youtu.be