piBeacon: 1- how does it work, read me first

User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

piBeacon: 1- how does it work, read me first

Post by kw123 »

What it does:
  • It will allow bluetooth v4 (BLE) iBeacons to be used as presence detector devices with very fast reaction time (~ 0.5 seconds) and independent of any internet connection.
    Each iBeacon has a unique MAC
  • you can attached different sensors (temp, humidity, pressure, light, analog voltage, resistor measurements, IR switches, PIR , gyroscope, magnetometer, microwave sensor etc) and use GPIO pins or a DAC as output to drive e.g. LED or switches. (see sensors thread http://forums.indigodomo.com/viewtopic. ... 87&t=15563
  • you can connect to any BLE enabled device. You must have its BLE-MAC#. It will initiate a connection, wait for the first package back and stop. It will deliver info UP/Down RSSI and TxPower -can be used similar to an iBeacon. This means you can use your (i)Phone as presence detector. The reaction time is ~ 5-10 seconds to show UP when the Phone enters the range of an rPi.

The whole setup consists of
1. a plugin
2. 2 or up to 40 raspberry pi (rPi)
3. a bluetooth dongle connected to the USB port on the rPi (rpi3 comes with all required devices included, but a second able dongle is advised)
4. ble Beacons, and or sensors etc
5. if you like you can connect sensors or digital inputs or outputs to the rPi. They are set/managed and read by the plugin ,see

use http://forums.indigodomo.com/viewtopic. ... 87&t=15120 for discussion.

The iBeacon functionality:
  1. The plugin piBeacon will communicate with and configure 1-20 raspberyPi's to be detectors for the BLE devices.
  2. The plugin will create one indigo device for each BLE device found. It will contain STATES: Pi_#_Signal,Pi_#_Distance, Pi_#_Time, x,y,z position at your home from each pi-server#.
  3. Each Pi server collects messages from all devices in their range and will send updates once a minute (can be changed) to the plugin. If a NEW device is found or a down device reappears a message will be send immediately(~0.5-1 second)
  4. Then the plugin will create/update a device with the name "beacon-MAC#" of the bluetooth device in the indigo folder piBeacons. - You can create a list of MAC numbers you want to exclude from being tracked (can be reversed later) in the plugin menu.
  5. If a BLE device has send a msg (they do this each 0.1..10 seconds) the status of the beacon device will be set to “up”.
  6. After a defined time if no signal is received from ANY pi-server for a BLE-beacon the plugin status will be set to DOWN from UP and to EXPIRED from DOWN. This time can be set in the config -.
Screen Shot 2016-02-12 at 4.13.21 PM.png
Screen Shot 2016-02-12 at 4.13.21 PM.png (170.22 KiB) Viewed 9184 times
Screen Shot 2016-02-12 at 4.13.08 PM.png
Screen Shot 2016-02-12 at 4.13.08 PM.png (124.36 KiB) Viewed 9184 times
With this info you can
-set triggers: If device xx/status changed to “up” you are coming home, if it changes to down or expired you are gone.
- determine where in your home the beacon is
By adding enough pi-servers you can cover the whole house as the range is ~ 20 meters or 1-2 wooden walls

The plugin calculates the distance from the py with the formula:

Code: Select all

 distance= sqrt( 10^(transmitPower-receivedPower)/10) ( transmitPower =powerMeasured at 1m)
powers are in dBm (-99 is off; 0 is very high; normal measured values are -50 to -85)
This works well as long as the pi and the beacon are in the same room. Each wooden wall adds~ 20 m to the distance.
It also calculate the approximate position of the beacon relative the to raspberry server by picking the lowest and correcting the postion by a weighted (x,y,z) distance to the next rPi's ((x,y,z)rip-(x,y,z)rpi0)/distance. This gives an approximate ~ 3-5 meter accuracy in the room.

None of this requires any communication to the Internet everything is done on your home network - and VERY fast ~ 0.5-2 seconds response time depending on settings

BLE is better fitted for this task than WiFi. BLE is CONSTANTLY sending low energy signals. Using WiFi takes too much energy for battery devices and hence they go to sleep frequently and do not answer PINGs. On the other side BLE has a limited range. But this can be covered by setting up multiple raspberry pi to cover the whole house eg front, middle and back of home.



How to install .. no programming is required, follow installation steps and the plugin will configure each raspberry pi for you.

[viewtopic.php?t=15482


Karl
Attachments
Screen Shot 2017-06-02 at 17.48.58.png
Screen Shot 2017-06-02 at 17.48.58.png (231.85 KiB) Viewed 6709 times
map uuid to name.png
map uuid to name.png (32.74 KiB) Viewed 9083 times
devlist.png
devlist.png (296.33 KiB) Viewed 9083 times
config pi.png
config pi.png (54.45 KiB) Viewed 9083 times
menu1.png
menu1.png (111.12 KiB) Viewed 9083 times
Screen Shot 2016-02-17 at 7.43.40 PM.png
Screen Shot 2016-02-17 at 7.43.40 PM.png (1001.71 KiB) Viewed 9107 times
Screen Shot 2016-02-12 at 5.01.13 PM.png
Screen Shot 2016-02-12 at 5.01.13 PM.png (27.86 KiB) Viewed 9179 times
Screen Shot 2016-02-12 at 4.57.59 PM.png
Screen Shot 2016-02-12 at 4.57.59 PM.png (208.33 KiB) Viewed 9180 times
Screen Shot 2016-02-12 at 4.57.26 PM.png
Screen Shot 2016-02-12 at 4.57.26 PM.png (81.31 KiB) Viewed 9180 times
Screen Shot 2016-02-12 at 4.48.17 PM.png
Screen Shot 2016-02-12 at 4.48.17 PM.png (66.6 KiB) Viewed 9180 times
pi config-3.png
pi config-3.png (70.36 KiB) Viewed 9180 times
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: piBeacon: 1- how does it work, read me first

Post by kw123 »

Attention:
with MAC os 12.2 and higher you need to enable terminal to access directories.
in system prefs / security / privacy / full disk access / check terminal

This is needed as several functions to eg. create compressed png files for several functions ie position of beacons in house, lid images etc are launched in a terminal session.

Karl
Locked

Return to “piBeacon”