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

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

LINE Developers

May 30, 2019
Tweet

More Decks by LINE Developers

Other Decks in Technology

Transcript

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

    and developers How LINE Things works & How to implement LINE Things Agenda
  2. communicate with various electronic devices control them control them without

    involvement of an end user LINE Things enable LINE app to
  3. communicate with various electronic devices control them control them without

    involvement of an end user LINE Things enable LINE app to
  4. for LINE users to use IoT Services for developers to

    develop IoT Services LINE Things provides easy access
  5. 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
  6. LINE LINE Things Overview LINE server LINE app Device Your

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

    LINE app Device Your server LIFF app Messaging API LIFF BLE
  8. LINE app How LIFF BLE works LIFF app LIFF SDK

    (BLE plugin) BLE native component Device
  9. 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();
  10. 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
  11. 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
  12. 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
  13. Scenario Set • IMMEDIATE • Read data • Write data

    • BLE_NOTIFICATION • Read data • Write data • IMMEDIATE • Wait for 1 second • Write data
  14. 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" },
  15. 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==" }
  16. 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": [ { ... },{... },{... } ] } ] }
  17. Scenario Set { "autoClose": false, "suppressionInterval": 0, "scenarios": [ {

    "trigger": { ... }, "actions": [ { ... },{... },{... } ] }, { "trigger": { ... }, "actions": [ { ... },{... },{... } ] } ] }
  18. 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
  19. 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
  20. 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
  21. 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
  22. scenario execution result Trigger • When receiving a notification with

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

    "XXX", "revision": 2, "startTime": 1547817845950, "endTime": 1547817845952, "resultCode": "success", "bleNotificationPayload": "AQ==", "actionResults": [ { "type": "binary", "data": "/w=="