Area/Room Presence Detection for Mobile Devices using ESP32-based BLE Beacons

Hi, is there any chance of getting on a TestFlight beta? Don’t have access to a Mac to compile it myself.

I’m afraid currently not as TestFlight is limited for paying developers. As I am not a professional dev and don’t have any other apps I want published I don’t plan on doing so.
Maybe you can use a VM?

Perhaps supply an ipa and let people use AltStore.io?

That looks interesting and I will look into it, thanks.

@st0nedB, First of all, thanks for creating this awesome project, have been trying to do room presence with an iphone / watch for awhile, but so far not successful with other methods (others do work with android) , so i tried to test your awesome project, but unfortunately run into some issues, the predictions page shows “starting” and nothing else, waited for a long time, toggled betweens on/off, restarted the app, deleted the app and reinstalled it, but making no real progress, so maybe you can point me in the right direction. Iphone X with iOS 14, beacons are esp32 and the json files are populated (so i would say they end looks to be working correct)

Hello
Nice project!

I don’t seem to find the iOS app on the store. What’s the name as it’s registered on the apple store?

OK I just realized you have to build it yourself with XCode and load onto your device…

Hi, yes that’s the current status. I am planning some updates and really recommend the development branch at this stage (should be much more stable).
However, my MacBook died recently and I am currently trying to get my hands on some hardware to continue development. But I don’t currently see this happen before end of Feb 2021.

Do you know if the app is going to work with such beacons rather than ESP32?

https://m.banggood.com/NRF51822-Beacon-Module-bluetooth-RSSI-Positioning-Module-p-1599226.html

In theory it should work with any BT Beacon as long as it can be configured to broadcast the correct UUID, Major, and Minor values (see Readme). I remember it was confirmed to work with other beacons by some user, but I don’t remember the brand.

Hey @Chris_nl, sorry to not reply earlier (I thought I did, but obviously that’s was a mistake on my end). The error you describe sounds very familiar to a bug on Git. Please check out the branch #issue3 (which also contains some improvements regarding prediction stability) and let me know how it goes.
As stated in another message, I hope to be able to continue development by mid/end of February 21.

Not sure if this is helpful or not, but will add room-assistant has a test flight app that runs in the background and broadcasts a BLE address (so is possible).This would be useful for those wishing to switch the set up around and detect the phones from the ESP32 / BT devices that are stationary.

Could you share a little more about your AI models (purely selfishly I want to learn how to build and train models and not sure where to start).
The ESP32s arrive today and going to have a go and see where I get :slight_smile: up until now I’ve been testing 3D triangulation using room-assistant and it’s missing the AI inference part to smooth out fluctuations and harden room boundaries.

In slightly other news there was a discussion the iOS devs had about possibly enabling BLE broadcast from the HA iOS app as an option if you wanted to in the future to make it simple for room tracking scenarios. That will of course use less power etc.

Cool project @st0nedB -excited to try it out :slight_smile:

Hey, thanks for sharing.

I remember that room-assistant has some magic to track the BT MAC-Address. However, according to my knowledge (please correct me if I am wrong), iOS does still not allow broadcasting as an iBeacon in the background.

Sure, please feel free to check out the Python script in the repo, where it is performed. It’s a dead simple classification approach with a few layers and a softmax output layer. I have been thinking about adding recurrent networks to improve performance and also include progression over time, but haven’t gotten around to add it.

Can you please send me the link to this discussion so I can check it out?

Looks like iBeacon is possible for iOS… Check out the room-assistant companion app: iOS Room Assistant Companion App · mKeRix/room-assistant · Discussion #352 · GitHub

Could you possibly share some more guidance on how to use the JSON files for the model.
Got them in the folder, but not 100% sure what to do with the pipenv etc?

Assuming its some kind of packaged python setup?

Also the discussion for the mobile app was over on the Room-Assistant github repo

EDIT: Doh - ok need to run the pipenv on a mac as well.
Its a work machine so locked down, but think installing python3, then pipenv and running that from inside the folder with the python script should do it. Then run the python script with the flag (fingers crossed)

Thanks for the link, I will look into that. My suspicion is, that the companion app there is used to un-cloak (and hence track) the BLE MAC address of the iOS devices. However, that is still different from transmitting as an iBeacon in the background (which is still not possible AFAIK).

The json files contain RSSI measurements from the iBeacons, one file with the measurements from each room (so labeled data, hence I used supervised learning). The RSSI combinations from multiple beacons are ideally characteristic for the areas/rooms where they were recorded. The model is then trained with tuples of RSSI measurements to predict the room for one measurement tuple (i.e. with three beacons, one tuple will contain three RSSI values).
Pipenv is a convenient way to share python environments (i.e. for me to ensure, that users have the same python and required module versions and can run the script without issues). It also prevents users from destroying their own python environment, as it creates a separate python installation which can be activated on demand and also be deleted after use.

cool, thanks - it seems python3 is blocked by the company laptop policy :-/ is there any other way?

Sorry I don’t think there is a way around. Maybe it’s an option to do it on a Pi? Just copy the json files there. If you require further assistance, please message me in private, so this thread doesn’t go to far of-topic.

Hey there, I’m a relative noob to iOS development. Since you don’t have a paid developer account, what’s your process for loading this app with Xcode? Won’t the app only last for 7 days on your device?

heya, Trying to get this installed and failing to get the pipenv up and running to train the model from json files.
Dont suppose you have any tips? The only Mac I have is a work machine (locked down) so been trying to run it on Rpi or Ubuntu but with no luck.