Upload
shona-golden
View
218
Download
1
Tags:
Embed Size (px)
Citation preview
17
1
http://github.com/Tizen-SunfishYunji Kang, Jinwoo Ahn, Gyeonghwan
HongAdvanced System Software (Autumn
2014)
Extensible Hardware Framework for Tizen
17
2
• Limits in extension of mobile sensor & actuator
• Hard to use external sensor, actuators– High implementation cost, maintenance cost …
Motivation
?
17
3
• Connect blocks and make only logic code!• Function Abstraction: represented as blocks
– External Sensor, Actuator: Ultrasonic sensor, Motor …– The Functions of Tizen Platform: Notification center
• Connectivity, Hardware Control Abstraction– Bluetooth, Serial port control, I/O pin control, PWM, …
Extensible Hardware Framework
Ultrasonic Sensor
Data Filter LogicGet distance
Servo Motor
Post on
Rotate 15˚
Sensors Actuators
LogicsSMS
Receive Notification
Servo MotorRotate forever
KakaoTalk Receive Notification
17
4
• EHF-Node-RED: Design tool• Mindstorm Service: Interaction with Mindstorm
Design: Components
17
5
• Node-RED runs based on Node.js.• We ported Node.js on ODROID-U3
running Tizen.– Integration the process of building Node.js with
GBS– ARM compiler configurations
• Default target architecture• HW/SW FPU
• Now, Node.js can be built by GBS in the same way as building other Tizen packages.
Porting Node.js
17
6
• Visual Editor Tool based on Node.js– You can make a program with only connecting nodes
• New Nodes for Tizen/Mindstorm are added.
EHF-Node-RED
17
7
• Nodes can be specified as below manner.– Each node has its properties that can be tuned.
EHF-Node-RED: Nodes
17
8
• New node for Tizen– Notification node: fetches notifications of
applications from Tizen notification center.
• New nodes for Mindstorm– Motor node: controls the behavior of survo
motor.– Speaker node: makes a sound through
speaker.– Sonar node: listens the distance of detected
object– Color lamp node: makes color lights through
lamps in RGB sensor.
EHF-Node-RED: Nodes
17
9
• Bidirectional Interaction with Mindstorm– It uses Tizen Bluetooth API/Framework for interaction.– Fit to the format of Mindstorm direct command
• Listening commands through Mindstorm Service API– dbus: Inter-process communication between EHF-
Node-RED and Mindstorm Service
• Functions– Survo motors: moving– Speaker: playing a sound– Ultrasonic sensor: listening the distance of detected
object– Color lamp: emitting light in dedicated colors.
Mindstorm Service
17
10
• EHF-Node-RED ~ Notification Center– Shared file
• /usr/share/nodejs/ehf_notification.tail• Notification center writes notification events on the shared
file.• EHF-Node-RED listens file change event through tail tool.
• EHF-Node-RED ~ Mindstorm Service– dbus: EHF-Node-RED sends commands to
Mindstorm service through dbus.– Shared file
• /usr/share/nodejs/sonar.tail• Mindstorm service sends sonar sensor event to EHF-Node-
RED through shared file.
Interactions among Components
17
11
• Mindstorm Service ~ Mindstorm Controller– Mindstorm Direct Command Protocol
• Mindstorm controller receives commands and sends response to user device with following this protocol.
• It supports Bluetooth/RFCOMM protocol.
– Tizen Bluetooth API/Framework• It supports API functions of interactions in RFCOMM
protocol.• Mindstorm service uses Tizen Bluetooth API for
interacting with Mindstorm controller.
Interactions among Components
17
12
• Notification Center– Path: apps/home/notification– It delivers the notifications of applications to also EHF-
Node-RED.
• Bluetooth Framework– Path: framework/connectivity/bluetooth-frwk– A bug that commands cannot be delivered is occurred.
• Originally, Tizen Bluetooth Framework used g_strlcpy() function.
– We modified to use memcpy() function.
Modifications on Tizen Framework
0C 00 80 04 02 32 07 00 00 20 00 00 00 00Original:
0C 00 EC 2B 07 5C 17 23 03 01 00 50 78 9CSocket buffer:
g_strlcpy()
17
13github.com/Tizen-Sunfish
17
14
• Modifications on Tizen Frameworks– Notification Center (notification)– Bluetooth Framework (bluetooth-frwk)
• Node.js Port on Tizen (nodejs-tizen)• EHF-Node-RED (ehf-node-red)• Mindstorm Service (tizen-mindstorm)• Mindstorm Service API (mindstorm-
send)
github.com/Tizen-Sunfish
17
15
• Gyeonghwan Hong (RedCarrottt)– Porting Node.js, EHF-Node-RED– Customizing Tizen notification center
• Yunji Kang (sonyeo4ever)– Bluetooth communication thread– Ultrasonic Sensor, Playing sound file(Speaker)
• Jinwoo Ahn (ahnjinwoo)– Mindstorms Device API– Motor, RGB sensor(Color lamp), Beep
sensor(Speaker)– Design of Mindstorm hardware
Role Distributions
17
16
• New Method of Mobile Notification• Mindstorm notifies human of
notifications by moving its motors and making a sound.
Example: Notification
17
17
• This example can be simply implemented by drawing node graph as below.
Example: Notification