News for hackers. Stuff that matters.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by linvs on Monday November 13, 2023 @06:01PM (#38256556)
Outstanding write-up! We actually built a business based on this technology (occuspace.io) and have had to address almost all the questions that you brought up. To answer some of them here:

Q: How accurate is BLE beacon count, as a proxy for occupancy?

A: It's very highly correlated but different dining locations, classrooms and library floors have very different correlation factors. Consider using other, perhaps more complex features, as well.

Q: How accurate is BLE beacon availability time, as a proxy for dwell time?

A: We don't believe it is very accurate given that BT MAC's randomize every 8-20 mins depending on manufacturer.

Q: Can we improve the accuracy by setting an RSSI minimum, for which devices weaker than it do not count, to ensure only those who are really nearby get counted?

A: That's a great idea. It's worth noting that different types of spaces and depending on where you installed your sensor, will have different threshold levels.

Re:Building an occupancy sensor with a $5 ESP32 and a server... by georgeashworth on Monday November 13, 2023 @10:30PM (#38258725)
Does this type of occupancy tracking work accurately outdoors? I'm assuming it would be difficult because signals would travel further. (My startup needs occupancy tracking for tennis courts.)

Maybe I could mount a BT device at a corner of the outdoor space and use its signal strength as the threshold value.

Re:Building an occupancy sensor with a $5 ESP32 and a server... by rsaxvc on Monday November 13, 2023 @10:57PM (#38258947)
You could mount one at each corner and use a directional antenna to help.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by rsaxvc on Monday November 13, 2023 @11:05PM (#38259000)
You could use the BLE AoA extension as well to derive an angle: https://www.bluetooth.com/blog/new-aoa-aod-bluetooth-capabil...
Re:Building an occupancy sensor with a $5 ESP32 and a server... by rsaxvc on Monday November 13, 2023 @11:11PM (#38259054)
If you want to get really spicy, you can use two antennas and an SDR to compute angle of arrival using nothing but a BLE advertisement's data . This is different from BLE AoA as it doesn't require a cooperative transmitter.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by alias_neo on Tuesday November 14, 2023 @02:10AM (#38260044)
If you want to get really, really spicy, use three devices/antennas and you can roughly track in three-dimensional space.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by milkshakes on Tuesday November 14, 2023 @05:41AM (#38261593)
there are wifi setups that allow you to do this already.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by worthless-trash on Tuesday November 14, 2023 @06:35AM (#38262017)
I would like to subscribe to this API.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by greggsy on Tuesday November 14, 2023 @09:16AM (#38263529)
Wouldn’t three dimensional tracking need four antennas?
Re:Building an occupancy sensor with a $5 ESP32 and a server... by rsaxvc on Tuesday November 14, 2023 @11:24PM (#38273338)
Three appropriately spaced antennas will give you azimuth and elevation of a ray to the transmitter, but not distance.

But using two of the above in different, known locations would allow you to compute the intersection to a 3D location.

Re:Building an occupancy sensor with a $5 ESP32 and a server... by enva2712 on Tuesday November 14, 2023 @12:14AM (#38259440)
You the same george ashworth that used to work at d&b?
Re:Building an occupancy sensor with a $5 ESP32 and a server... by linvs on Tuesday November 14, 2023 @01:25AM (#38259832)
It does but we don't have a battery powered option (yet) so power availability is the bigger issue. Our sensors can only be outlet powered. Each sensor can cover cover roughly 5,000 sq.ft. or about two tennis courts.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by sgu999 on Tuesday November 14, 2023 @03:56AM (#38260746)
Did you consider using BT or UWB as a radar? On a tennis court you won't have any obstacles to worry about, I suspect it's relatively easy to solve.

UWB in particular is accurate enough to get breathing patterns...

Re:Building an occupancy sensor with a $5 ESP32 and a server... by leobg on Tuesday November 14, 2023 @02:46AM (#38260259)
Can you do fall detection for the elderly?
Re:Building an occupancy sensor with a $5 ESP32 and a server... by hellweaver666 on Tuesday November 14, 2023 @05:32AM (#38261523)
Seeed Studio (maker of the Xiao) have mmwave sensors that can do fall detection.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by rozab on Tuesday November 14, 2023 @09:32AM (#38263714)
The differing correlation factors seems like a difficult problem for productizing this. I would expect a STEM college building to have maybe >3 BT devices per person, while other venues may have less than 1.
Re:Building an occupancy sensor with a $5 ESP32 and a server... by bambax on Tuesday November 14, 2023 @10:03AM (#38264071)
> How accurate is BLE beacon count, as a proxy for occupancy?

But how often is an accurate count needed? The initial requirement of the project was just for the OP to "avoid crowds in the dining hall", and for that all one needs is a general idea of highs and lows.

In your business, do customers expect high accuracy? All of them, or some of them?

Also, regarding MAC address, even if they're randomized, isn't there a way to know what kind of device it is? (to count only phones for example, and discard headphones, etc.)

Re:Building an occupancy sensor with a $5 ESP32 and a server... by emmelaich on Friday November 17, 2023 @03:41PM (#38309885)
FWIW, Meraki gives you this as well as part of their cloud management of their network. They might be able to do a lot more if they track wifi, wifi macs, and vision and tie it together.

Just letting you know of one of your potential competitors.