Bluetooth LE ESP32 to detect presence of cellphone

Hello,

I'd like to use an ESP32 with Arduino to lock/unlock a door depending on the presence of a cellphone with bluetooth activated.

I do not need to send data between both devices.

I tried some examples, BLE server in the ESP32 and a Xamarin app in Android and they share data and so on, but actually it's not what I'm looking for.

I guess the approach I should have to follow is to develop a service for android and iphone running in the background to look for bluetooth devices and when found the ESP32, share data and then the ESP32 should open the door. However, I think it's a bit hard approach as I'm not a cellphone developer.

Do you know an easier approach? I prefer to work more on Arduino than rather on the cellphone...

What you are trying to do is actively prevented by your smartphone for your own protection. Making your smartphone identifiable without user interaction is a bad idea. You are walking around everywhere with it and therefore it would make tracking you without you noticing very easy. Therefore, iOS and Android developers decided to prevent this by implementing proprietary algorithms that are not publicly documented, that randomly change your smartphones BLE MAC address and UUIDs.

No, you should actively interact with your smartphone to open your door.

If you do not care that you can be tracked and you like to work with Arduino, you can build yourself a BLE device that you carry around and when detected by your homes BLE device opens the door.

You can start by building a BLE peripheral devices. Because everyone can scan a BLE device and get the services and characteristics you then need to implement a system that would require the central and peripheral devices to exchange some data to verify they are who they say they are.

Thanks for your reply, Klaus.

You are right, I haven't thought about been tracked. As I see, I'll have to code in the cellphone.