# Setting up an iBeacon scanner using the GATT Protocol for Bluetooth LE

**URL:** <https://discourse.nodered.org/t/setting-up-an-ibeacon-scanner-using-the-gatt-protocol-for-bluetooth-le/16053>\
**Category:** Share Your Projects\
**Created:** [29 September 2019 12:38 UTC](https://discourse.nodered.org/t/setting-up-an-ibeacon-scanner-using-the-gatt-protocol-for-bluetooth-le/16053 "2019-09-29T12:38:52Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![ttquattroman](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@ttquattroman](https://discourse.nodered.org/u/ttquattroman)\
**Post date:** [1 October 2019 15:50 UTC](https://discourse.nodered.org/t/setting-up-an-ibeacon-scanner-using-the-gatt-protocol-for-bluetooth-le/16053/21 "2019-10-01T15:50:26Z")

</div>

> [@krambriw](#):
>
> [{"id":"f1e1879c.db20c8","type":"tab","label":"BLE Gatt Scanner","disabled":false,"info":""},{"id":"15ee910e.06391f","type":"mqtt in","z":"f1e1879c.db20c8","name":"","topic":"found","qos":"0","datatype":"auto","broker":"18e7c688.018489","x":150,"y":360,"wires":[["de6816a8.875538","f0f36562.6daab8","b83fe5a5.6c36b8"]]},{"id":"9fb41c04.1bebd","type":"debug","z":"f1e1879c.db20c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":420,"wires":},{"id":"de6816a8.875538","type":"switch","z":"f1e1879c.db20c8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"name: MiniBeacon\_10754, address: D9:77:B9:4C:B8:5B","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":360,"wires":[["3c60c68c.05deba","9fb41c04.1bebd"]]},{"id":"f0f36562.6daab8","type":"debug","z":"f1e1879c.db20c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":420,"wires":},{"id":"8df2f747.4534f8","type":"exec","z":"f1e1879c.db20c8","command":"export DISPLAY=:0 && lxterminal -e sudo python3 /home/pi/gatt\_ibeacon\_scan.py","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":1020,"y":100,"wires":[,,]},{"id":"d8a34f4b.6d244","type":"trigger","z":"f1e1879c.db20c8","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"10","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":570,"y":100,"wires":[["8df2f747.4534f8"]]},{"id":"9e332f97.2746d","type":"inject","z":"f1e1879c.db20c8","name":"Init","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":true,"onceDelay":"","x":330,"y":100,"wires":[["d8a34f4b.6d244","bbd896e2.aee998","dce570b.a37ce9"]]},{"id":"47b75403.06780c","type":"comment","z":"f1e1879c.db20c8","name":"Starting BLE scanning service","info":"","x":220,"y":60,"wires":},{"id":"8d5ac6aa.304908","type":"mqtt out","z":"f1e1879c.db20c8","name":"","topic":"commands","qos":"0","retain":"","broker":"18e7c688.018489","x":800,"y":160,"wires":},{"id":"bbd896e2.aee998","type":"change","z":"f1e1879c.db20c8","name":"abort","rules":[{"t":"set","p":"payload","pt":"msg","to":"abort","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":160,"wires":[["8d5ac6aa.304908"]]},{"id":"334e200c.65883","type":"inject","z":"f1e1879c.db20c8","name":"abort","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":330,"y":220,"wires":[["bbd896e2.aee998","dce570b.a37ce9"]]},{"id":"dce570b.a37ce9","type":"delay","z":"f1e1879c.db20c8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":560,"y":220,"wires":[["6763bcb4.604624"]]},{"id":"6763bcb4.604624","type":"exec","z":"f1e1879c.db20c8","command":"sudo pkill -f gatt\_ble\_scanner","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":860,"y":220,"wires":[,,]},{"id":"b83fe5a5.6c36b8","type":"trigger","z":"f1e1879c.db20c8","op1":"","op2":"true","op1type":"nul","op2type":"bool","duration":"30","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":350,"y":300,"wires":[["dce570b.a37ce9","bbd896e2.aee998","d8a34f4b.6d244"]]},{"id":"3c60c68c.05deba","type":"trigger","z":"f1e1879c.db20c8","op1":"MiniBeacon\_10754 enter GATT 239","op2":"MiniBeacon\_10754 leave GATT 239","op1type":"str","op2type":"str","duration":"90","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":570,"y":360,"wires":[["2547b4a5.f9292c"]]},{"id":"2547b4a5.f9292c","type":"debug","z":"f1e1879c.db20c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":800,"y":360,"wires":},{"id":"18e7c688.018489","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Yipee, that worked - thank you for your help. now i just need to get MQTT to pull a GPIO pin high and activate a relay when a BLE beacon is detected.

thanks again for your help, it is really appreciated.

Tack så mycket

Peter

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [1 October 2019 15:59 UTC](https://discourse.nodered.org/t/setting-up-an-ibeacon-scanner-using-the-gatt-protocol-for-bluetooth-le/16053/22 "2019-10-01T15:59:48Z")

</div>

Great news, thanks for keeping up the fighting spirit!

What was the detail that helped? Just so I can update the guide

---

<div class="post-metadata">

**Author:** ![ttquattroman](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@ttquattroman](https://discourse.nodered.org/u/ttquattroman)\
**Post date:** [1 October 2019 21:48 UTC](https://discourse.nodered.org/t/setting-up-an-ibeacon-scanner-using-the-gatt-protocol-for-bluetooth-le/16053/23 "2019-10-01T21:48:57Z")

</div>

> [@krambriw](#):
>
> Change in line 22
> 
> ```auto
> if sys.version_info.major == 3:
> boost_libs = ["boost_python3"]
> 
> ```

Hello,

This is the change that fixed the problem;

Change in line 22

```auto
if sys.version_info.major == 3:
    boost_libs = ["boost_python3"]

```

Thanks

Peter

[Previous page](https://discourse.nodered.org/t/setting-up-an-ibeacon-scanner-using-the-gatt-protocol-for-bluetooth-le/16053.md?page=1)
