본문 바로가기
정보공유

[정보] Beacon BLE

by 날고싶은커피향 2015. 4. 8.

날고싶은 커피향


Beacon BLE 관련 자료 입니다. 

정리가 잘 되어 있는 자료라서 참고해보시면 좋을 것 같습니다. 


일단 국내에서 현재 많이 도입하고 있는 것 같습니다.






Transcript

1. Beacon + BLE leejunwoo@gmail.com

2. Trends * Apple에서 iBeacon 발표 이후에 관심 집중 - iOS nativ로 지원함으로 많은 가능성 제시 - Apple Store, MLB 등 사례 제시 - Estimote 등에서 iBeacon 지원 비콘 공급 * 2014년 상반기부터 국내에서도 많은 관심 - SKT에서 자사의 비콘과 LBS 서비스 사업화 - 스타트업을 중심으로 비콘을 활용하는 다양한 시도 - O2O 트렌드와 함께 많은 가능성 제시 * 그러나, 체감할 수 있는 서비스는 보이지 않음 - SKPSyrup 서비스 정도가 가시화 - 스타트업의 많은 시도 또한 결과가 보이지 않음 그 많던 싱아는 누가 다 먹었을까 ?

3. Game Change 스마트폰(mobility)과 위치와 결합 SKP Syrup 서비스 Apple’s retail store: 250+ US Airport Premium Service Starwood hotel Nivea’s StickNFind App GeoFence + Push Notification ! Without user intervention Facebook ‘Place Tips’ Enrich POI based on social relation

4. Trends 점점 더 일상의 자연스러움으로 진화

5. How to ? 비콘을 활용하는 전형적인 프로세스 Beacon은 식별 정보를 Broadcasting(Advertisement)으로 전달 (정보를 수신하였는지 여부는 확인할 수 없음) 비콘의 정보와 사용자 정보를 조합 사용자화된 유의미한 정보 전달 (Push]

6. About iBeacon * ‘비콘(beacon)’ 자체는 식별 정보를 주기적으로 발산하는 의미 - 애플의 iBeacon 발표 이전에도 통신 분야에서 사용되는 개념 * ‘iBeacon’ Apple WWDC 2013 - iOS7의 새로운 기능으로 발표 - Bluetooth 4.0 표준에 포함되어 있는 BLE(Bluetooth Low Energy) 활용 - Bluetooth 4.0 = Bluetooth Classic + Bluetooth Smart(BLE) BLE를 이용한 애플의 자체 규격

7. Bluetooth 4.0 * Bluetooth Classic - Wireless devices, streaming rich content like video and audio - 충분한 데이터를 전달할 수 있는 통신 방식 * Bluetooth Smart - Sensor devices, sending small bits of data - BLE를 이용하여 저전력으로 짧은 데이터를 전달하는 규격 * Bluetooth Smart Ready - Devices that connect with both 저전력을 소모하는 규격을 포함하는 특징

8. Bluetooth 4.0 고속 전송과 저전력 소모로 구분

9. Bluetooth 4.0 고속 전송과 저전력으로 구분 * More info: http://developer.bluetooth.org

10. About BLE * 저전력 > 데이터 레이트 - 전력 소모량을 줄여 배터리로도 장시간 동작이 가능 - 소형화, 유연성과 편리함을 제공 - 경쟁 기술: ANT(ANT+), Zigbee, NFC * 소비 전력 계산 - avg. ~ 100 µAh per day up to 4 year from a coin cell battery - BLE Power consumption = 49µA(20 bytes payload) x 3V = 0.147mW - Coin Cell Battery(CR2032, 225mAh) = 225mAh / 49µA = 191 days 배터리로 동작이 가능한 저전력 규격 Estimote, CR2450(3V, 620mAh)

11. About BLE 구조의 단순화로 비용 또한 감소 * 저비용의 디바이스 개발이 가능 Component Quantity Cost ($) Battery 1 0.325 Antenna 1 0 (Printed Antenna) EEPROM 1 0.89 Decoupling Cap 6 0.002 Signal Cap 5 0.002 Resistor 4 0.0001 Crystal 2 0.243 Bluetooth Low Energy IC 1 Approx $1 Total $2.72

12. About BLE * Radio Frequency - Bluetooth use unlicensed 2.4GHz ISM(Industrial Scientific Medical) band - Bluetooth has built-in AFH(Adaptive Frequency Hopping) feature - Bluetooth Classic uses 79 one MHz channel - BLE uses only 40 two MHz wide channel(3 advertising channel) * Bluetooth Smart: 1 Packet type 2 PDU types - Advertising Channel : iBeacon, BLE devices - Data Channel : BLE devices * BLE advertising: one-way broadcasting - packet can be up to 47 bytes in length(80 ~ 376 bits) - 1 byte preamble - 4 bytes access address(0x8E89BED6) fixed - 2~39 PDU - 3 bytes CRC Bluetooth Classic과 구분되는 규격

13. Packet Structure BLE packet structure

14. iBeacon * iBeacon message: 30 bytes - iBeacon prefix(9 bytes): 0x0201061AFF4C000215 - proximity UUID(16 bytes) - Major (2 bytes) - Minor (2 bytes) - TX power (1 byte) * RSSI(Received Signal Strength Indicator) - TX power is the strength of the signal measured at 1 meter from the device * Typical Distance Calculation(Calibration required) double getDistance(int rssi, int txPower) { /* * RSSI = TxPower - 10 * n * lg(d) * n = 2 (in free space) * d = 10 ^ ((TxPower - RSSI) / (10 * n)) */ return Math.pow(10d, ((double) txPower - rssi) / (10 * 2)); } iBeaconBLE 패킷의 한 종류로 규격화

15. BLE Packet d6 be 89 8e 40 24 05 a2 17 6e 3d 71 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 52 ab 8d 38 a5 d6 be 89 8e # Access address for advertising data (this is always the same fixed value) 40 # Advertising Channel PDU Header byte 0. Contains: (type = 0), (tx add = 1), (rx add = 0) 24 # Advertising Channel PDU Header byte 1. Contains: (length = total bytes of the advertising payload + 6 bytes for the BLE mac address.) 05 a2 17 6e 3d 71 # Bluetooth Mac address 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 # Bluetooth advertisement 52 ab 8d 38 a5 # checksum 02 # Number of bytes that follow in first AD structure 01 # Flags AD type 1A # Flags value 0x1A = 000011010 bit 0 (OFF) LE Limited Discoverable Mode bit 1 (ON) LE General Discoverable Mode bit 2 (OFF) BR/EDR Not Supported bit 3 (ON) Simultaneous LE and BR/EDR to Same Device Capable (controller) bit 4 (ON) Simultaneous LE and BR/EDR to Same Device Capable (Host) 1A # Number of bytes that follow in second (and last) AD structure FF # Manufacturer specific data AD type 4C 00 # Company identifier code (0x004C == Apple) 02 # Byte 0 of iBeacon advertisement indicator 15 # Byte 1 of iBeacon advertisement indicator e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 # iBeacon proximity uuid 00 00 # major 00 00 # minor c5 # The 2's complement of the calibrated Tx Power iBeacon 패킷 구성

16. BLE Packet iBeacon 패킷 구성 Preamble 1 Advertiser 4 PDU 2 - 39 CRC 3 MAC address 6 Header 2 Data 1 - 31 iBeacon Prefix 9 Proximity UUID 16 Major 2 8E89BED6 0201061AFF4C000215 Minor 2 size, type.. e.g. 112233445566 e.g. 4152554e-f99b-86d0-947070693a78 e.g. 4159 e.g. 27341 BLE Advertisement Frame BLE Advertisement Payload iBeacon Data Measured Tx Pwr 2 e.g. -59 iBeacon information RSSI Measured by receiver MAC From BLE header Proximity UUID (can be) company reference Major, Minor Integer values identifying the tag and/or zone Measured Tx Pwr Calibrated power at 1m from the iBeacon (dBm)

17. Protocol Stacks LL(Link Layer): 무선 링크를 설정하고 콘트롤 하는 레이어 HCI(Hardware Controller Interface): 콘트롤러와 호스트간의 통신 레이어 L2CAP(Logical Link Control to Adaptation layer Protocol)): 상위레벨로 데이터 서비스를 제공하고 콘트롤러로 보낼 패킷을 쪼개거나 조합하는 레이어 SM(Security Manager): AES-128bit 암호화 ATT(Attribute Profile): 서비스 제어 레이어 GATT(Generic Attribute Profile): ATT를 이용하여 프로파일과 서비스를 주고 받을 것인지를 제어 GAP(Generic Access Profile): 장치간 연결제어(Advertising and Connections) Bluetooth Smart(BLE) 프로토콜 구조

18. Radio Frequency Bluetooth Smart 주파수 규격 * BLE uses 2.4GHz ISM (unlicensed) band - 2MHz wide channel 40 channel - Advertising channel: 3 channel(37, 38, 39)

19. ISM band ISM band를 사용하는 다양한 무선 규격 * Unlicensed Radio Frequency - Wi-Fi(802.11b/g/n/ax) - Bluetooth - ZigBee(802.15.4) - ANT(ANT+) - Wireless Etherernet - Wireless USB

20. Avoid Interference 채널 간섭을 줄일 수 있는 설정 * 2.4GHz Wi-Fi 채널을 1, 6, 11로 설정 - 채널간 간섭의 확률을 줄일 수 있음 - Wi-Fi: CSMA(Carrier Sense Multiple Access) / CA(Collision Avoidance)

21. Interference 무선 주파수에 영향을 미칠 수 있는 요인 * Interference Types - Physical objects: 800Mhz, 1800MHz, 2100Mhz,,, - Radio interference: Many wireless technologies use an RF range of 2.4GHz Devices can cause noise and weaken the signal - Electrical interference: Computer, Oven, Motorized devices - Environmental factors: Lighting, weather, even human

22. iBeacon 결론적으로 advertising 패킷을 broadcasting * iBeacon은 단방향의 메시지만 송신

23. Proximity 근접도를 측정할 수 있는 정보 포함 * 단방향의 식별 정보만을 전송하지만, - RSSI를 이용하여 근접 정도의 계산이 가능 * iOS Region Monitoring - If listening device crosses monitored region boundary - In case of entry, iOS will send notification within ~ 1 second - In case of exit, iOS wait about 20 seconds before exit notification is reported (In order to avoid fake notifications) * iOS monitoring mode and range mode - When the phone is not active, iOS goes into a low-power mode Region enter/exit events are detected - When the phone and app are active, iOS goes into range mode Detect the signal strength and estimate the distance more precisely

24. Accuracy 거리 측정에 오차 감안 필요 * External factors which influence the Bluetooth radio frequency - absorption, interference, multipath fading, multipath propagation, diffraction - RSSI might fluctuate heavily * Experimental Results - Distance of 20cm: deviation is 5~6cm - Distance of 1m: deviation is 15cm - Distance greater than 10m: deviation is 2~3m -100 -95 -90 -85 -80 -75 -70 -65 -60 -55 -50 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 iBeacon RSSI (dBm) vs distance (m), line of sight GS4 with iBeacon 100 GS4 with iBeacon 101 Nexus 7 with iBeacon 100 Nexus 7 with iBeacon 101 iBeacon Tx power 0dBm ‘measured power’ -61dBm @ 1 m

25. Accuracy 수신기에 따른 측정 신호 차이 * Wireless signal fluctuation을 고려 - device별 신호 수신에 따른 경향성 존재 - moving avg / 칼만필터 / CDF 등 오차의 보정 필요 -90 -85 -80 -75 -70 -65 -60 -55 -50 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 iBeacon RSSI (dBm) vs distance (m), line of sight (RSSI averaged over 5 readings) GS4 with iBeacon 100 GS4 with iBeacon 101 Nexus 7 with iBeacon 100 Nexus 7 with iBeacon 101 grand average

26. Indoor positioning * If receiver detects three different beacon’s advertising packet, Relative position can be deduced - Beacon’s physical location should be supplied (via inquiry online service) - At least, Three different beacon’s RSSIs should be detected * But, - Bluetooth radio wave may be fluctuated - Each beacon’s transmitting time can not be synchronized LBS Positioning 실내에서의 측위 가능

27. UUID hierachy * UUID: nationwide retail store identifier * Major: identifier of store location * Minor: identifier of department * For security reason, UUID generation by uuidgen is recommended - create a new universally unique identifier (128-bit) - new UUID can reasonable be considered unique among all UUIDs - unique on the local system - unique on other system in the past and in the future Identifier of iBeacon

28. RSSI Fingerprinting * Bluetooth, Wi-Fi, Magnetic 등을 측정하여 공간에 대한 라디오맵 구성 - 크라우드소싱으로 정보를 수집하여 구축 비용 절감 - 구축된 라디오맵을 바탕으로 실내외 위치, 네비게이션 정보를 제공 - Skyhook Wireless - CISCO LBS - KAILOS (https://kailos.io) RSSI를 이용한 실내 측위 방법

29. BLE GATT Profile 저전력을 이용하는 다양한 BLE 서비스 * Bluetooth Smart GATT - BLE 장치간에 서비스에 대한 데이터 송수신 방법을 정의 - BLE를 활용하는 다양한 서비스는 프로파일로 정의(Bluetooth SIG) - https://developer.Bluetooth.org/TechnologyOverview/Pages/Profiles.aspx

30. BLE GATT Profile Profile 종류 Profile Description Alert Notification (ANP) 경보 통지 프로파일 Blood Pressure (BLP) 혈압을 측정 프로파일 Cycling Power (CPP) 자전거의 크랭크에 전달되는 파워 정보 프로파일 Cycling Speed and Cadence (CSCP) 자전거의 속도와 케이던스 정보 프로파일 Find Me (FMP) 연결된 디바이스를 찾는 프로파일 Glucose (GLP) 혈당을 측정하는 프로파일 Health Thermometer (HTP) 체온을 측정하는 프로파일 Heart Rate (HRP) 심장 박동수를 측정하는 프로파일 HID OVER GATT (HOGP) GATT 프로파일 상의 휴먼 인터페이스 디바이스 Location and Navigation (LNP) 위치정보와 네비게이션 정보 프로파일 Phone Alert Status (PASP) 전화 경포 통지 정보 프로파일 Proximity (PXP) 근접 정보 프로파일 Running Speed and Cadence (RSCP) 러닝 스피드와 회전수의 측정 프로파일 Time (TIP) 시간 동기화를 위한 정보를 전달 Weight Scale Profile (WSP) 체중 측정 프로파일

31. IoT over BLE IoT 환경에서 주요하게 활용될 것으로 기대 (from CSR presentation) A new radio, new protocol stack, new profile architecture and a new qualification regime It’s designed to run from coin cells and support an Apps Store model It is a radio standard for a new decade, enabling the Internet of Things Feature Mostly new PHY; some parts derived from the Basic Rate (BR) radio New advertising mechanism, for easy of discovery & connection Asynchronous connection-less MAC: used for low latency, fast transactions (e.g. 3ms from start to finish) New Generic Attribute Profile to simplify devices and the software that uses them Asynchronous Client / Server architecture Designed to be LOWEST cost and EASY to implement

32. Bluetooth 4.2 인터넷 접속 지원 * Bluetooth 4.2 Standard (2014-12-04) - 2.5x faster (huge packet) - privacy improvement - access the internet * Update to 4.2 - Privacy features may be available via firmware update - increased speed and packet size feature will require a hardware update * ISIP(Internet Protocol Support Profile): Adopted (2014-12-16) - Support of exchanging IPv6 packets between devices over the Bluetooth Low Energy transport - IPv6 / 6LoWPAN

33. Bluetooth 4.2 Internet Protocol Stack * ISIP Router: used for devices that can route IPv6 packets - Access Point(such as home router, mobile phone) * ISIP Node: devices that can only originate or consume IPv6 application packets - IPSS(Internet Protocol Support Service): discovery over GATT

34. Wireless Technology Compare with other technologies

35. BLE Compare with other technologies BLE ANT ANT+ RF4CE ZigBee Wi-Fi Nike+ IrDA NFC Remote Control x x x x x Security x x x √ √ x x Health and Fitness √ √ √ x x x x x Smart Meters x x x √ √ x x x Cell Phones x x x x √ √ Automotive x x x x x x Heart Rate x x x x x x x Blood Glucose x x x x x x x Positioning x x x √ √ x x x Tracking x x x x x x Payment x x x x x x x x Gaming x x x x x x x Key Fobs x x x x x √ √ 3D TV x x x x x x x Smart Applications x x x x x x x Intelligent Transport Systems √ √ √ x x x x x PCs x x x x x √ √ TVs x x x x x Animal Tagging x x x x x x Assisted Living √ √ √ x x x x x Table: Low-power wireless technology target markets (Digikey)

36. Pros and Cons * Pros - 저전력 기반으로 유연성과 환경 구성에 적합(배선 구성 불필요) - mobility 제공으로 다양한 분야에서 활용 가능 - (iBeacon) 신호를 전달하는 용량(capacity)에 제약이 없음(단방향) * Cons - (iBeacon) 주기적 신호를 발생(advertising)시키는 단방향 통신구조 : 밀집지역에 정보를 전달하기에 적합한 유형 : 그러나, 비콘을 활용하는 서비스는 용량에 제약을 받을 수 있음 - 1초 간격(1Hz)의 신호를 인식하기 위해서는 1초를 기다려야 함 : 신호 발생 주기 단축 시, 배터리 동작시간은 단축 - 정확한 위치 식별을 위해서는 필요한 조건이 만족되어야 함 : triangulation 측량을 위해서는 3개의 비콘 신호 수신 필요 : 각 비콘의 물리적 위치를 알아야 함 : 오차를 줄이기 위해서는 복잡한 구성 필요 BLEiBeacon의 장점

37. Security Issue * 비콘(region)의 식별 정보인 proximityUUID / Major / Minor 취약점 - proximityUUID / Major / Minor를 임의의 값으로 설정 가능 - region 기반의 서비스의 오류를 야기시킬 수 있음 신뢰도가 요구되는 서비스에서 비콘 정보만 의존하는 것은 위험 * iOS는 비콘의 안전성 확보를 위한 최소한의 조치 - 와일드카드로 비콘을 감지하는 것은 불가능(proximityUUID 설정 필요) - (androidOS에서 비콘을 지원하지 않으므로 임의의 비콘 스캔 가능) - world-wide beacon map: www.wikibeacon.org by Radius Network - “Apple Slowly Locking Down iBeacon ?” - proximityUUID를 직접 설정하는 어플리케이션의 등록 거부 신뢰도가 요구되는 서비스에서 비콘 정보만 의존하는 것은 위험 Apple rejects manual input of UUIDs

38. Battery Drain issue * 블루투스 활용에 따라 배터리 소모가 증가하지만, - 스마트폰 활용에 치명(?)적일 만큼 배터리 소모가 증가하지는 않으며, - 최신 단말의 경우에 블루투스의 배터리 소모 효율이 나아지고 있음 - 블루투스 활용(이어폰, 웨어러블 등)도가 향상됨에 따라 보편화 전망 * 비콘이 배터리 소모에 미치는 영향 - 감지 범위내 비콘의 개수가 배터리 소모에 미치는 영향이 큼 - 비콘 감지 주기가 배터리 소모에 미치는 영향이 큼(iOS : 1 sec) - 비콘의 신호 발생 간격이 짧으면 배터리 소모량이 증가함 비콘의 배치와 주기 설정이 사용자에게 미치는 영향 고려 필요 블루투스 활용으로 배터리 소모는 증가

39. Battery Drain issue iOS is worse than Android (experimental) AndroidiOS에 비해 배터리 소모 영향이 적음 iOS는 감지 공간내 비콘의 개수에 덜 영향 받음 Android는 커스터마이징에 유리한 반면, iOS는 최적화된 결과를 제공 실질적인 응용에서의 배터리 소모는 1% 수준으로 예측(1)

40. Scan Interval * Android는 블루투스 제어를 통해 설정이 가능 - https://github.com/AltBeacon/android-beacon-library * In iOS, 설정은 알 수 없으나, 배터리 소모를 감안하여 동작 - Region Monitoring : foreground / background (1 second) : unknown / inside / outside - Ranging : only works in foreground : immediate(0.5m) / near(2m) / far(30m) / unknown - only 20 region can be registered 스캔의 지속시간과 스캔의 간격

41. Management Issue * 비콘 관리의 어려움 - 비콘의 정상적인 동작 여부를 원격에서 파악하기 어려움 - 비콘의 설정 변경 또한 용이하지 않음 - 음영지역, 신호발생 주기, 전원 공급 상태는 모두 서비스의 품질에 영향 - 배터리 교체에 대한 관리 부담(Estimote Beacon Sticker) * 효과적인 비콘 관리 방법 ? - 핸드핼드 스캐너(Application)를 이용한 관리 방법 - 서비스와 결합된 크라우드소싱 관리 방법 서비스의 구성에서는 설정과 관리의 어려움 고려 필요 Bluetooth 4.2에서는 Internet connectivity 제공으로 관리에 이점 (IPv6 deployment 이슈) Beacon is not connected to the Network

42. Conclusion iBeacon is useful because ,,, but, Simple and Convenient Use of Radio Frequency Bluetooth 4.0 Standard Capacity Free As an Interface Disconnected Security Issues Localized Target 어플리케이션의 활용성이 물리적 공간과 결합하여 광범위하게 확대

43. Case Study * Antwerp museum - Estimote 비콘을 이용하여 박물관내 서비스 - Push Notification / In-door Positioning * Why ? - 공간을 해치지 않으면서 정보 제공 필요 : 속성상 부수적인 정보 제공의 필요성 - 박물관내 관람객의 이동 행태 : 비콘을 인식하는데 까지 소요되는 시간 : 통상적인 보행 속도 등 적합 - 박물관내 형상이 빈번하게 변경되지 않음 : 공간의 형상 변경 등이 빈번하지 않음 : 실내 측위 등에 이점 박물관 활용 사례

44. Case Study * 공항 내 프리미엄 서비스 예시 - Virgin Atlantic London Heathrow - Use of Estimote’s beacon - 보안 검색대 이동 시 항공권 팝업 - 환전 시 환전 수수료 할인 쿠폰 발행 - Airport map information - Thermometer / accelerometer - Luggage tracking(accelerometer) future - Temperature change * Why ? - 다수의 이용객이 밀집되는 공간에 효과적 - 사용자에 대한 편의제공과 더불어 관리 효과 - 공항 공간의 특성상 환경 영향이 미미함 Airport Premium Service

45. Case Study * 호텔 등에서 check-in으로 활용 - Starwood / Marriott / James / Hilton - Location-based suggestion - Check-in / Check-out Door Key personalized check-in

46. Case Study * Automatic + iBeacon - OBD(On-Board Diagonostic)에 비콘 기능을 추가 - 차량을 이동하는 비콘으로,,, - 주차시간 / 주차비 계산 / 출입 개폐기 작동 - 톨게이트, 주차장, 세차장, 주유소 등에서 사용 - Bluetooth 3.0 + 4.0 - OBD-II(K1962 standard) * Why ? - 비콘 신호를 송신함으로써의 서비스 모델 - 고정 형태가 아닌 이동형으로의 서비스 모델 - 보안 이슈에 대해서는 고려 필요 Door Key personalized check-in

47. Case Study * 위치와 결합한 Gamification - http://beaconcrawl.com - Pub 연계를 통한 Gamification - 스마트폰을 이용한 메뉴 주문 - 1, 2, 3차 목적지 미션을 통해 쿠폰 발행 * Why ? - 오프라인 서비스와의 결합 - 비콘을 활용한 다양한 게임 시나리오 적용 비콘 활용 Gamification

48. Scenario 목적으로 사용하기보다는 수단으로 활용해야, * 시나리오에서는 비콘의 특성과 영향이 반드시 고려되어야, - 비콘 신호 발생 주기와 측정 간격을 고려한 사용 : 개발 시점의 환경보다는 실 환경에서의 사용자 행위를 고려 : 1초 이상 지연될 수 있는 상황에 적합한가 ? - 박물관과 같은 환경에서의 적합성 : 특정한 환경에서의 사용자 양상 분석 필요 : notification active / passive - 신뢰도가 요구되는 서비스 모델에서의 적용 위험성 : 쿠폰과 마일리지의 차이점 : 물리 환경에서 비콘의 관리와 통제의 어려움 고려할 점

반응형