How and where to place your Proxies #555
agittins
started this conversation in
The Bermuda Cookbook
Replies: 1 comment
-
Great article, should be added to the readme of Bermuda if possible |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This recipe will be an ongoing reference for finding the best ways to place your proxies for more reliable results.
Tip
The super-TL/DR: Place your ESP32 boards plug-down or plug-up, "facing" you. Put them very close to the spots you tend to loiter, rather than in the centre or edges of areas. Add more proxies for more loitering places. For multi-floor situations, place proxies vertically aligned above/below each other between floors. Read on for whys and wherefores, or just go play.
Orientation
Tip
TL/DR: mount the board with the usb socket pointing downwards, and the side of the board that contains the components "facing" the area you want to pick up signals from.
Note
I'm still looking for good source material on this, so corrections might be needed. I'm making some assumptions using my existing RF knowledge (strictly amateur in nature) and things like the application notes from Ti, nxp etc).
A rough approximation of the sensitivity pattern of a typical ESP32 module. The main point is that mounted vertically like this, it is generally sensitive horizontally in all directions, and least sensitive below and above.
The on-board antennas on ESP32 boards have different sensitivity to signals depending on what direction those signals arrive from. An antenna that is equally sensitive from all directions is called "omnidirectional". All this stuff is messy and technical, but essentially:
If you have multiple floors, it might be worth testing if orienting the boards "socket up" on the lower floor and "socket down" on the upper floor offers you better separation between floors.
Placement in 2D (single floor)
Tip
TL/DR: Place proxies close to the locations that your devices tend to hang out, rather than the centre of an area or around the edges. Eg: To reliably detect your phone as being "in office", put a proxy on your desk, rather than near the office door. Place multiple proxies in one area for more reliability if there are multiple "hangout areas" in one area (eg desk, reading chair etc), or for large areas, or to improve reliability when a proxy might miss adverts.
Note
This description is given with the current (as at 2025-03) Area-matching system of simply choosing the closest scanner. Later algorithms such as those enabled by trilateration may alter the best placement strategy.
Bermuda compares the distances from a device to each proxy that can see it. These "distances" are calculated by signal strength, so are very "noisy" and vary significantly from moment to moment. After filtering etc, Bermuda chooses which proxy it thinks is closest, and uses that proxy's area as the area for the device.
This is a graph of what the raw (teal) and filtered (peach) distance measurements to a single proxy look like for a wristwatch, over a 2-minute period. Even with very little movement, the raw measurements easily vary by 100%
One of the main methods Bermuda (currently) uses to compare distances is the percentage difference. This is one way to establish that two distances are "substantially different". If the actual distances are more substantially different, then Bermuda's decisions will be less impacted by the noise in our measurements. Percentage difference expresses the difference in measurements as a percentage of the average of the distances.
Put more simply:
So optimise your proxy locations so that most of the time, for the situations that matter, the distances between proxies is as different as possible.
Examples
Bermuda can easily and reliably associate the person with the right-hand proxy, because the difference in distances, relative to those distances, is large. The percentage difference here is 107%
= (1 - 0.3) / ((1 + 0.3) / 2)
, which is "large". This means Bermuda's decision won't easily be influenced by noise. Note that we'd get the same percentage difference of 107% if the distances were 10m and 3m - it compares the relative difference between the distances.In the previous example, the difference between the measurements was 0.7m. In this example, the difference is still 0.7m, but this is over a longer range, so the relative difference is smaller than the first example. Here, our percentage difference is actually 26%.
Let's consider a practical implementation...
Note
We'll ignore the losses caused by walls in these examples. Quite often, they have less effect than you might expect. But generally, any absorption by walls will actually improve your results, because it helps to increase the relative difference between the measurements.
Here we have a floorplan (courtesy of Rockwell Land via Wikimedia, CC-SA) showing two proxies placed on desks either side of a wall, with a person at one desk and another on the bed.
Assuming that the left proxy is assigned to the area
master bedroom
and the one on the right tobedroom 2
, we can see that:So what's the answer?
If we move just the left proxy to the bedside table, then our desk position will always be wrong (because it's so close to
bedroom 2
's desk. So let's move both proxies to their relative bedside tables.This might seem like a fairly obvious solution but we actually have more trouble with the desk location now.
As with Life:tm:, everything is a trade-off. We've completely solved the bed detection issue, but greatly reduced reliability of desk detection, but it's still better than the previous bed detection was (20% vs 6.9%).
If people rarely use either desk, no biggie. But what does it take to improve it? You could install metallic foil on the dividing wall. This might work - but it might actually make things worse! Radio waves are tricksy and quick to anger. Your attempt to block the signal might end up acting as a passive radiator and instead focusing the waves, or it might cause reflections that interfere with and reduce the signal at your nearest proxy, but not the more distant one. Some of these situations are pretty unlikely, but the point is that 2.4GHz signals don't always act the way we think they do, and are very good at teaching us humility.
Last I checked, a clone of an ESP32 board comes in much cheaper than several square metres of copper mesh, so let's just throw two more proxies at the problem.
Now things are getting interesting!
Assuming that the proxies in each room are allocated to the same area (
master bedroom
andbedroom 2
), then the distances in grey won't be relevant, since Bermuda will only care about the closest proxy from each area, so we're really only looking at the red lines. So for the person on the bed, Bermuda is comparingmaster bedroom
's bedside proxy withbedroom 2
's desk proxy. These have a percentage difference of about 90% - great!The desk is back to our original layout, since the bedside proxies are too far away to be "in the race". So we are back to a very reliable 80%.
Great! So what is it like for when someone's standing at the door?
Pretty rubbish, actually.

Sometimes life just punches you in the guts, and you gotta take it. Percentage diff here is tiny, maybe 5%. You might be helped a bit by the walls blocking (or, the reflections from the wall might make it worse - F'n'ell, Fresnel!)
We can keep adding proxies, of course, but this is where Trilateration becomes the best bet. Bermuda doesn't have that yet (coming soon!™️) but you can explore Hogster's work that adds this on top of Bermuda at https://github.com/Hogster/BPS
Placement in 3D (multiple floors)
OK, so if you have multiple floors things get a little trickier, but as long as you understand the 2D layout above, it's not too hard to reason about what happens when we have multiple floors.
Tip
TL/DR: As at March 2025, Place proxies on neighbouring floors directly above/below each other. If there's a floor above, avoid placing your proxies too high, and vice-versa. Ensure your proxies are either "upright" or "upside-down", per the "Orientation" section above.
This is all about percentage difference, too - but we'll come at it from a slightly different angle.
Note that in the Orientation section above, we see that if we mount the board vertically with the socket down, it will be most sensitive in the horizontal plane - it's worth using this to your advantage! You might also consider mounting them socket-up if you want them to be less sensitive to the floor above.
The obvious problem is this:

Here we see that the "closest proxy" is actually on a different floor. Sometimes we find that even reinforced concrete has little effect on RF, so it's quite likely that this will happen with all sorts of constructions.
We'll skip the math (because I certainly did), but I'm pretty sure that the only way to ensure that you are always closer to the proxy on your floor is to align the proxies vertically.
The distances
a
andc
are quite different here, so correct area detection is easy/reliable.Caution
Trig warning.
At the risk of causing high-school trig flashbacks, we can see that a, b, and c form a right-angle triangle, and I'm going to let my man Pythagoras cook.
c = sqrt( a^2 + b^2)
Let's assume the floors are 2.6m apart, so that's
b
. We can fiddle that a bit if the height of the proxies is not the same as the height of the phone or watch that the person has with them, but meh.If you're 1m away from your floor's proxy (so
a = 1
) thenc
, the distance from the downstairs proxy will be 2.76 - this gives a percentage difference of... 93% - easy!At 2m away, the downstairs proxy is at 3.28m, 48% difference, still pretty good.
At 3m, 3.969m, 27% still not too bad, but not great.
Where it gets to what I think is probably borderline, is at 4m. This puts the downstairs proxy at 4.77m away, giving roughly 17% percentage difference. Currently Bermuda uses a threshold somewhere between 9% and 20% to decide whether to stick with the current area or switch to the apparently closer one, so I'd be expecting things to get a little glitchy at around 4m.
At longer distances,
a
andc
become much closer in magnitude - ie, their percentage difference is lower, making it harder to reliably detect which proxy is closer, given the variability of our measurements.Postscript...
Okie dokie, that about does it for where Bermuda is at currently. Quite likely this has given you all sorts of ideas about how Bermuda can be improved or how we can combine multiple measurements. I'd suggest diving in and having a good read of some of the existing discussions so you can get a feel for what's been explored already and where the avenues for improvement are:
Beta Was this translation helpful? Give feedback.
All reactions