LINE Things: Its Value and How to Implement It

LINE Things: Its Value and How to Implement It

LINE Things implementation / LINE Thingsの実装について
高久裕央 / Hiroo Takaku
Product Manager of LINE Things

This is the deck of LINE Things for workshop and meet up in Taiwan held on 2019/05/30 and 2019/05/31.
https://linegroup.kktix.cc/events/20190531-linethings
This deck covers three things.
Firstly, LINE Things Overview.
Secondly, The value LINE Things provides for users and developers.
Finally, How LINE Things works & How to implement LINE Things, especially automatic communication.

The demonstration movies on this deck and related docs are the following.

◎LIFF BLE
https://engineering.linecorp.com/en/blog/line-things-developer-trial/

LIFF BLE - weight scale
https://www.youtube.com/watch?v=e4o0Q8MzYGk

LIFF BLE - thermography
https://www.youtube.com/watch?v=F1srmEmt8NM

LIFF BLE - e-ink
https://www.youtube.com/watch?v=aCFLXRaFisk

◎Automatic Communication
https://engineering.linecorp.com/ja/blog/line-things-automatic-communication/
Now we are translating this into English.

IoT Button
https://www.youtube.com/watch?v=oc0ASnvHfJg

53850955f15249a1a9dc49df6113e400?s=128

LINE Developers

May 30, 2019
Tweet

Transcript

  1. None
  2. Feel free to share on SNS!! #linethings

  3. LINE Things Overview The value LINE Things provides for users

    and developers How LINE Things works & How to implement LINE Things Agenda
  4. LINE Things Overview

  5. LINE Things LINE server LINE app Device

  6. communicate with various electronic devices control them control them without

    involvement of an end user LINE Things enable LINE app to
  7. LIFF BLE - weight scale

  8. Automatic Communication

  9. communicate with various electronic devices control them control them without

    involvement of an end user LINE Things enable LINE app to
  10. The value LINE Things provides for users and developers

  11. for LINE users to use IoT Services for developers to

    develop IoT Services LINE Things provides easy access
  12. For LINE users

  13. IoT products have some challenges

  14. Sharing IoT devices

  15. One-time use

  16. Everyone Is Using LINE!

  17. Creating something that feels natural and is easy to use

    Creating something that everyone has and is easy to share Creating something that anyone can use immediately The value LINE Things provide for users
  18. LIFF BLE - thermography

  19. LIFF BLE - e-ink

  20. Create completely new services

  21. For developers

  22. How LINE Things works & How to implement LINE Things

  23. LINE LINE Things Overview LINE server LINE app Device Your

    server Messaging API LIFF app LIFF BLE
  24. LINE What does developer need to develop ? LINE server

    LINE app Device Your server LIFF app Messaging API LIFF BLE
  25. LIFF BLE

  26. LINE app How LIFF BLE works LIFF app LIFF SDK

    (BLE plugin) BLE native component Device
  27. LIFF BLE 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();
  28. Data Access LINE app Device Read LINE app Device Write

    LINE app Device Notify
  29. Automatic Communication

  30. None
  31. LINE How Automatic Communication works LINE server LINE app Device

    Your server Messaging API (webhook) Deliver execution results Register a scenario set Fetch a scenario set Execute a scenario set
  32. LINE Register a scenario LINE app Device Messaging API (webhook)

    Deliver execution results Fetch a scenario set Execute a scenario set LINE server Your server Register a scenario set
  33. Scenario Triggerɿthe starting point for an action. • IMMEDIATE
 Perform

    an action as soon as the device connects to LINE • BLE_NOTIFICATION
 Perform an action when receiving a notification Actionɿthe contents to execute • GATT_READ : Read data • GATT_WRITE : Write data • SLEEP : Wait for a specified period of time
  34. Scenario Set • IMMEDIATE • Read data • Write data

    • BLE_NOTIFICATION • Read data • Write data • IMMEDIATE • Wait for 1 second • Write data
  35. Create or update a scenario set

  36. Trigger / Scenario (immediate) { "autoClose": true, "suppressionInterval": 3600000, "scenarios":

    [ { "trigger": { "type": "IMMEDIATE" }, "actions": [ { "type": “GATT_READ", "serviceUuid": "7B3D6B30-8F8C-4549-A4F5-66B1F435FA8F", "characteristicUuid": "90EC53BA-1DBE-4AE2-B762-7C1FEA00F380" },
  37. Action / Scenario (immediate) "actions": [ { "type": "GATT_READ", "serviceUuid":

    "7B3D6B30-8F8C-4549-A4F5-66B1F435FA8F", "characteristicUuid": "90EC53BA-1DBE-4AE2-B762-7C1FEA00F380" },{ "type": "SLEEP", "sleepMillis": 5000 },{ "type": "GATT_WRITE", "serviceUuid": "7B3D6B30-8F8C-4549-A4F5-66B1F435FA8F", "characteristicUuid":"5486C1A0-0EC2-4073-9C38-755D21EFE090", "data": "6AMAAA==" }
  38. Trigger + Action / Scenario (notification) { "autoClose": false, "suppressionInterval":

    0, "scenarios": [ { "trigger": { "type": "BLE_NOTIFICATION", "serviceUuid": "91E4E176-D0B9-464D-9FE4-52EE3E9F1552", "characteristicUuid": "62FBD229-6EDD-4D1A-B554-5C4E1BB29169" }, "actions": [ { ... },{... },{... } ] } ] }
  39. Scenario Set { "autoClose": false, "suppressionInterval": 0, "scenarios": [ {

    "trigger": { ... }, "actions": [ { ... },{... },{... } ] }, { "trigger": { ... }, "actions": [ { ... },{... },{... } ] } ] }
  40. Configure a single scenario set for each product ID Use

    Scenario management APIs to register a scenario set The scenario sets only fetch by the LINE app on specific occasions About a scenario set
  41. LINE Fetch a scenario set Device Your server Messaging API

    (webhook) Deliver execution results Register a scenario set Execute a scenario set LINE server LINE app Fetch a scenario set
  42. LINE Execute a scenario set LINE server Your server Messaging

    API (webhook) Deliver execution results Register a scenario set Fetch a scenario set LINE app Device Execute a scenario set
  43. LINE Deliver execution results Device Register a scenario set Fetch

    a scenario set Execute a scenario set LINE server LINE app Your server Messaging API (webhook) Deliver execution results
  44. scenario execution result Trigger • When receiving a notification with

    the specified GATT characteristic value Action • Read data
  45. Response "things": { "type": "scenarioResult", "deviceId": "tXXX", "result": { "scenarioId":

    "XXX", "revision": 2, "startTime": 1547817845950, "endTime": 1547817845952, "resultCode": "success", "bleNotificationPayload": "AQ==", "actionResults": [ { "type": "binary", "data": "/w=="
  46. None
  47. THANK YOU