Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LINE Things - Connecting the Unconnectable

LINE Things - Connecting the Unconnectable

LINE Thailand Developer Conference 2019
https://www.facebook.com/events/410021356453349/

53850955f15249a1a9dc49df6113e400?s=128

LINE Developers
PRO

June 04, 2019
Tweet

Transcript

  1. UKRIT PONGSATHAPORN Lead Hardware Engineer LINE THAILAND LINE THINGS CONNECTING

    THE UNCONNECTABLE
  2. A brief look at previous IoT solutions What you can

    do right now Something New ? LINE THINGS History Developer Trial ???
  3. HISTORY

  4. Messaging API

  5. LINE Messaging API IoT Use Case IoT device LINE server

    Device directly connects with a third party web Messaging API Your server
  6. LINE BEACON

  7. LINE Beacon LINE LINE server Your server LINE BEACON Messaging

    API
  8. 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
  9. 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
  10. A universal platform for IoT devices

  11. None
  12. 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
  13. LINE THINGS LINE LINE server Device Messaging API LIFF BLE

    Your server LIFF app
  14. CONNECTION PROCESS Device Scanning Connect Advertising

  15. DEVICE LINK LIFF BLE

  16. HOW DOES LIFF BLE WORK ? LINE LIFF SDK (BLE

    plugin) BLE native component Device LIFF app
  17. 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
  18. 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
  19. 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
  20. 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
  21. Characteristic: Read Characteristic: Read Characteristic: Write Characteristic: Notify Characteristic: Read

    Characteristic: Write Characteristic: Notify BLUETOOTH STACK Service:LINE Things Trial Service:Custom1 Service:Custom2
  22. 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
  23. Device Read Device Write Device Notify DATA ACCESS LINE app

    LINE app LINE app
  24. 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
  25. 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
  26. 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
  27. LINE THINGS DEVELOPER TRIAL

  28. 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
  29. 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}" }'
  30. { "id": {productId}, "name": "{trial product name}", "type": "BLE", "channelId":

    {channelId}, "actionUri": "{LIFF APP URL}", "serviceUuid": "{serviceUuid}", "psdiServiceUuid": "{psdiServiceUuid}", "psdiCharacteristicUuid": "{psdiCharacteristicUuid}" }
  31. LINE THINGS STARTER DEMONSTRATION

  32. AUTOMATIC COMMUNICATION ???

  33. 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
  34. LINE THINGS LINE LINE server LINE Things Device Messaging API

    Returns execution results Your server Executes a scenario set
  35. REGISTERING A SCENARIO SET { "autoClose": false, "suppressionInterval": 0, "scenarios":

    [ { "trigger": { "type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] }
  36. { "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {

    "type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
  37. { "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {

    "type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
  38. { "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {

    "type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
  39. { "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {

    "type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
  40. { "autoClose": false, "suppressionInterval": 0, "scenarios": [ { "trigger": {

    "type": "BLE_NOTIFICATION", "serviceUuid": "<YOUR SERVICE UUID>", "characteristicUuid": "62FBD229-6EDD-4D1A-B554- 5C4E1BB29169" }, "actions": [] } ] } SCENARIO SET
  41. { "events": [ { "type": "things", "replyToken": "7219516709304f028ddf1540d6953518", "source": {

    "userId": "u11111111111111111111111111111111", "type": "user" }, "timestamp": 1558610209312, "things": { "deviceId": "t016ae2ae6b5d3fabed4cd0700cf16612", "result": { "scenarioId": "01DBG55W4AQX75G66X83QX46ZY", "revision": 2, "startTime": 1558610206362, Webhook Event
  42. AUTOMATIC COMMUNICATION DEMONSTRATION

  43. HANDS-ON-ATHON LINE THAILAND LINE Developers Thailand ONE MORE THING...

  44. THANK_YOU