piBeacon: 10- How to use plot beacon positions

Posted on
Sun Oct 22, 2017 9:15 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: 10- How to use plot beacon positions

To create a png file of your home with the positions of your beacons like this::
Screen Shot 2017-10-22 at 20.15.15.png
Screen Shot 2017-10-22 at 20.15.15.png (431.33 KiB) Viewed 12877 times
Here with 8 beacons
== r1,r2,r3, t, using different options for how to show the beacons: just text, dot, small circle, circle prop to distance to RPI
== my car keys: VT, VG, MR, MT just as text
== and 10 RPIs(R-x) - for the RPI's you MUST make sure that their positions properties (X,Y,Z Pos in edit RPI device) are correct.
the // marked beacons are upstairs, the plain squares/circles are downstairs. The black edge circles/squares have status UP -- the others are down (none in this pic),

1. create a background file e.g. by using excel ,- make the cells equal size, create the outline with a double border and the inside walls with a single border, then do a screen shot - put it into ~/indigo/piBeacon/plotPositions/background.png( in v 6+; new versions see config settings),
Screen Shot 2017-10-22 at 21.37.58.png
Screen Shot 2017-10-22 at 21.37.58.png (59.02 KiB) Viewed 12877 times
Or if you have an image even better

2. in config set the over all parameters:Most of the parameters should be obvious. Make sure that the dimensions x,y scan are proportional to your background image.
Screen Shot 2019-06-20 at 08.21.08.png
Screen Shot 2019-06-20 at 08.21.08.png (126.52 KiB) Viewed 9508 times

3. setup each beacon you want to show
Screen Shot 2017-10-22 at 21.47.29.png
Screen Shot 2017-10-22 at 21.47.29.png (196.77 KiB) Viewed 12877 times
Make sure the TX power is set properly as it determines the distance calculation (txpower = received RSSI at 1 m distance)
Also make sure the update frequency etc are set properly as it impacts when numbers get updated etc.

This is reasonably accurate ~ 3m if you use enough RPI's = each room should have an RPI. When the signal from beacon has to go through a wall it will add about 15 m in the US, in Europe with stone walls likely much more.

All beacon positions will be between the RPIs . Even if the beacon is outside the house, best would be to put 4 RPI ~ 5m away from the house in all 4 corners and then some inside.
The algorithm will take the distance to closest RPI in the direction of the RPI with the second highest signal, corrected by RPI# 3,4,5 in smaller corrections, but still on the circle around the closest RPI. If you have a better idea for an algorithm let me know.


Karl

Posted on
Wed Nov 08, 2017 10:31 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: piBeacon: How to use plot beacon positions

One suggestion: how about not plotting expired beacons? Jeff and I are both gone, but our XYs are still shown as being near the door that we left by...

Posted on
Wed Nov 08, 2017 3:24 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: How to use plot beacon positions

The idea was if they are lost you have the last position.

Can add an option.


Sent from my iPhone using Tapatalk

Posted on
Wed Nov 08, 2017 4:31 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: How to use plot beacon positions

added the option to not show expired beacons in position plot ==> v ..161

Karl

Posted on
Wed Nov 29, 2017 1:45 pm
polycron offline
Posts: 100
Joined: Jan 08, 2006

Re: piBeacon: How to use plot beacon positions

I'm in the process of creating a background for my house. Using your idea of a spreadsheet with double/single lines for the walls, I created a diagram of the house where each square is 2 feet. My capture was of 1 square to the left/right/top/bottom of the house so I had a 1 square boarder all around it. I haven't actually measured the house yet so I was doing a lot of approximations for my initial tests. My complete grid is 26 squares wide (52 feet) and 54 squares high (108 feet).

Based on the above, would I use the following: X scale: 52 Y scale: 108? I'm not following what the Image size = # of y-dots is supposed to be. And when putting in the coordinates for the rPi's I'm assuming I would use the lower left corner as 0,0 correct? The upper right corner would be 52,108?

Jeff

Posted on
Wed Nov 29, 2017 3:13 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: How to use plot beacon positions

Number of dots is the graphical resolution dpi = any number you like. This is driven by the resolution of you phone or screen.
And yes to x and y


Sent from my iPhone using Tapatalk

Posted on
Wed Jun 27, 2018 9:28 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: piBeacon: 10- How to use plot beacon positions

What would be the best way to deal with Z axis. I have 2 floors to cover. I think i saw this mentions somewhere but i cant remember where.

I have 10 PI's (well 6 with 4 more to install over the next few days) 1 in each far corner 2 in the garden and the remaining 4 are to be homed permanently internal as it is a long property but not wide. 2 on on side of the house are upstairs and the other 2 at the other end are downstairs, all with Z defined.

All seems to work well so far but for fun i am tracking my 2 dogs and some static objects for position tuning.

Would be good if the algorithm could do 1 or 2 things if it thinks Z is above a definable threshold (that represents ground floor ceiling height)
1) Placed a red ring (or something) around the object
2) Move to second background image so shift X plot (or Y plot depending on where the second image is on the page) by a definable distance.

If this is not the place to discuss this, happy to start a new thread. Just curious if there is a good way to deal with multi floors. (gonna need more than 10 PI's at this rate maybe) :)

Posted on
Wed Jun 27, 2018 10:55 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: 10- How to use plot beacon positions

currently the z coordinate use is very simple:

use the closest RPI z coordinate( z = 0 or not= 0)

Nothing else.

the issue with distance calculation is that there are walls and they reduce the signal (in the US: wooden walls) by about 20dBm.
that makes it very difficult to do a precise calculation.

BUT what we could do: set z to 0/1/2/3 (or 1/2/3/4 in the US) and then set the z position to that level of the closest RPI .
Then show that through different symbols in the display.
for 3 levels that would take ~ 12 RPI (one in each corner) .. currently it is 10 max with ibeacon (0-9) hardwired..
- # of states would need to add permanently 3 extra states per RPI
- the loops are more easily done
- the formatting is currently 1 digit would then like to change to 01, .., 12 etc

Karl

Posted on
Sun Feb 17, 2019 8:43 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: piBeacon: 10- How to use plot beacon positions

Any idea why two of my RPis (and the beacons close to them) stopped showing up? I've got 5 pis in the house, all of which were showing up last fall... I admit I hadn't opened that control page in a while, but when I started playing with the ITAGs, I opened it to see how they would show up, and found that the two rPIs furthest right on the control page weren't there any more and beacons only showed up if they were left of the pi in the middle of the house... The pis at (Pi0)"64,55,7", (pi1)"67,25,6", and (Pi4)"40.,50.,6." are showing up but (pi2)"97,42,6" and (pi3)"107,11,6" are not and beacons vanish if they are taken much past an imaginary line between Pi0 and Pi1, although their distances are reported reasonably correctly if I look at the device data. The scale for the house is X-scale 140, y-scale 70,z-levels 0,10, # of y dots 824.

Posted on
Mon Feb 18, 2019 7:19 am
johnfdl offline
Posts: 177
Joined: May 18, 2017
Location: Atlanta, GA USA

Re: piBeacon: 10- How to use plot beacon positions

My first thing to check is to see if they are connected. Perhaps (if wifi connected) they are out of range of your wifi.

Posted on
Mon Feb 18, 2019 8:59 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: piBeacon: 10- How to use plot beacon positions

All 5 are hardwired and detecting beacons; in fact, I used Pi2 to calibrate the signal strength of the new ITag.(-66 db at 1 meter) just before I brought up the page to see if it's location would be more or less correct and discovered Pi2 and Pi3 not showing up.

Posted on
Mon Feb 18, 2019 6:41 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 10- How to use plot beacon positions

Try all z coordinates = 0 or 10

It is binary. Either 0 or not.

Can you try to change the z position to a similar one as the ones that show up?
Then increase x,y
Check if they show up





Sent from my iPhone using Tapatalk

Posted on
Tue Feb 19, 2019 11:21 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: piBeacon: 10- How to use plot beacon positions

kw123 wrote:
Try all z coordinates = 0 or 10

It is binary. Either 0 or not.

Can you try to change the z position to a similar one as the ones that show up?
Then increase x,y
Check if they show up





Sent from my iPhone using Tapatalk


I'll try that tonight, but at the moment, pi0 is tho odd man out (at Z=7 since it's sitting on a shelf in the closet rather than on a windowsill like the others), and it is showing up along with 1 and 4 which are at z=6 just like 2 and 3 which aren't showing up... I'll also try setting the XY position of 2 and 3 somewhere between 0 and 1 to see if like the beacons they suddenly reappear.

Posted on
Tue Feb 19, 2019 11:54 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: 10- How to use plot beacon positions

yes that would help.. move them into the xy coordinates that show.


=======
correction on the z levels:

in config you can set up to 4 FIXED integer z levels

the RPI MUST use one of these levels.

eg zLevels= 0,5,10,15
then an RPI can be 25,15,0 ; 25,15,5; 25,15,10; ; 25,15,15
with x=25, y =15
In device edit

then in the plot PGM it uses:
Code: Select all
for i in range(nZlevels):
    Zlevels[i] = int(Zlevels[i])
hatches = ["","//","\\","+"]
...
                hatch=""
                for ii in range(nZlevels):
                    if int(pos[2]) == Zlevels[ii]:
                        hatch = hatches[ii]
                        break
...
                        circle = plt.Circle([pos[0],pos[1]], distanceToRPI, fc=color, ec=edgecolor,alpha=alpha,hatch=hatch)
                        ax.add_patch(circle)
## and the same for squares ..


so if there is no match in z coordinate it will use no dashed ... mark, but they should still show up

Karl

Posted on
Tue Feb 19, 2019 8:37 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 10- How to use plot beacon positions

also please check:
Code: Select all
/Library/Application Support/Perceptive Automation/Indigo 7.2/Preferences/Plugins/com.karlwachs.piBeacon/plotPositions/positions.json

and after switching on debug plot positions in config:
Code: Select all
/Library/Application Support/Perceptive Automation/Indigo 7.2/Preferences/Plugins/com.karlwachs.piBeacon/plotPositions/plotPositions.log


that should show you witch devices get plotted.

Karl

Who is online

Users browsing this forum: No registered users and 4 guests