Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Tesla Bluetooth Low Energy (BLE) API Documentation

This site may earn commission on affiliate links.
So what you're saying is that the guy who parks his car out on the street.. I could walk up to it and see his car advertising on my BLE scanner... hmmm
Well that's what I wasn't sure about, but by the sounds of it, yeah. I've got a test app running on my watch that just lists all the Bluetooth LE devices it sees, and I was surprised how many devices it picks up - loads advertising without a name (like 2-3 of those in most places including sometimes from inside my house, where I don't have any Bluetooth devices that I haven't accounted for, so I'm wondering if those might be Apple AirTags or something), and an occasional Samsung TV or Apple Pencil lol. I haven't been near enough to a Tesla in the last few weeks to see how they show up yet though.

So yeah, as much as I'll be glad if they do advertise, as I've got ideas for useful things based on that, I was wondering if perhaps that might be seen as a privacy issue so they might not advertise all the time. I think it could be possible that they might change Bluetooth MAC address randomly every so often to avoid it being used for tracking though? Although on the other hand, the reg plate on the car would kind of do the same job of identifying the car anyway (but I guess it would be a bit more difficult for someone to set up an ANPR system to automate that!)
 
Well that's what I wasn't sure about, but by the sounds of it, yeah. I've got a test app running on my watch that just lists all the Bluetooth LE devices it sees, and I was surprised how many devices it picks up - loads advertising without a name (like 2-3 of those in most places including sometimes from inside my house, where I don't have any Bluetooth devices that I haven't accounted for, so I'm wondering if those might be Apple AirTags or something), and an occasional Samsung TV or Apple Pencil lol. I haven't been near enough to a Tesla in the last few weeks to see how they show up yet though.

So yeah, as much as I'll be glad if they do advertise, as I've got ideas for useful things based on that, I was wondering if perhaps that might be seen as a privacy issue so they might not advertise all the time. I think it could be possible that they might change Bluetooth MAC address randomly every so often to avoid it being used for tracking though? Although on the other hand, the reg plate on the car would kind of do the same job of identifying the car anyway (but I guess it would be a bit more difficult for someone to set up an ANPR system to automate that!)
You see, the name that the car advertises would look something like this: Sfb602a0d5b0ca5ddC

It might look random, but in fact that name never changes as it is just a SHA1 hash of the car's VIN, so yes, you could theoretically be tracked using it. But at that point, they might as well just be following you by your license plate or just general looks of the car, you know. So I wouldn't personally see this as a concern for privacy, although I wouldn't be against hearing some reasons why you think it is.

(oh, i just realized i didn't read your last sentence, which is just a copy of what i said haha)
 
  • Like
Reactions: EddyM2
You see, the name that the car advertises would look something like this: Sfb602a0d5b0ca5ddC

It might look random, but in fact that name never changes as it is just a SHA1 hash of the car's VIN, so yes, you could theoretically be tracked using it. But at that point, they might as well just be following you by your license plate or just general looks of the car, you know. So I wouldn't personally see this as a concern for privacy, although I wouldn't be against hearing some reasons why you think it is.

(oh, i just realized i didn't read your last sentence, which is just a copy of what i said haha)
Finally got my car, when I registered my phone key the name also appears in the bluetooth list 👍
Time to crack out my ESP32
 
  • Like
Reactions: LexNastin
@ArchGryphon
Been reading through the docs again, I should be able to compile the python examples there in order and then wrap my bluetooth library to send/receive the information accordingly, right?

I also noticed in the later examples if there isn't a key available it tries to generate a new key, wouldn't that need to go through the whitelisting again if the key doesnt exist?
 
@ArchGryphon
Been reading through the docs again, I should be able to compile the python examples there in order and then wrap my bluetooth library to send/receive the information accordingly, right?

I also noticed in the later examples if there isn't a key available it tries to generate a new key, wouldn't that need to go through the whitelisting again if the key doesnt exist?
Also, I'm pretty sure every command using a key saves/loads it after generation if it is saved in a file
 
  • Like
Reactions: Lyth
Yes, you'd need to rewhitelist if you didn't already create a key (every example saves the key to a file when creating it). And yes, you'd just do as you said... Here's an example python library one of my friends made, if you need a reference: GitHub - kaedenbrinkman/PyTeslaBLE: Python interface for connecting to Tesla vehicles directly using the BLE API
Sweet, looks like I can run it all off a RPi.

Yea, examples look like they try to load a new key, but then create a new one if it can't load a key - however, I gather creating one would mean that it's a new key and (I assume) mean that it would have to go through a whitelist process again.

Car is in the shop getting tinted atm, so haven't been able to do anything for a few days - hence the questions haha.
 
Sweet, looks like I can run it all off a RPi.

Yea, examples look like they try to load a new key, but then create a new one if it can't load a key - however, I gather creating one would mean that it's a new key and (I assume) mean that it would have to go through a whitelist process again.

Car is in the shop getting tinted atm, so haven't been able to do anything for a few days - hence the questions haha.
If I can't load the key, then it doesn't exist, so it never existed, so I create one...

The first example with a key, creates a key, saves it, and the it gives the whitelist message to you, and in subsequent runs uses the saved one key. What you're saying is that "if I have a keyfob, but smashed it and threw it in the trash and got a new keyfob, i'd have to pair it", like yes, obviously, but there is no reason for the key to not exist, other than, a) you delete it, or b) it never existed in the first place

(sorry if that sounded a bit, toxic, kinda did to me, just way too tired to go change it, barely slept today, haha!)
 
Also, neat that you can run it off an RPi! Tell me about what you end up achieving, if you end up doing anything about it! 😅
I wanted to run it on an ESP32, but I don't have an environment really set up to run it atm.

So the RPI is the next best thing; had a few hiccups with the BLE library - but for the most part I could connect and pull all the BLE services.
 
  • Like
Reactions: LexNastin
I wanted to run it on an ESP32, but I don't have an environment really set up to run it atm.

So the RPI is the next best thing; had a few hiccups with the BLE library - but for the most part I could connect and pull all the BLE services.
Ahh, interesting. Did you look at the PyTeslaBLE library that I told you about? The guy already put in a crossplatform BLE library in there so you can just use it directly
 
Ahh, interesting. Did you look at the PyTeslaBLE library that I told you about? The guy already put in a crossplatform BLE library in there so you can just use it directly
Yea I had a brief look at it.
Its pretty much the full implementation with what looks like all/most of the RKE's implemented.

Didnt look too far into the dependencies but saw there was a BLE wrapped around it.

I just had a really simple script running on RPi that wrapped itself around bluez(I think that's the bluetooth manager for RPi)
 
  • Like
Reactions: LexNastin