玩 Eddystone beacon @ micro:bit 的應用

動機:對於 IoT 及 WoT 的應用 Google 發展了 Eddystone Proximity Beacon,可使用 EddyStone-UID 來實現微定位以及室內導航、或提供 EddyStone-URL 位址虛實整合開發...也想要玩玩 micro:bit 能做到什麼效果?!

查證
經查 https://lancaster-university.github.io/microbit-docs/ble/eddystone/ 可知 micro:bit Eddystone beacons 有提供二項,如下
1.UID (Unique ID): this is simply an identifier which is mapped by an application receiving it, to something meaningful like a location
2.URL (Uniform Resource Locator): this is exactly what you'd expect. A URL, typically in compressed form, which points to something like a web site

準備環境
1.Windows 10 / MacBook Pro 筆電
2.BBC micro:bit (插USB數據線)
3.Yotta (offline C/C++ tools)

前題
搜尋Google查到一則範例,如 http://bluetooth-mdw.blogspot.tw/2016/11/microbit-proximity-beacons.html,也觀看了其示範影片,如下,思考要如何實作!!



示意圖

實作步驟
1.請參攷拙作~使用 yotta 建立 microbit samples (C++),  https://davistseng.blogspot.tw/2017/11/yotta-microbit-samples-c.html 安裝相關工具...
2.修改 \microbit-samples\source\examples\bluetooth-eddystone-url\main.cpp 檔案,如下

3.執行 run.bat 編譯並flash至micro:bit,如下圖


4.如果想要執行 Physical Web 的 網址驗證 URL Validator 可至 https://beaufortfrancois.github.io/sandbox/physical-web/url-validator/ ,如下圖

5.在 Android手機安裝 Chrome Canary App,並設定 Physical web實體化網路,如下圖



6.再開啟(EnabledChrome Canary 的 Physical Web 設定,如下圖

7.接下來,打開 micro:bit 的 URLbroadcast,如下影片(可看見LED顯示 ADV)

8.最後,就可以收到 Chrome Canary 的 Nearby Notifications 通知了,並可按下打開預設的網頁(上述示範程式是 https://google.com),如下圖




參攷
1.Nearby Notifications Overview, https://developers.google.com/nearby/notifications/overview
2.Get Started with Beacons, https://developers.google.com/beacons/get-started

留言