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/

LINE Developers

June 04, 2019
Tweet

More Decks by LINE Developers

Other Decks in Technology

Transcript

  1. A brief look at previous IoT solutions What you can

    do right now Something New ? LINE THINGS History Developer Trial ???
  2. LINE Messaging API IoT Use Case IoT device LINE server

    Device directly connects with a third party web Messaging API Your server
  3. 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
  4. 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
  5. 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
  6. HOW DOES LIFF BLE WORK ? LINE LIFF SDK (BLE

    plugin) BLE native component Device LIFF app
  7. 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
  8. 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
  9. 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
  10. 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
  11. Characteristic: Read Characteristic: Read Characteristic: Write Characteristic: Notify Characteristic: Read

    Characteristic: Write Characteristic: Notify BLUETOOTH STACK Service:LINE Things Trial Service:Custom1 Service:Custom2
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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}" }'
  18. { "id": {productId}, "name": "{trial product name}", "type": "BLE", "channelId":

    {channelId}, "actionUri": "{LIFF APP URL}", "serviceUuid": "{serviceUuid}", "psdiServiceUuid": "{psdiServiceUuid}", "psdiCharacteristicUuid": "{psdiCharacteristicUuid}" }
  19. 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
  20. LINE THINGS LINE LINE server LINE Things Device Messaging API

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

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

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

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

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

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

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

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