piBeacon: 3- presence monitoring download

Posted on
Mon Nov 30, 2015 11:06 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: 3- presence monitoring download

piBEACON plugin

====> new releases from now on on the indigo store:https://www.indigodomo.com/pluginstore/59/

and start reading http://forums.indigodomo.com/viewtopic.php?f=187&t=15562

SSD images,..
bullseye image (pi-os 11)
https://www.dropbox.com/s/pgolx03s5lywhl1/2022-12-02-pibeacon-bullseye.img.zip?dl=1this will need a 8GB SSD card

===> added option to setup wifi through file on RPI SSD boot directory.
https://forums.indigodomo.com/viewtopic.php?f=187&t=23655



====Older images ====

https://www.dropbox.com/s/hh9e7q5cewxp85x/2021-03-20-pibeacon-buster.img.zip?dl=1this will need a 8GB SSD card ( password: pibeacon.)
https://www.dropbox.com/s/9uec57k1o07mm9i/2021-01-17-pibeacon-buster-img.zip?dl=1
https://www.dropbox.com/s/ufjrf5a03zmvb1u/2020-02-25-pibeacon-buster.img.zip?dl=1
https://www.dropbox.com/s/hpcuwyjizjqbroe/2019-11-12-pibeacon-buster.img.zip?dl=1
https://www.dropbox.com/s/hpcuwyjizjqbroe/2019-11-12-pibeacon-buster.img.zip?dl=0
stable buster version, w ibeacon, serial, i2c onewire .. tested
https://www.dropbox.com/s/eqr72o407ki0tjv/2019-09-05-pibeacon-buster.img.zip?dl=1

BUSTER release, works with RPI4 and resolves problems w RPI3+ re beacon scanning.
https://www.dropbox.com/s/p6yyrvafrfmv3qh/2019-08-21-pibeacon-buster.img.zip?dl=1

Stretch releases:
https://www.dropbox.com/s/u1x4tr9r521mr3p/pibeacon-2018-11-09.img.zip?dl=1, has problems with RPI3plus, need to add USB dongle
https://www.dropbox.com/s/egvf89113x8ma25/pibeacon-2018-04-12.img.zip?dl=1
Jessie
https://www.dropbox.com/s/5vx0rb0pdr793ww/2017-09-07-raspbian-stretch-pibeacon.img.zip?dl=1 "stretch "version
https://www.dropbox.com/s/yhzzecnbomq8vyc/2017-07-31-pibeacon.img.zip?dl=1 last "jessie" version
You need to copy it onto a >=8Gbyte SSD
Then in sudo rasp-config do "set timezone" , change password and expand ssh to full size
strongly suggest to use a 16+ GByte SSD. They last longer!!
===> password for userId pi: pibeacon (instead of raspberry) .. please change after you login!!

discussion:
http://forums.indigodomo.com/viewtopic.php?f=187&t=15120 for discussion.
tested beacons:
http://forums.indigodomo.com/viewtopic.php?f=187&t=15360
checkout :
http://forums.indigodomo.com/viewforum.php?f=187 for all threads
Attachments
Screen Shot 2016-06-22 at 9.41.37 PM.png
Screen Shot 2016-06-22 at 9.41.37 PM.png (216.02 KiB) Viewed 13307 times

Posted on
Fri Dec 11, 2015 11:06 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON presence monitoring download

version 0.9.11 posted in the first post.

some stability improvements when manyPIs are running .

Karl

Posted on
Fri Dec 11, 2015 11:24 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON presence monitoring download

v 0.9.14 posted in first post.


fixed:
userid karlwachs was hardwired in the pi web server..
hardwired IP number

karl

Posted on
Mon Dec 14, 2015 4:33 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON presence monitoring download

v 1.0.1 posted.

changes:

The plugin now uses the standard indigo web server instead of one small python web server for each pi server. This reduces the cpu load by ~ 50% from ~ 2% to less than 1% and improves the stability as not so many file PIPEs have to be open.
One draw back: the standard indigo web server logs each http request in the log file. If you have 10 pi server it will add an entry every 5 seconds. The plugin comes with a modified version(*) that you can install through a menu option that does not log the messages for the pi server only.

Added some more checks and small internal improvements to the code. This behaves like a real product now. You should not see to many bugs.

Karl

(*)
added / modified code in /Indigo 6/IndigoWebServer/indigopy/indigoconn.py
Code: Select all
   ####################
   def ServerWriteLog(self, logMessage):
   ###KW mod to suppress a lot of messages from pi-servers:
      if logMessage.find("pi_IN_") >-1:  return
      

Posted on
Fri Jan 01, 2016 7:00 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON presence monitoring download

new version 1.1.1 posted:

new:
  • added x,y,z position calculation for each beacon from the xyz positions of each r-Pi .
    You need to assign x,y,z positions to each of your r-Pi (in meter,feet, or yards) (z is for the levels; I am using 5 m for each floor: ground=0, 1st floor=5m. x,y position as the r-Pi's are placed on each floor.
  • added convenient management functions to ignore drive by beacons
  • beacons that send with txPower > 0 dBm (can be set) will be ignored. That would be an extremely powerful beacon with a signal strength of ~ 0.1 Watt at 1 meter distance!
  • onetime beacons will be deleted after a day and added to the ignore list
  • added fast reaction to beacon signal changes . When the signal received from a beacon by a raspberry is > a set threshold, the messages gets send to the indigo server immediately, instead of collecting messages for 1 minute. this threshold can be set for each beacon
  • added a self check on each r-Pi to reboot if no connection to the wifi router after 5 minutes. This is needed in case you have a power failure in your house. The rPi comes back faster than the router and as it can not find the wifi router is just sits there and does not retry to connect to the roster, by rebooting it will try again

This is now my preferred method of presence detection, I can determine where in the house the beacon is and if they leave/arrive. All within 0.5-2 seconds.
It looks very stable and the amount of traffic generated is reduced through thresholds and time window parameters.

And still no programming required!

Future options:
optimize the position calculation by using the distance info between the raspberryPi beacon signals(as profile to interpolate effects of walls) to calculate the real position of the beacon.


Karl

Posted on
Mon Jan 04, 2016 2:33 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

v 1.1.2 posted, first post in this thread

fixed:
- error in print config key not found
- expiration time in edit devices had a typo, 3 minute time period was not 180 seconds but 18.

[b]added[:/b]
beacon types: other 1,2 ,3
with different txPower min settings. they are read not from a file you can edit yourself to set these parameters .. for experts, once things work and you want to fine-tune yourself for different beacon types

Karl

Posted on
Tue Jan 05, 2016 6:59 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

:v 1.1.4 posted

fixed:
variables were not created immediately.

thanks to Haavard for debugging.

Karl

Posted on
Wed Jan 13, 2016 7:00 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

v 1.2.1 posted (first post in this thread)

fixed:
if the user creates iBeacon devices in indigo manually the plugin crashed. Now it will delete those devices. All iBeacon devices must be created by the plugin itself.


added:
1. in configure / edit device you can now set beacon type and set the TxPower to be used. This is useful as many (Chinese) iBeacon types do not transmit the Tx info properly and we need the proper transmit-power to calculate the distance correctly
2. added 3 more beacon types
3. added option to send iBeacon messages from the pi immediately if the signal varies by > xx dBm. Before it used the average of the signal over time to compare to last send average signal. Now it compares the last send average signal to the currently received single message ..
In other words beacons send many messages in a second. If you compare 2 averages it will not recognize a 10 point change of a single message as the average over e.g. 100+ messages) will reduce the effect significantly..
4. several beautification things and several error control checks

Karl

Posted on
Sat Jan 16, 2016 1:43 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

new version 1.3.2 posted


fixed:
the timeout for rPi v1 and wifi was too short so sometimes it did not successfully finish file updates. The timeout was fixed.

added:
  • iPhones can now be used as iBeacon, but the BLE signal gets turned off once it goes to sleep.
    you need to e.g. use LOACTE app or install the gem tot app with Xcode your self.
    setup the UUID major / minor you like on your iPhone
    then in piBeacon do menu/piBeacon/Define iPhone-UUID link select the beacon that was just created by the iPhone with the UUID-Major-Minor you just selected on the iPhone. From then on the rPis will not use the MAC # for that UUID-Major-Minor to id the device but the UUID-Major-Minor and send the indigo pibeaconpldgin always the same MAC number even if the iPhone changes it.
  • if anything changes the plugin will automatically update the rPis in the background and will retry until all rPis are successfully updated.
  • some english improvements, menu help etc.
    -


karl
Attachments
Screen Shot 2016-01-16 at 1.36.59 PM.png
Screen Shot 2016-01-16 at 1.36.59 PM.png (182.4 KiB) Viewed 14989 times

Posted on
Sun Jan 17, 2016 9:40 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

Version 1.4.1 and new SSD image (version 2) posted:

added:

1. support for all raspberry versions 1,2,zero, wifi, ethernet
2. streamlining of updates and management of beacons and rPis.

for the rPi-zero you must use a simple usb2 hub not a usb 3. They seem not work.
Examples that work are:
Ableconn USB2HUB2W USB 2.0 2-Port Compact Hub (White) ($9)
AmazonBasics 4-Port USB 2.0 Ultra-Mini Hub ($6)

And you need a micro to female usb connector, e.g.:
RuiLing 2-Pack USB 2.0 Micro USB Male to USB Female Host OTG Adapter for SamSung S3 i9100 i9300 Note 2.($2.50)

all Amazon prices

will post later the individual steps that make the SSD from scratch.

The minimum for a rPi-zero setup is:
1. pi-zero: $5
2. microusb femal: $2.50
3. usb2 hub : $6
4. power supply you likely have
5. box ~ $5-10
6. Wifi Dongle $10
7. Bluetooth Dongle $12
total: ~ $40-$50

The pi1b is $24, but you save $10 for the USB stuff, and you might not need a wifidongle
hence the delta between rpi-1b and rpi-zero is ~ $5-$15,
the rPi2 is ~ $20 more

Karl

Posted on
Sun Jan 24, 2016 2:45 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

version 1.5.2 posted (top entry of thread.

fixed:
- small bugs, for special circumstances

added:
  • supports battery level (right now only for Jaalee iBeacons, trying to understand the protocol of the iBeacons, they all differ!!)
  • added full support for Tile and PebbleBee. They can now be fully utilized with the plugin when they are NOT in powersave mode
  • added "FASTDOWN" feature: when iBeacon leaves range the state goes to down after 1-5 seconds (you can set that time).
    Before now the UP to down "expiration" is done by the plugin waiting for xx Seconds(can be set) for "no rPi sends an UP message for an iBeacon".
    NOW with FASTDOWN the rPis send an ACTIVE "DOWN" signal to the plugin when no bluetooth signal was received for 1-5 seconds (you can set the time)
    this enables to use e.g. the radius iBeacons as on/off switches with a delay time of < 1 sec for ON and ~ 2 sec for OFF
  • added some more error control for exceptions
  • improved update speed of the sending config and program files etc to the rPis~ 50%. -- learned a bit more EXPECT language
  • improved the menue structure for easier management
  • improved the update of the indigo logging feature (suppress the login of the rPI updates variables). Instead of replacing the file, we now add 2 lines to it at the proper place (*). So you can use any new version if Indigo updates it.
  • UUID-Maj-Min of rPis are now 2f234454cf6d4a0fadf2f4911ba9ffa6-09-rPi#. (-09-rPi3# changed) useful if you have multiple rPis.
  • ignore list on the rPis are now updated automatically every 5 minutes if you delete a iBeacon device. They are now already ignored on the rPis instead of sending them to the plugin and then ignored
  • manage error messages, if a link to the rPi is lost it will retry 3 times then wait and reduce the number of error messages you see.
Karl


(*)
lines added to indigoconn.py, directly after "def ServerWriteLog(self, logMessage):"
###KW mod to suppress a lot of messages
if logMessage.find("pi_IN_") >-1: return

Posted on
Wed Jan 27, 2016 8:23 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

version 1.5.3 posted


fixed:
- once an hour beacons were moved to the ignore list.
- some smaller fixes

added:
if iBeacon MAC numbers or UUID family names are on the ignore list, the rPis are ignoring them. Now you will get a list of these ignored devices and how often they showed up (*)in ~ documents/piBeacon/rejectedbyPi.json. This file gets updated once an hour.
The reboot frequency of the rPis was set to 5 minutes if:
1. ping does connect to your mac
2. if the beaconLoop python program (the one that does all the work) does not update a file "alive" for > 200+ seconds. Beacon loop updates this file tav least once a minute as part of its main loop. It gets updated independently if there is anything to do. it is just an alive signal.
3. now all temporary files- anything that changes is moved to ~/documents/piBeacon/ out of the plugin container. This was done after following the discussion about path to the indigo plugin.

Karl

(*) I have one with > 20,000 entries per day. But it is not an beacon, must be my car may be.

Posted on
Thu Jan 28, 2016 11:46 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

version 1.5.4 posted


fixed:
if there were no iBeacons around the rPi rebooted itself after ~ 3-5 minutes. (*)


Karl

(*) it should reboot itself if it hangs. But it was not hanging just took too many loops before the "alive" file was updated with a current timestamp.
It should check for # of loop count and # of seconds in the loop before it breaks. it did not check # of seconds properly.

Posted on
Thu Jan 28, 2016 3:34 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

V 1.5.6 posted:

added:

The the config menu for each rPi you can now en/disable the activy check for each rPi individually.
this does not cover the ping test. only if the file "alive" is updated, i.e. no messages or BLUEZ interface is hanging.

so if you have a rip that does not receive any messages you can use this to avoid automatic reboots


Karl

Posted on
Fri Jan 29, 2016 7:18 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

v 1.5.7 posted

fixed:
typo, 1.5.6 did not start

added:
you now can select what the rPi should do if it thinks it hangs (also if there is NO bluetooth traffic), it checks for 10 minutes then do
1. nothing
2. restart the beconLoop program (that queries the bluez stack for new data and sends to the mac). This is quick ~ 1 second
3. reboot ~ 10-30 seconds

for each rPi individually

Karl
Attachments
Screen Shot 2016-01-29 at 7.15.39 AM.png
Screen Shot 2016-01-29 at 7.15.39 AM.png (72.24 KiB) Viewed 14431 times

Who is online

Users browsing this forum: No registered users and 4 guests