Review Line Things Hands-On Workshop#2 @ True Digital Park 18072019

Dr. Warodom Khamphanchai
AltoTech
Published in
5 min readJul 18, 2019

สวัสดีครับ blog นี้ผมจะมาเล่าเกี่ยวกับ hands-on workshop training โดย Line Developer Thailand

สำหรับนักพัฒนาที่ได้รับการคัดเลือกจะมีข้อความยืนยันส่งมาทาง Line Developer TH
บรรยากาศ​การเรียนใน ​Line
Node 32 Lite IoT Starter Kit — Compatible with Line Things

ก่อนอื่นให้เข้าไปที่ developer.line.biz

Agenda

  1. Line Things
  2. Hands on
  3. Hands-on athon

Introduction to Line Things

Step1: developer.line.biz

Step2: create new provider
what is provider: provider คือ superset ของทุก service บน line (1 provider มีได้สูงสุด 100 channels)

Step3: create a channel

Step4: clone https://lin.ee/dPadZoG

Step5: Open code in VSCode

Step6: Signup for Github pages

create new repo and named it things

go to project page -> upload existing files focus only 3 files iin folder

on project page go to settings -> at Github Pages -> change from none to master branch

Step7 : go to site https://yourusername.github.io/things/

Step8: go to developer.line.biz -> choose chatbot that we will use today
- create Liff ถ้า Full 100%, Tall 75%

ON เพื่อเป็นการเปิด feature ของ Line Things ให้เราสามารถใช้ Bluetooth ได้

Step9: เอา Line Liff มาวาง แล้วกดจาก Line mobile, Liff มันจะเด้งขึ้นมา

Step10: ไปที่ github.com/line/line-things-starter

ไป focus ที่ liff-app

Step11: เอา file ไปแทนใน github/yourusername/things

อย่าลืมเปิด bluetooth and location

ถ้าเห็นหน้าด้านขวามือก็น่าจะ ok

Step12: register your product

ถ้าได้แล้วจะได้ return แบบนี้

{“id”:”6557519172113124802",”name”:”armthings2",”type”:”BLE”,”channelId”:1600201357,”actionUri”:”line://app/1600201357–2pa16RDl”,”serviceUuid”:”d6e89d90–3a45–45ac-bcc8–6886d1070830",”psdiServiceUuid”:”e625601e-9e55–4597-a598–76018a0d293d”,”psdiCharacteristicUuid”:”26e2b12b-85f0–4f3f-9fdd-91d114270e6e”}

หลักๆ ที่ต้องใช้คือ ‘serviceUuid’

Step13:change line 2 in liff.js -> user_service_uuid

change line 2
สำหรับคนที่สนใจเกี่ยวกับ BLE เข้าไปดูเพิ่มเติมได้ที่ https://developer.android.com/guide/topics/connectivity/bluetooth-le

Step14: Download arduino ide (https://www.arduino.cc/en/Main/Donate)

คนที่ใช้ Windows 7 ต้องติดตั้ง driver เพิ่ม

then open arduino app

need to install esp32 by Expressif

then go to tools>board> board manager >

Step15:select board node32s

Step16: try to upload code to node32s

Step17: open sample file get code

Step18: upload to esp32

Step19: ต่อบอร์ดตามรูป

Step20: ลองทดสอบดู

ตัวอย่างการทำงาน 1: Turn LED ON/OFF
ตัวอย่างการเข้าไปใช้งานใน Line App
ตัวอย่างการเข้าไปใช้งาน Line Things Button

Step21:ทำความเข้าใจ code

Step22: advanced tutorial https://github.com/things-workshop/flappy-workshop

step23: เฉลยไปดูใน https://github.com/things-workshop/flappy.git

เอา flappy ไปที่ things
ที่ game.js แก้ user service uuid

Step23:ทีนี้ลองมาต่อกับ ​Line board ดู

สามารถเข้าไปดูข้อมูลเพิ่มเติมจาก Line Things ได้ที่ https://developers.line.biz/en/docs/line-things/about-line-things/

หรืออ่านบทความจาก Technical Consultant ของ Line ได้ที่ https://medium.com/linedevth/introduction-to-line-things-6e8598faa641

--

--

Dr. Warodom Khamphanchai
AltoTech

Full Stack Developer, Hardware Hacker, Ex-Software Developer in Silicon Valley, Interested in IoT, Machine Learning, AI, and Technology Entrepreneurship