§ 瀏覽學位論文書目資料
  
系統識別號 U0002-2502201912135300
DOI 10.6846/TKU.2019.00813
論文名稱(中文) 藍牙信標應用於裝置識別與距離偵測之實作
論文名稱(英文) Implementation of Device Identification and Distance Detection based on Bluetooth Beacon Technology
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 資訊工程學系資訊網路與多媒體碩士班
系所名稱(英文) Master's Program in Networking and Multimedia, Department of Computer Science and Information Engine
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 107
學期 1
出版年 108
研究生(中文) 陳翰傑
研究生(英文) Han-Chieh Chen
學號 605420164
學位類別 碩士
語言別 繁體中文
第二語言別 英文
口試日期 2019-01-13
論文頁數 58頁
口試委員 指導教授 - 林其誼(chiyilin@mail.tku.edu.tw)
委員 - 林昌鴻(chlin@mail.ntust.edu.tw)
委員 - 張世豪(145322@mail.tku.edu.tw)
委員 - 林其誼(chiyilin@mail.tku.edu.tw)
關鍵字(中) 低功耗藍牙
iBeacon
接收訊號強度指標
距離偵測
關鍵字(英) Bluetooth Low Energy
iBeacon
Received Signal Strength Indicator
Distance Detection
第三語言關鍵字
學科別分類
中文摘要
雖然近幾年手機開始普及,價位普遍不高且相當親民,雖可藉由Google地圖、搭配手機來使用其定位追蹤。然而透過GPS搭配手機、雖然使用方便且快速,室外定位標準誤差為15m。但是GPS仍須倚靠衛星定位,且無法針對室內定位,作精確之距離判斷與估計。針對手機本身之耗電量、可用之待機時間,也是必要的考量因素。
   本研究擬利用蘋果公司所制訂的iBeacon藍牙信標技術進行應用設計。iBeacon乃基於藍牙4.0的Low Energy (BLE)運作模式,以廣播特定格式訊息內容的方式,讓接收端得以藉由所收到訊息內容進行延伸之應用。除了可能取代部分NFC功能以外,還有許多相關之應用,好比補足GPS不足之室內導航就是其中之一。且妥善利用藍牙之信標功能,iBeacon不但可作為室內定位工具之外,還可使用其本身訊息推播之機制,發送商品優惠訊息、建築大樓位置及名稱與機場個人行李之追蹤。最後發揮藍牙本身、功能之最大優勢,成本價格低、消耗電量很小、不佔用通訊頻帶。還有最重要的是,iBeacon所提供之相對位置,誤差值約略2到3m左右。
   因此我們透過兩個樹莓派(Raspberry Pi)執行藍牙信標發射端與接收端之實務應用,順利讓傳送端透過短距離通訊技術之藍牙(Bluetooth)方式傳遞,使其發送廣播封包內容本身包含iBeacon藍牙信標。接收端則必須辨識與過濾藍牙封包,再將篩選後之封包進行分析以取得iBeacon藍牙信標之所有資訊,藉此由封包內容當中的信號強度數據套入數學公式以得到兩通訊裝置之間的估計距離,最終希望達成兩裝置之間識別與防止碰撞的功能。
   本研究的實作項目包括下列幾點:1. iBeacon藍牙信標封包格式研究。2. iBeacon藍牙傳輸端設定與發送。3. iBeacon藍牙接收端設計與測試。4. Raspbian藍牙套件安裝與環境編輯。5. Python Code程式語法、邏輯、函式庫引用。6. iBeacon藍牙信標過濾與名單建立。7.傳送功率量測與接收功率顯示。8.距離計算程式設計。
英文摘要
Global Positioning System (GPS) has been extensively used for outdoor locationing applications, however, it does not work in indoor environments. The recent Bluetooth Beacon technology fills the gap for micro-locationing applications because of its low cost and the ubiquity of Bluetooth interfaces on smartphones. Based on the Bluetooth beacon technology, in this research we would like to implement device identification and distance detection between two objects. Specifically, we use two Raspberry Pi 3 development boards to play the roles of a beacon transmitter and a beacon receiver, respectively. At the beacon receiver, beacon packets from a specific transmitter can be filtered out, and then the receiver can do distance detection based on the received signal strength indicator (RSSI) and the transmission power of the received packets. To do that, we modified the open source code from Bluepy and implemented two distance estimation formulas. Experimental results show that the beacon receiver can successfully identify the beacon transmitter and give a rough distance estimation.
第三語言摘要
論文目次
目錄
第一章  緒論	1
     1.1研究背景與動機	1
     1.2研究目的與重要性	1
     1.3論文架構	2
第二章  相關研究	3
     2.1藍牙技術探討	3
     2.2 Beacon相關應用	5
     2.3廣播封包格式	11
     2.4 iBeacon參數內容	13
第三章  系統架構與研究方法	14
     3.1系統架構	14
     3.2命令列之使用	16
     3.3官方原始碼與RSSI	21
     3.4距離估計程式設計	23
第四章  系統實作與結果討論	26
     4.1 iBeacon 裝置識別應用	26
     4.2 iBeacon距離估計方式	35
     4.3 iBeacon實際量測數值	36
     4.4 iBeacon精準距離計算	42
     4.5 iBeacon運行結果展示	45
第五章  結論與未來展望	48
     5.1結論	48
     5.2未來展望	48
參考文獻	49
附錄—英文論文	52
 
圖目錄
圖2-1藍牙版本之4.2與5.0技術內容比較[1]	4
圖2-2.1 Eddystone封包格式[6]	7
圖2-2.2 Eddystone-UID之封包格式	8
圖2-2.3 Estimote Beacon之Eddystone-URL設定畫面	9
圖2-2.4 Estimote Beacon之Eddystone-TLM顯示畫面	10
圖2-3.1藍牙廣播方式	11
圖2-3.2廣播封包格式	12
圖2-3.3 iBeacon封包內容	12
圖3-1 樹莓派Raspberry Pi 3 Model B之外觀	14
圖3-1.1 iBeacon廣播封包 流程圖	15
圖3-2 命令列應用 流程圖	16
圖3-2.1軟體包管理安裝實例	17
圖3-2.2藍牙傳輸機制	18
圖3-2.3 RPi3-A發送iBeacon之信號	18
圖3-2.4 智慧型手機iBeacon接收實例	19
圖3-2.5正確接收藍牙廣播封包	20
圖3-2.6 iBeacon信號識別	20
圖3-3 BLE應用 流程圖	21
圖3-3.1 BLE周邊裝置掃描	22
圖3-3.2顯示BLE裝置掃描結果	22
圖3-4.1參考文獻[22]的距離估計誤差實驗結果	24
圖3-4.2距離估計之程式設計	24
圖3-4.3第二種距離估算公式之程式碼	25
圖4-1 裝置識別應用 流程圖	26
圖4-1.1程式設計概念	27
圖4-1.2原始碼內容做變數測試	28
圖4-1.3變數相對應之結果	28
圖4-1.4針對字串做切割之程式碼	29
圖4-1.5各別之字串切割並顯示其內容	30
圖4-1.6混合名單程式設計	30
圖4-1.7顯示其輸出結果	31
圖4-1.8白名單程式設計	31
圖4-1.9顯示其輸出結果	31
圖4-1.10黑名單程式設計	32
圖4-1.11顯示其輸出結果	32
圖4-1.12傳送端之iBeacon封包內容	33
圖4-1.13顯示其輸出結果	33
圖4-1.14藍牙位置比較裝置間正確性與接收信號強度指示	34
圖4-1.15方便操作者比對iBeacon程式應用與內容之判斷	34
圖4-2.1傳送端藍牙位置與傳輸功率指示	35
圖4-2.2傳送端之數值	35
圖4-3.1手機藍牙傳輸位置	36
圖4-3.2樹莓派(Raspberry Pi 3)藍牙晶片位置	37
圖4-3.3精準地計算出所要量測之1m距離	37
圖4-3.4捲尺讓樹莓派搭配手機進行1m之實際量測	38
圖4-3.5做十六進制(Hexadecimal Value)發射數值推導	38
圖4-3.6針對各別數值做測試與比對	39
圖4-3.7數值為0xCE則最接近1m之實際距離	39
圖4-3.8更換新的樹莓派裝置	40
圖4-3.9藍牙位置(Bluetooth Address)改為B8:27:EB:18:B2:ED	40
圖4-3.10第一篇論文程式設計	41
圖4-3.11相差0.292054m	41
圖4-3.12藍牙廣播封包傳送距離被錯估為900.442841m	42
圖4-4.1實測後發現傳輸功率(Transmission Power)	43
圖4-4.2實際測試1	43
圖4-4.3實際測試2	44
圖4-5.1 Python程式設計與數學換算之搭配	46
圖4-5.2九項重點結果	47
 
表目錄
表4-4.4 27次距離估計測試原始數據	44
表4-4.5 27次距離估計測試數據分析	45
參考文獻
[1]	Hitesh Ramoliya Bluetooth 5 vs bluetooth 4.2, Mar 26, 2018
https://medium.com/@ramoliya/bluetooth-5-vs-bluetooth-4-2-d8f29bee46ba
[2]	Silicon Labs淺談三大低功耗藍牙beacon標準, Sep, 07 2016
https://www.edntaiwan.com/news/article/20160907NT01-Bluetooth-Beacon-ProximityAware
[3]	李欣宜 Beacon微定位商機崛起, Jan 15, 2015
https://www.bnext.com.tw/article/34960/BN-ARTICLE-34960
[4]	Marcwan Google EddyStone, Jan 8, 2018
https://github.com/google/eddystone 
[5]	新通訊 EddyStone基本功能涵蓋完整Beacon應用開發一把罩, May 06, 2016
http://www.2cm.com.tw/technologyshow_content.asp?sn=1605060008
[6]	Martin Beacon profile: Eddystone, 2018
https://support.kontakt.io/hc/en-gb/articles/206853889-Beacon-profile-Eddystone
[7]	Jfarfel GitHub Google Eddystone-UID, Aug 11, 2016
https://github.com/google/eddystone/tree/master/eddystone-uid
[8]	Dermike GitHub Google Eddystone-URL, Sep 28, 2016
https://github.com/google/eddystone/tree/master/eddystone-url
[9]	Mashbridge GitHub Google Eddystone-TLM, Apr 14, 2016
https://github.com/google/eddystone/tree/master/eddystone-tlm
[10]	SCRIBLES Running BLE Advertising Example Code on Raspbian Stretch, Oct 28, 2017
https://scribles.net/running-ble-advertising-example-code-on-raspbian-stretch/
[11]	Flyinactor91 IBeacon Entry System With the Raspberry Pi and Azure, 2016 
https://www.instructables.com/id/iBeacon-Entry-System-with-the-Raspberry-Pi-and-Azu/
[12]	Bluetooth SIG, Inc. Company Identifiers, 2019
https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
[13]	Flyinactor91 RasPi-iBeacons, Apr 14, 2015
https://github.com/flyinactor91/RasPi-iBeacons

[14]	Pip (package manager) Wikipedia, Feb 15, 2019
https://en.wikipedia.org/wiki/Pip_(package_manager)
[15]	Adrian Rosebrock Raspbian Stretch: Install OpenCV 3 + Python on your Raspberry Pi, Sep 4, 2017
https://www.pyimagesearch.com/2017/09/04/raspbian-stretch-install-opencv-3-python-on-your-raspberry-pi/
[16]	The Python Standard Library Python 3.7.2 documentation, Feb 21, 2019
https://docs.python.org/3/library/
[17]	BlueZ Release of BlueZ5.50, Jun 3, 2018
http://www.bluez.org/
[18]	G.T. Wang 樹莓派Raspberry Pi實作iBeacon 發射器, Dec 26, 2016
https://blog.gtwang.org/iot/raspberry-pi/diy-build-raspberry-pi-ibeacon-transmitter-tutorial/
[19]	RPi Bluetooth LE, Jul 4, 2017
https://www.elinux.org/RPi_Bluetooth_LE
[20]	Ian Harvey bluepy 0.9.11 documentation, 2014
https://ianharvey.github.io/bluepy-doc/scanner.html?highlight=rssi#sample-code
[21]	Wowo 玩转BLE(2)_使用bluepy扫描BLE的广播数据, May 19, 2016
http://www.wowotech.net/bluetooth/bluepy_scan.html
 
[22]	Feristah Dalkilic, Emine Arikan, Umut Can Cabuk, Aslihan Gurkan 2017 An analysis of the positioning accuracy of iBeacon technology in indoor environments, pp.549 - 553
https://ieeexplore.ieee.org/document/8093459
[23]	Md Sayedul Aman, Haowen Jiang, Cuyler Quint, Kumar Yelamarthi, Ahmed Abdelgawad 2016 Reliability Evaluation of iBeacon for Micro-Localization, pp. 1-5
https://ieeexplore.ieee.org/document/7777904
[24]	Python Software Foundation string — Common string operations, Feb 16, 2019
https://docs.python.org/2/library/string.html
[25]	Charles R. Severance Python for Everybody, 2016
http://do1.dr-chuck.com/pythonlearn/EN_us/pythonlearn.pdf
[26]	Simon Toulson Transmission power, Range and RSSI, Dec ,2018
https://support.kontakt.io/hc/en-gb/articles/201621521-Transmission-power-Range-and-RSSI
[27]	Hexadecimal Dictionary 0✕15
http://www.hexadecimaldictionary.com/hexadecimal/0x15/
[28]	Eklimcz RSSI to Distance Conversion, 2016
https://gist.github.com/eklimcz/446b56c0cb9cfe61d575
[29]	MDN web docs Math.Pow, 2019
https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Math/pow
論文全文使用權限
校內
校內紙本論文立即公開
同意電子論文全文授權校園內公開
校內電子論文立即公開
校外
同意授權
校外電子論文立即公開

如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信