简体   繁体   中英

Raspberry Pi Zero W - Detect iBeacon and perform an action

I have a Kontakt.io Beacon Pro - this broadcasts iBeacons. I want to be able to detect the iBeacon using the Raspberry Pi (Zero W) and then for the pi to perform an action using a python script. (turn on LEDs via GPIO). I can detect the iBeacon using the hcitool lescan feature of bluez, but i don't know how (if i can) set up a python script maybe? that will detect the ibeacon and then upon detecting it, will turn the LEDs on.

The key to doing this is to set up a Bluetooth scan using BlueZ and using it to detect beacons. Here is a blog post that tells you how to turn on a light with a Raspberry Pi 2 when a beacon is detected.

http://developer.radiusnetworks.com/2014/04/27/how-to-make-a-raspberry-pi-turn-on-a-lamp-with-an-ibeacon.html

The sample uses a shell script, not python to control BlueZ to do the detecting. To control an LED, you can drop the power tail. You will also need to adjust the use of GPIOs for the Raspberry Pi Zero.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM