Proximity-based relay control to unlock a car using BLE or UWB beacon (like AirTag)?
Moderators: grovkillen, Stuntteam, TD-er
Proximity-based relay control to unlock a car using BLE or UWB beacon (like AirTag)?
I’d like to hack the CDL (central door locking) of my car, in such a way, that when I’m approaching the car and have come close enough, the CDL unlock button inside the car gets triggered once. (Unsure yet, if and as to when it should lock the car when moving away from the car). For additional safety I could imagine to add a touch sensor into the door handle, so that it unlocks only when the door handle is additionally touched.
One idea would be to attach an coin-battery driven nRF51822 BLE iBeacon to the car fob/key chain, measure the RSSI level and trigger actions based on that level. Possible with ESPEasy?
Another idea might be proximity detection using the UWB distance info provided by the iPhone in my pocket. Absolutely no clue however how that could be done (OpenHaystack?).
One idea would be to attach an coin-battery driven nRF51822 BLE iBeacon to the car fob/key chain, measure the RSSI level and trigger actions based on that level. Possible with ESPEasy?
Another idea might be proximity detection using the UWB distance info provided by the iPhone in my pocket. Absolutely no clue however how that could be done (OpenHaystack?).
Re: Proximity-based relay control to unlock a car using BLE or UWB beacon (like AirTag)?
Props for ideas of hacking and using stuff how it was never intended
That's my life motto too
However... when it comes to safety, I think you should always take a step back and have a 2nd thought about it.
Central door locking mechanisms often use "rolling codes" to make it hard(er) to guess what would be the next accepted key and also prevent replay-attacks.
So this makes it a challenge to use a proper rolling code which is easy (and practical) to implement.
Android devices typically use a random MAC and it is unknown what would be the next one.
(you can disable this per access point, defeating the purpose of rolling codes...)
ESP32 does have Bluetooth, but right now it has not yet been supported in ESPEasy.
Also just relying on whether or not your phone can make a connection to a Bluetooth device is also rather tricky for several reasons.
1) The range of Bluetooth is surprisingly long at times, but also surprisingly short when really needed to have a connection.
So what should it do when you're driving the car and the BT connection gets lost?
Or what if you left a child in the car but the bluetooth connection gets dropped?
Or what if your car suddenly gets a BT link while you're far away in a store?
2) It is possible to intercept Bluetooth connections (though it might be hard to do as BT hops frequencies at 1600x a second), but it is for sure not that hard to jam BT connections. In your setup your car will not be left unlocked at a parking spot while the thief with a jammer tries to prevent you to close the car, but opening may be quite frustrating in such situations where you can't get a BT connection.
That's my life motto too
However... when it comes to safety, I think you should always take a step back and have a 2nd thought about it.
Central door locking mechanisms often use "rolling codes" to make it hard(er) to guess what would be the next accepted key and also prevent replay-attacks.
So this makes it a challenge to use a proper rolling code which is easy (and practical) to implement.
Android devices typically use a random MAC and it is unknown what would be the next one.
(you can disable this per access point, defeating the purpose of rolling codes...)
ESP32 does have Bluetooth, but right now it has not yet been supported in ESPEasy.
Also just relying on whether or not your phone can make a connection to a Bluetooth device is also rather tricky for several reasons.
1) The range of Bluetooth is surprisingly long at times, but also surprisingly short when really needed to have a connection.
So what should it do when you're driving the car and the BT connection gets lost?
Or what if you left a child in the car but the bluetooth connection gets dropped?
Or what if your car suddenly gets a BT link while you're far away in a store?
2) It is possible to intercept Bluetooth connections (though it might be hard to do as BT hops frequencies at 1600x a second), but it is for sure not that hard to jam BT connections. In your setup your car will not be left unlocked at a parking spot while the thief with a jammer tries to prevent you to close the car, but opening may be quite frustrating in such situations where you can't get a BT connection.
Re: Proximity-based relay control to unlock a car using BLE or UWB beacon (like AirTag)?
Thanks for your thoughts and comments. I’m not that worried about the iPhone’s BLE signal being recorded by someone. Because a potential, professional thief „interested“ in that BMW i3s would scan for the car’s key fob radio transmission used for BMW’s Keyless Go (aka Comfort Access) option – not a BLE signal transmitted by an iPhone. (If one searches Google, one can see that the signal continuously transmitted BMW’s key fob has been actually used to steal such cars).
No one would assume however that the BLE signal transmitted continuously by the iPhone anyway, is the key to opening the car. Especially as an i3/i3s with official Comfort Access option has a rippled thumb area on the door handles (see image below) — which signal-jacking thieves are looking for —, while the same model without that option configured comes with ripple-free handles. „Security through obscurity“ as an American friend used to say.
My idea would be to pair the respective iPhone(s) with the ESP32 installed in the car, and measure the RSSI level. So when the required RSSI level is exceeded, the car can be opened. It wouldn’t open automatically however: The actual CDL opening command gets triggered by touching the area right above the door handle on the driver’s side, where there would be a TTP223 touch sensor with spring contact (like this one, but of course 3V3 and not dimming) installed behind the car’s plastic door trims (just like a Smart fortwo, the body panels are plastic).
Touching the capacitive button could be either used for opening only or toggling between opening and closing.
My only concern is whether the BLE signal of the iPhone gets reliably detected when approaching the door. I mean: Are we talking about a Bluetooth connection or just the detection of one out of multiple BLE signals in range? Would detecting the iPhone’s Wifi signal and measuring its RSSI level make more sense, if technically possible at all?
Making use of Apple’s U1 UWB chip inside the iPhone is technically impossible, as far as I understand. At least I haven’t found any projects on the web encorporating Apple’s UWB/AirTag and ESP, in the sense of the ESP measuring the distance of a close-by iPhone; UWB’s accuracy would be perfect for this application. (Only found OpenHaystack/ESPs mimicking AirTags).
No one would assume however that the BLE signal transmitted continuously by the iPhone anyway, is the key to opening the car. Especially as an i3/i3s with official Comfort Access option has a rippled thumb area on the door handles (see image below) — which signal-jacking thieves are looking for —, while the same model without that option configured comes with ripple-free handles. „Security through obscurity“ as an American friend used to say.
My idea would be to pair the respective iPhone(s) with the ESP32 installed in the car, and measure the RSSI level. So when the required RSSI level is exceeded, the car can be opened. It wouldn’t open automatically however: The actual CDL opening command gets triggered by touching the area right above the door handle on the driver’s side, where there would be a TTP223 touch sensor with spring contact (like this one, but of course 3V3 and not dimming) installed behind the car’s plastic door trims (just like a Smart fortwo, the body panels are plastic).
Touching the capacitive button could be either used for opening only or toggling between opening and closing.
My only concern is whether the BLE signal of the iPhone gets reliably detected when approaching the door. I mean: Are we talking about a Bluetooth connection or just the detection of one out of multiple BLE signals in range? Would detecting the iPhone’s Wifi signal and measuring its RSSI level make more sense, if technically possible at all?
Making use of Apple’s U1 UWB chip inside the iPhone is technically impossible, as far as I understand. At least I haven’t found any projects on the web encorporating Apple’s UWB/AirTag and ESP, in the sense of the ESP measuring the distance of a close-by iPhone; UWB’s accuracy would be perfect for this application. (Only found OpenHaystack/ESPs mimicking AirTags).
- Attachments
-
- i3s Comfort Access.jpeg (82.61 KiB) Viewed 5813 times
Last edited by Wookbert on 18 Oct 2023, 14:56, edited 1 time in total.
Re: Proximity-based relay control to unlock a car using BLE or UWB beacon (like AirTag)?
Right now ESPEasy doesn't (yet) support Bluetooth, so that's not an option at this moment.
There is also an issue with keeping an AP active on ESPEasy to allow the phone to connect to.
And apart from that, WiFi AP mode does consume the most power of all the WiFi modes.
ESP + WiFi in AP mode + battery powered is really not a good idea as it will for sure drain your car battery in 2 or 3 weeks. (to a level where starting the car may fail, especially in winter)
So right now, I don't think ESPEasy would be a good fit for this purpose.
I would start looking at one of those boards with a Nordic nrf chip that may pull a pin high or low when another (specific) device connects to its Bluetooth beacon.
Or you let such a board send serial data which you can import in ESPEasy... but then ESPEasy runs on an ESP which isn't really well suited for battery operations.
There is also an issue with keeping an AP active on ESPEasy to allow the phone to connect to.
And apart from that, WiFi AP mode does consume the most power of all the WiFi modes.
ESP + WiFi in AP mode + battery powered is really not a good idea as it will for sure drain your car battery in 2 or 3 weeks. (to a level where starting the car may fail, especially in winter)
So right now, I don't think ESPEasy would be a good fit for this purpose.
I would start looking at one of those boards with a Nordic nrf chip that may pull a pin high or low when another (specific) device connects to its Bluetooth beacon.
Or you let such a board send serial data which you can import in ESPEasy... but then ESPEasy runs on an ESP which isn't really well suited for battery operations.
Re: Proximity-based relay control to unlock a car using BLE or UWB beacon (like AirTag)?
As you’ve mentioned the Nordic nRF chip: I’m looking into the Seeed Studio XIAO ESP32C3 (which you’ve mentioned these days, when we discussed the LD2410 implementation), but also came across the Seeed Studio XIAO nRF52840. (And how does the Chinese ESP32-C3 „Supermini“ compare to the Seeed Studio ESP32C3? Is see that the chinese board seems to have a chip antenna, while the Seeed Studio board has an IPX antenna connector).
So which one’s the better choice for the described BLE scanning of known iPhones?
Update: Learned meanwhile through a Video by YouTuber Andreas Spiess, that the nRF52840 is much more energy efficient, than the ESP32-C3.
Question remaining is: Is this even feasible? Can the nRF52840 act as BLE Central and detect the iPhones in BLE advertising mode, and distinguish based BLE UUID which iPhones to accept and based on the RSSI level/trend of those accepted iPhones, whether pressing the touch button on the door handle actually unlocks the door or not?
So which one’s the better choice for the described BLE scanning of known iPhones?
Update: Learned meanwhile through a Video by YouTuber Andreas Spiess, that the nRF52840 is much more energy efficient, than the ESP32-C3.
Question remaining is: Is this even feasible? Can the nRF52840 act as BLE Central and detect the iPhones in BLE advertising mode, and distinguish based BLE UUID which iPhones to accept and based on the RSSI level/trend of those accepted iPhones, whether pressing the touch button on the door handle actually unlocks the door or not?
-
- New user
- Posts: 1
- Joined: 19 Oct 2023, 13:27
Помощь
Может ли кто-нибудь подсказать, как правильно разместить вопрос по нужной теме и получить помощь?
Re: Proximity-based relay control to unlock a car using BLE or UWB beacon (like AirTag)?
Yep, those Nordic nRF chips are about as good as it gets regarding energy consumption.
However I have never used them myself (yet), so I can't tell from experience what is needed to act as a beacon.
I know it should be more of a Bluetooth specs thingy, so I would expect it shouldn't be specific to Android or Apple.
You might however need some app from the vendor (or a generic "Bluetooth Beacon" app if it exists) to do specific stuff with such a beacon.
I know just enough about Bluetooth to have some ideas of what should be possible, but I have never played with it to know about its pitfalls.
However I have never used them myself (yet), so I can't tell from experience what is needed to act as a beacon.
I know it should be more of a Bluetooth specs thingy, so I would expect it shouldn't be specific to Android or Apple.
You might however need some app from the vendor (or a generic "Bluetooth Beacon" app if it exists) to do specific stuff with such a beacon.
I know just enough about Bluetooth to have some ideas of what should be possible, but I have never played with it to know about its pitfalls.
Re: Помощь
Google Translated to English: Can anyone tell me how to correctly post a question on the right topic and get help?VeronikaGusevae wrote: ↑20 Oct 2023, 08:01 Может ли кто-нибудь подсказать, как правильно разместить вопрос по нужной теме и получить помощь?
1) Please ask your questions in English, that's the common language here. (Google Translated to Russian: Пожалуйста, задавайте свои вопросы на английском языке, это общий язык здесь.)
2) Determine the correct Forum-section: ESPEasy, uPyEasy, RPiEasy or RFLink
3) Pick the best fitting subsection (General remarks and question, Projects, Hardware or Software)
4) Start a new thread if you have a new topic, or add to an existing thread with the same subject, if possible.
4) Wait for answers
/Ton (PayPal.me)
Who is online
Users browsing this forum: No registered users and 1 guest