Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
LINE Things - Connecting the Unconnectable
LINE Developers
PRO
June 04, 2019
Technology
0
130
LINE Things - Connecting the Unconnectable
LINE Thailand Developer Conference 2019
https://www.facebook.com/events/410021356453349/
LINE Developers
PRO
June 04, 2019
Tweet
Share
More Decks by LINE Developers
See All by LINE Developers
SONiCをLINEのClosネットワークに導入した話 / A story to adopt SONiC in LINE’s Clos Network
line_developers
PRO
1
57
ML PM, DS PMってどんな仕事をしているの?
line_developers
PRO
1
210
LINE iOSエンジニアの日々 / LINE iOS Engineer Days
line_developers
PRO
1
130
“Do you have a virtual router?” Discuss how to use virtual routers
line_developers
PRO
0
490
LINEにおけるネットワーク自動化チーム / Network Automation Team in LINE
line_developers
PRO
0
250
ひとりで書ける! 日英文章作成のコツ / Do-it-yourself! - Tips for writing in Japanese-English
line_developers
PRO
1
410
UIT Survey 2022
line_developers
PRO
0
120
LINE’s Journey; Road to 4 Million Cores in the Private Cloud
line_developers
PRO
0
78
Investigating Kafka performance issue caused by lock contention in xfs
line_developers
PRO
0
240
Other Decks in Technology
See All in Technology
OpenShiftでスポットVMを使おう.pdf
jpishikawa
1
190
立ち止まっても、寄り道しても / even if I stop, even if I take a detour
katoaz
0
150
S3とCloudWatch Logsの見直しから始めるコスト削減 / Cost saving S3 and CloudWatch Logs
shonansurvivors
0
110
2023年は何する宣言
shigeruoda
0
240
創業1年目のスタートアップでAWSコストを抑えるために取り組んでいること / How to Keep AWS Costs Down at a Startup
yuj1osm
3
1.8k
Dev Containers ことはじめ - 失敗から学ぶ開発環境運用法
streamwest1629
0
290
NGINXENG JP#2 - 3-NGINX Plus・プロダクトのアップデート
hiropo20
0
170
データベースの発表には RDBMS 以外もありますよ
maroon1st
0
230
API連携に伴う規制と対応 / Regulations and responses to API linkage
moneyforward
0
110
データ分析基盤の要件分析の話(202201_JEDAI)
yabooun
0
170
目指せCoverage100%! AutoScale環境におけるSavings Plans購入戦略 / JAWS-UG_SRE_Coverage
taishin
0
340
日本ディープラーニング協会主催 NeurIPS 2022 技術報告会講演資料
tdailab
0
980
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
6
4.5k
Side Projects
sachag
451
37k
We Have a Design System, Now What?
morganepeng
37
5.9k
The Brand Is Dead. Long Live the Brand.
mthomps
48
2.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
56
2.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
24
4.5k
Design by the Numbers
sachag
271
18k
Atom: Resistance is Futile
akmur
256
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
Become a Pro
speakerdeck
PRO
6
3.2k
The Invisible Customer
myddelton
113
12k
A Philosophy of Restraint
colly
193
15k
Transcript
UKRIT PONGSATHAPORN Lead Hardware Engineer LINE THAILAND LINE THINGS CONNECTING
THE UNCONNECTABLE
A brief look at previous IoT solutions What you can
do right now Something New ? LINE THINGS History Developer Trial ???
HISTORY
Messaging API
LINE Messaging API IoT Use Case IoT device LINE server
Device directly connects with a third party web Messaging API Your server
LINE BEACON
LINE Beacon LINE LINE server Your server LINE BEACON Messaging
API
FEATURES Relative location of the user to the beacon Segment
and specify only users that are near your designated area Provide a more relevant and useful service Location Segmentation Relation
GOING FURTHER Two-way communication Data can be sent and received
Support for almost all BLE devices Seamless integration for users. Out of sight, out of mind. Bi-directional Full Support Seamless
A universal platform for IoT devices
None
WHAT IS LINE THINGS ? A n I o T
p l atfo r m w i t h i n L I N E ’s ecosystem, open to everyone A bridge to connect users, devices, and services Universal hub for your IoT devices and online services Open IoT Platform Bridge to Connect Universal Hub
LINE THINGS LINE LINE server Device Messaging API LIFF BLE
Your server LIFF app
CONNECTION PROCESS Device Scanning Connect Advertising
DEVICE LINK LIFF BLE
HOW DOES LIFF BLE WORK ? LINE LIFF SDK (BLE
plugin) BLE native component Device LIFF app
function initializeApp() { liff.init(() => initializeLiff(), error => uiStatusError(makeErrorMsg(error), false));
} function initializeLiff() { liff.initPlugins(['bluetooth']).then(() => { liffCheckAvailabilityAndDo(() => liffRequestDevice()); }).catch(error => { uiStatusError(makeErrorMsg(error), false); }) } IMPLEMENTATION
function initializeApp() { liff.init(() => initializeLiff(), error => uiStatusError(makeErrorMsg(error), false));
} function initializeLiff() { liff.initPlugins(['bluetooth']).then(() => { liffCheckAvailabilityAndDo(() => liffRequestDevice()); }).catch(error => { uiStatusError(makeErrorMsg(error), false); }) } IMPLEMENTATION
const device = await liff.bluetooth.requestDevice(); const gatt = await device.gatt.connect();
const service = await gatt.getPrimaryService( 'E625601E-9E55-4597-A598-76018A0D293D' ); const characteristic = await service.getCharacteristic( '26E2B12B-85F0-4F3F-9FDD-91D114270E6E' ); characteristic.addEventListener('characteristicvaluechanged', (e) => { console.log('value changed to:' + e.target.value); }); await characteristic.startNotifications(); IMPLEMENTATION
const device = await liff.bluetooth.requestDevice(); const gatt = await device.gatt.connect();
const service = await gatt.getPrimaryService( 'E625601E-9E55-4597-A598-76018A0D293D' ); const characteristic = await service.getCharacteristic( '26E2B12B-85F0-4F3F-9FDD-91D114270E6E' ); const value = await characteristic.readValue(); CONNECTION PROCESS
Characteristic: Read Characteristic: Read Characteristic: Write Characteristic: Notify Characteristic: Read
Characteristic: Write Characteristic: Notify BLUETOOTH STACK Service:LINE Things Trial Service:Custom1 Service:Custom2
const device = await liff.bluetooth.requestDevice(); const gatt = await device.gatt.connect();
const service = await gatt.getPrimaryService( 'E625601E-9E55-4597-A598-76018A0D293D' ); const characteristic = await service.getCharacteristic( '26E2B12B-85F0-4F3F-9FDD-91D114270E6E' ); const value = await characteristic.readValue(); DATA ACCESS
Device Read Device Write Device Notify DATA ACCESS LINE app
LINE app LINE app
const device = await liff.bluetooth.requestDevice(); const gatt = await device.gatt.connect();
const service = await gatt.getPrimaryService( 'E625601E-9E55-4597-A598-76018A0D293D' ); const characteristic = await service.getCharacteristic( '26E2B12B-85F0-4F3F-9FDD-91D114270E6E' ); const value = await characteristic.readValue(); READ
const device = await liff.bluetooth.requestDevice(); const gatt = await device.gatt.connect();
const service = await gatt.getPrimaryService( 'E625601E-9E55-4597-A598-76018A0D293D' ); const characteristic = await service.getCharacteristic( '26E2B12B-85F0-4F3F-9FDD-91D114270E6E' ); await characteristic.writeValue( new TextEncoder('utf-8').encode('LIFF BLE') ) WRITE
const device = await liff.bluetooth.requestDevice(); const gatt = await device.gatt.connect();
const service = await gatt.getPrimaryService( 'E625601E-9E55-4597-A598-76018A0D293D' ); const characteristic = await service.getCharacteristic( '26E2B12B-85F0-4F3F-9FDD-91D114270E6E' ); characteristic.addEventListener('characteristicvaluechanged', (e) => { console.log('value changed to:' + e.target.value); }); await characteristic.startNotifications(); NOTIFY
LINE THINGS DEVELOPER TRIAL
REQUIREMENTS Create a LINE Things-compatible device Add LIFF app to
your channel Create a Channel Create a LIFF app for LINE Things Create a Provider Register a Product 1 2 3 4 5 6
REGISTER YOUR PRODUCT curl -X POST https://api.line.me/things/v1/trial/products \ -H 'Authorization:
Bearer {channel access token}' \ -H 'Content-Type:application/json' \ -d '{ "name": "{trial product name}", "liffId": "{LIFF APP ID}" }'
{ "id": {productId}, "name": "{trial product name}", "type": "BLE", "channelId":
{channelId}, "actionUri": "{LIFF APP URL}", "serviceUuid": "{serviceUuid}", "psdiServiceUuid": "{psdiServiceUuid}", "psdiCharacteristicUuid": "{psdiCharacteristicUuid}" }
LINE THINGS STARTER DEMONSTRATION
AUTOMATIC COMMUNICATION ???
Seamless experience of LINE Things, does not require user interaction
Devices with great services all connected through LINE Setting up is as easy as 1-2-3 Seamless Intuitive Super Simple FEATURES
LINE THINGS LINE LINE server LINE Things Device Messaging API
Returns execution results Your server Executes a scenario set
REGISTERING A SCENARIO SET { "autoClose": false, "suppressionInterval": 0, "scenarios":
[ { "trigger": { "type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] }
{ "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {
"type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
{ "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {
"type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
{ "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {
"type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
{ "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {
"type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
{ "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {
"type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
{ "events": [ { "type": "things", "replyToken": "7219516709304f028ddf1540d6953518", "source": {
"userId": "u11111111111111111111111111111111", "type": "user" }, "timestamp": 1558610209312, "things": { "deviceId": "t016ae2ae6b5d3fabed4cd0700cf16612", "result": { "scenarioId": "01DBG55W4AQX75G66X83QX46ZY", "revision": 2, "startTime": 1558610206362, Webhook Event
AUTOMATIC COMMUNICATION DEMONSTRATION
HANDS-ON-ATHON LINE THAILAND LINE Developers Thailand ONE MORE THING...
THANK_YOU